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

NER column corpus with custom delimiter doesn't work properly #1861

Closed
aragaer opened this issue Sep 13, 2020 · 2 comments · Fixed by #1876
Closed

NER column corpus with custom delimiter doesn't work properly #1861

aragaer opened this issue Sep 13, 2020 · 2 comments · Fixed by #1876
Labels
bug Something isn't working

Comments

@aragaer
Copy link
Contributor

aragaer commented Sep 13, 2020

Describe the bug
When using custom column delimiter for CoNLL format, the newline character is taken as a part of a tag.

To Reproduce
Create a CoNLL file, load setting column_delimiter, check loaded tags. Tags are 'O\n', 'B-something\n' and 'I-something\n'

Expected behavior
Tags should be 'O', 'B-something' or 'I-something'.

@aragaer aragaer added the bug Something isn't working label Sep 13, 2020
@aragaer
Copy link
Contributor Author

aragaer commented Sep 13, 2020

The problem is that reading the file is done using readline() which also reads the trailing newline. Splitting on default delimiter also splits an empty column after that newline. That's why the issue doesn't come up when using default delimiter. My current workaround is to add the delimiter after the NER tag. The correct solution is to trim NER tags when creating a corpus.

@alanakbik
Copy link
Collaborator

@aragaer thanks for reporting this! I'll push a PR to fix this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants