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

Replacing 1 by # #7

Closed
astariul opened this issue Oct 15, 2019 · 1 comment
Closed

Replacing 1 by # #7

astariul opened this issue Oct 15, 2019 · 1 comment

Comments

@astariul
Copy link

In this line (code for evaluation of CNNDM)

sentence = fix_tokenization(l.strip()).replace('1', '#')

1 is replaced by #.

I don't understand it. Can someone explain me the reason of such post-processing ?

@donglixp
Copy link
Contributor

The file unilm/src/gigaword/eval.py follows the gigaword data preprocessing as in https://github.com/harvardnlp/sent-summary, which substitutes all the digits to #. However, our bpe tokenizer uses # to indicate subwords. So we preprocess the special token # to 1, and then replace them back after prediction. Notice that the unilm/src/cnndm/eval.py script doesn't use the preprocess.

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

2 participants