m-popovic / hjerson

Hjerson: An Open Source Tool for Automatic Error Classification of Machine Translation Output
Other
0 stars 0 forks source link

about the use of -s -c -m #2

Open genbei opened 3 years ago

genbei commented 3 years ago

Hi, it's me again. I wanted to try the other three outputs later, but all of them encountered problems

 -s, --sent sentence-errors.txt raw error counts and error rates at the sentence level are written in "sentence-errors.txt"

-c, --cats categories.txt Original reference and hypothesis words labelled with a corresponding error class are written in "categories.txt"

-m, --html categories.html Original reference and hypothesis words with coloured errors in HTML format.

my script is python hjerson.py -R dev.pe -H dev.mt -m dev.html The error is

Traceback (most recent call last):
  File "hjerson.py", line 860, in <module>
    main()
  File "hjerson.py", line 762, in main
    write_html(args.html, args.html, args.hypothesis_additional, hypWords, bestWerHypAdd, hypErrorCats, "hyp")
  File "hjerson.py", line 236, in write_html
    htmltxt.write(font+words[nc]+addcat+closefont)
NameError: name 'htmltxt' is not defined

The problems with -care similar

 File "hjerson.py", line 196, in write_error_cats
    errcattext.write(str(nSent)+"::ref-err-cats: ")
NameError: name 'nSent' is not defined

It also shows that -s has no parameters [-s]

sadanyh commented 2 years ago

Hi

I encountered the same issues as above. Is there a way to solve it? Thanks for the interesting tool and paper.

m-popovic commented 2 years ago

if you give the names of the new files where the content should be written it should work!

E.g. hjerson.py -R my_reference -H my_hypothesis -s my_sentence_error_file -c my_counts -m my_html.html

m-popovic commented 2 years ago

There was indeed a problem with writing htmls -- it should be fixed now.

m-popovic commented 2 years ago

And, "-s" definitely has no parameters now, the results are written to the standard output