Skip to content

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

@jingsongs

Description

@jingsongs

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions