def load(in_file, mmap=True): word_dict = Trie() entity_dict = Trie() word_dict.mmap(in_file + '_word.trie') entity_dict.mmap(in_file + '_entity.trie') return Vocab(word_dict, entity_dict)
def load(in_file, mmap=True): title_dict = Trie() redirect_dict = RecordTrie('<I') title_dict.mmap(in_file + '_title.trie') redirect_dict.mmap(in_file + '_redirect.trie') inlink_arr = np.load(in_file + '_prior.npy', mmap_mode='r') return EntityDB(title_dict, redirect_dict, inlink_arr)