AIPHES / emnlp19-moverscore

MoverScore: Text Generation Evaluating with Contextualized Embeddings and Earth Mover Distance
MIT License
192 stars 31 forks source link

RuntimeError: Sizes of tensors must match except in dimension 1 #28

Open jingsongs opened 5 months ago

jingsongs commented 5 months ago

Hello, is MoverScore only support for Bert model? When I use the mdeberta-v3-base model, I got this error: 捕获

The below is my code: os.environ['MOVERSCORE_MODEL'] = "mdeberta-v3-base"

from moverscore_v2 import get_idf_dict, word_mover_score from collections import defaultdict

refs = ['English is a language', 'English'] sys = ['Language English', 'Chinese']

idf_dict_hyp = get_idf_dict(sys) # idf_dict_hyp = defaultdict(lambda: 1.) idf_dict_ref = get_idf_dict(refs) # idf_dict_ref = defaultdict(lambda: 1.) scores = word_mover_score(refs, sys, idf_dict_ref, idf_dict_hyp, stop_words=[], n_gram=2, remove_subwords=True) print(scores)

Thanks.