Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jingsongs opened this issue Mar 22, 2024 · 0 comments
Open

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

jingsongs opened this issue Mar 22, 2024 · 0 comments

Comments

@jingsongs
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant