Closed zysNLP closed 4 years ago
I got the score very differently from you.
from collections import defaultdict
idf_dict_ref = defaultdict(lambda: 1.)
idf_dict_hyp = defaultdict(lambda: 1.)
translations = ['I have a good idea.']
references = ['so what did you see?']
print(word_mover_score(references, translations, idf_dict_ref, idf_dict_hyp, [],
n_gram=1, remove_subwords=True, batch_size=48))
[0.14760867319451942]
Hi, as you mentioned in your readme:
from moverscore import get_idf_dict, word_mover_score from collections import defaultdict idf_dict_hyp = get_idf_dict(translations) # idf_dict_hyp = defaultdict(lambda: 1.) idf_dict_ref = get_idf_dict(references) # idf_dict_ref = defaultdict(lambda: 1.) scores = word_mover_score(references, translations, idf_dict_ref, idf_dict_hyp, \ n_gram=1, remove_subwords=True)
I tried to make: translations = ['I have a good idea.'] references = ['so what did you see?']
After I execute these codes, I got scores=['1.0'], I think it is a wrong results. In my .moverscore dir I got files: ['MNLI_BERT.zip', 'config.json', 'MT', 'pytorch_model.bin', 'vocab.txt']
So could you please show an example for several pairs of sentences especially scores between them?