microsoft / CodeXGLUE

CodeXGLUE
MIT License
1.5k stars 363 forks source link

this line is wrong #172

Open mylyes opened 10 months ago

mylyes commented 10 months ago

https://github.com/microsoft/CodeXGLUE/blob/e252e54a74dd55b1294e2379b213b1541dfefaf5/Code-Code/code-to-code-trans/evaluator/CodeBLEU/weighted_ngram_match.py#L283

parameter ‘reference‘ is a type of list(list(str),dict(str)), but not list(str), so i think this line should be 'ref_lens = (len(reference[0]) for reference in references)'

celbree commented 9 months ago

The type of references is list(list(str)), like said in the docstring.

mylyes commented 9 months ago

image image image

I review the code and debug it ,the reference is type of list(list(str), dict(str)) indeed, I hope you can review it pls, ty