Open
Description
The diff_predictions script reports the error shown below with a call to the 'save' method of the XlsxWriter package.
Correcting line 624 of the script from:
write.save()
to:
writer._save()
resolves the error.
(silnlp-py3.10) PS C:\Users\mm9q\PycharmProjects\silnlp> poetry run python -m silnlp.nmt.diff_predictions FieldTests.Attention\Indonesia\Luang\NLLB.1.3B.lex-LNG.en-LBT.NT.SDPA --show-diffs --scorers bleu chrf3 chrF3+ chrF3++
2024-12-10 12:10:49,545 - silnlp.common.environment - INFO - Using workspace: S:/ as per environment variable SIL_NLP_DATA_PATH.
[nltk_data] Downloading package punkt to
[nltk_data] C:\Users\mm9q\AppData\Roaming\nltk_data...
[nltk_data] Package punkt is already up-to-date!
2024-12-10 12:10:50,423 - silnlp.common.utils - INFO - Git commit: 73e7c5507a
INFO:silnlp.common.utils:Git commit: 73e7c5507a
Git commit: 73e7c5507a
Analyzing predictions file: S:\MT\experiments\FieldTests.Attention\Indonesia\Luang\NLLB.1.3B.lex-LNG.en-LBT.NT.SDPA\test.trg-predictions.detok.txt.5000
Calculating BLEU scores ...: 4196it [00:01, 2140.68it/s]
Calculating chrF3 scores ...: 4196it [00:02, 1630.27it/s]
Calculating chrF3+ scores ...: 4196it [00:02, 1645.83it/s]
Calculating chrF3++ scores ...: 4196it [00:02, 1567.05it/s]
Traceback (most recent call last):
File "C:\Users\mm9q\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\mm9q\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Users\mm9q\PycharmProjects\silnlp\silnlp\nmt\diff_predictions.py", line 630, in <module>
main()
File "C:\Users\mm9q\PycharmProjects\silnlp\silnlp\nmt\diff_predictions.py", line 624, in main
writer.save()
AttributeError: 'XlsxWriter' object has no attribute 'save'. Did you mean: '_save'?
(silnlp-py3.10) PS C:\Users\mm9q\PycharmProjects\silnlp>
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
🔖 Ready