f1fc699be9ce8b249cf5bd670d2200f990a5294d,conceptnet5/vectors/evaluation/analogy.py,,eval_analogies,#Any#,85
Before Change
standardized_uri("en", word)
for word in wordfreq.top_n_list("en", 100000)
]
tframe = frame.loc[vocab]
total = 0
correct = 0
for quad in quads:
if all(term in tframe.index for term in quad):
prompt = quad[:3]
answer = quad[3]
vector = analogy_func(frame, *prompt)
similar = similar_to_vec(tframe, vector)
result = None
for match in similar.index:
if match not in prompt:
result = match
break
if result == answer:
correct += 1
else:
print(
"%s : %s :: %s : %s (should be %s)"
% (quad[0], quad[1], quad[2], result.upper(), answer)
)
total += 1
return correct, total, correct / total
After Change
for word in wordfreq.top_n_list("en", 200000)
]
wrap = VectorSpaceWrapper(frame=frame)
vecs = np.vstack([wrap.get_vector(word) for word in vocab])
tframe = pd.DataFrame(vecs, index=vocab)
total = 0
correct = 0
seen_mistakes = set()
for quad in quads:
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 7
Instances
Project Name: commonsense/conceptnet5
Commit Name: f1fc699be9ce8b249cf5bd670d2200f990a5294d
Time: 2016-09-09
Author: rob@luminoso.com
File Name: conceptnet5/vectors/evaluation/analogy.py
Class Name:
Method Name: eval_analogies
Project Name: pmorissette/bt
Commit Name: 568e0c183c5092f9ca62c79d91bf1ebdb379648b
Time: 2020-11-30
Author: pascal.i.tomecek@jpmorgan.com
File Name: bt/core.py
Class Name: StrategyBase
Method Name: positions
Project Name: commonsense/conceptnet5
Commit Name: 2632da5ff127dfe2b62cc7fc04681cc330284797
Time: 2017-03-02
Author: rob@luminoso.com
File Name: conceptnet5/vectors/evaluation/wordsim.py
Class Name:
Method Name: make_comparison_table