-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Add Danish NER corpus #3639
base: master
Are you sure you want to change the base?
Add Danish NER corpus #3639
Conversation
@stefan-it there are some discrepancies in the dataset statistics, but I think this is probably explained by the removal of the OpenSubtitles part of the corpus, as noted here: https://huggingface.co/datasets/chcaa/dansk-ner#domain-distribution |
Hey @alanakbik , thanks for this PR! I compared it quickly to my draft implementation, and I spotted a few differences - right side is output of this PR, training split: or: |
@stefan-it thanks for noticing this! There was an issue with handling of newline characters that were previously simply excluded, causing the token offsets to not line up anymore. The first sentence in your example was prefaced by a single newline token, which was excluded, explaining the offsets. With this fix, the statistics of the dataset now fully line up with the statistics posted on https://huggingface.co/datasets/chcaa/dansk-ner#domain-distribution, minus the OpenSubtitles part that was excluded. |
] | ||
|
||
with open(debug_json_path, "w", encoding="utf-8") as f_debug: | ||
json.dump(dataset_for_json, f_debug, ensure_ascii=False, indent=2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think lines 5659 - 5669 can be removed due to debugging-only :)
Thanks @alanakbik , current version looks really good, I am just wondering, if we really need empty tokens + I was able to avoid this by using this code fragment:
🤔 |
@stefan-it good point. One issue is that some "sentences" actually only consist of a single non-token, so there would need to be logic to handle this as well, otherwise we might get multiple empty lines after another. I considered filtering out those sentences, but then the dataset statistics no longer line up with the statistics posted on the DANSK page. Do you think it still makes sense to remove empty tokens and sentences, or should we prioritize matching the dataset statistics? |
So I think for reproducibility reasons, we should then stick to the current solution, to really match the numbers from their documentation |
This PR adds the DANSK corpus for NER in Danish.