b4d5c80c83ec0502231ff3563fa8ac5b95717267,conceptnet5/vectors/transforms.py,,make_replacements,#,110
Before Change
intersected = big_frame.loc[small_frame.index].dropna()
index, index_map = build_annoy_tree(intersected, tree_depth)
replacements = {}
average_similarity = []
for term in big_frame.index:
if term not in small_frame.index:
indices, scores = index.get_nns_by_vector(big_frame.loc[term], 2,
include_distances=True)
After Change
replacements = {}
for term in big_frame.index:
if term not in small_frame.index:
most_similar = similar_to_vec(intersected, big_frame.loc[term], limit=1)
got = list(most_similar.index)
if got:
replacements[term] = got[0]
return replacements
def choose_small_vocabulary(big_frame):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
Instances Project Name: commonsense/conceptnet5
Commit Name: b4d5c80c83ec0502231ff3563fa8ac5b95717267
Time: 2017-06-14
Author: joanna.teresa.duda@gmail.com
File Name: conceptnet5/vectors/transforms.py
Class Name:
Method Name: make_replacements
Project Name: raghakot/keras-vis
Commit Name: 9f221345e7a58804e347f2a1879b06922222413b
Time: 2017-07-03
Author: ragha@outlook.com
File Name: docs/md_autogen.py
Class Name: MarkdownAPIGenerator
Method Name: module2md
Project Name: nilmtk/nilmtk
Commit Name: 72f3f5bf50ed2d91cdcfbe2cf47120a2df8883cd
Time: 2014-11-26
Author: jack-list@xlk.org.uk
File Name: nilmtk/elecmeter.py
Class Name: ElecMeter
Method Name: _get_stat_from_cache_or_compute