How to use the deeprank.utils.read_word_dict function in deeprank

To help you get started, we’ve selected a few deeprank examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pl8787 / DeepRank_PyTorch / deeprank / dataset.py View on Github external
def __init__(self, config_file):
        self.config_file = config_file
        self.config = json.loads( open(config_file).read() )

        self.Letor07Path = self.config['data_dir'] #'/home/pangliang/matching/data/letor/r5w/'

        self.word_dict, self.iword_dict = utils.read_word_dict(
            filename=self.Letor07Path + '/word_dict.txt')
        self.query_data = utils.read_data(
            filename=self.Letor07Path + '/qid_query.txt')
        self.doc_data = utils.read_data(
            filename=self.Letor07Path + '/docid_doc.txt')
        self.embed_dict = utils.read_embedding(
            filename=self.Letor07Path + '/embed_wiki-pdc_d50_norm')
        self.idf_dict = utils.read_embedding(
            filename=self.Letor07Path + '/embed.idf')

        self.feat_size = self.config['feat_size']

        self._PAD_ = len(self.word_dict)
        self.word_dict[self._PAD_] = '[PAD]'
        self.iword_dict['[PAD]'] = self._PAD_

deeprank

Rank Protein-Protein Interactions using Deep Learning

Apache-2.0
Latest version published 3 years ago

Package Health Score

48 / 100
Full package analysis

Similar packages