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

Bug in indexing dev set examples UD POS #25

Closed
blazejdolicki opened this issue May 12, 2020 · 2 comments
Closed

Bug in indexing dev set examples UD POS #25

blazejdolicki opened this issue May 12, 2020 · 2 comments

Comments

@blazejdolicki
Copy link
Contributor

Something is wrong with indexing examples in the dev set of the POS tagging task. In this file every index is assigned to one sentence. However, we can see that index 772 is assigned to two sentences
image

This results in predictions of two separate sentences being merged together, like in the following table, which ruins the alignment between sentence and its prediction. You can see that the higlighted ending in row 772 should actually be in the next row.
image

Row 772 is an example, but there are two more such erroneous rows.

@JunjieHu
Copy link
Contributor

JunjieHu commented May 13, 2020

@blazejdolicki The *.idx files actually record the original sentence index in the download/udpos/dev-xx.tsv files. The reason to create this index file is that most pre-trained models have their own tokenizers which tokenize an original sentence to a longer one. The length of the tokenized sentences might exceed a pre-defined value such as 128, 256, or 512.

Current models can only make tag predictions for sequences with a maximum length such as 512. In our paper, we used 128 as the maximum length. So to make tag predictions for a longer tokenized sentence, we break it into two for separate predictions, and record their original index in order to merge the two predicted tag sequences as the final output.

In your above example, you can check Line 13067 of the original file in download/udpos/dev-nl.tsv to see that the two tokenized sentences with the same index actually come from one sentence. During evaluation, we actually check the tag predictions line by line with the ground-truth labels in the original files download/udpos/dev-xx.tsv.

Let me know if the above explanation is clean to you.

@blazejdolicki
Copy link
Contributor Author

Thank you for clarification! So I used the file download/udpos/udpos_processed_maxlen128/nl/dev.xlm-roberta-large (where the sentences exceeding the limit are split) instead of download/udpos/dev-nl.tsv and that caused to the problem. After changing the file, the alignment is correct. I'm closing the issue.

blazejdolicki pushed a commit to blazejdolicki/multilingual-analysis that referenced this issue May 14, 2020
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