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
Assertion error with CONLL03 #34
Comments
Hi @Riroaki, |
Thanks! It works fine with the dataset in your link. |
It's great to hear that👍 |
Thanks, and do you know any handy script that could easily convert IOB2 format to IOB1? |
Here another error in validation occurs: |
Since I use only IOB1 format during experiments, I do not know such script.
Did you use the CoNLL dataset in IOB1 format? |
Yes, and the training went smoothly with weights dumped into a bin file... |
Hi, |
Thanks for being so nice and helpful! |
Oh well, I would like to mention that I just installed the different version of seqeval library because I couldn't install the libs in a normal way by Also, I found the |
I found one script that converts IOB1 to IOB2 format, and I revised it so that the function could convert IOB2 to IOB1 format... I rewrote the functions as below: # Amazing!
def iob2to1(tags):
for i, tag in enumerate(tags):
if tag in {'O', '-X-'} or tag[0] == 'I':
continue
elif i == 0 or tags[i - 1] == 'O':
tags[i] = 'I' + tag[1:]
elif tags[i - 1][1:] != tag[1:]:
tags[i] = 'I' + tag[1:]
return tags
def iob1to2(tags):
for i, tag in enumerate(tags):
if tag in {'O', '-X-'} or tag[0] == 'B':
continue
elif i == 0 or tags[i - 1] == 'O':
tags[i] = 'B' + tag[1:]
elif tags[i - 1][1:] != tag[1:]:
tags[i] = 'B' + tag[1:]
return tags Lol I just want to share some interesting (to me) facts, and I wonder if you have any idea about why this happens? ^_^ |
Thank you very much for reporting the issue with Also, thank you for sharing the code to convert from |
Hi, here I met another problem when using luke on NER dataset CONLL03...
When creating features from examples, the variable
entity_labels
is empty at some examples, like train-945:and the code here throws an AssertionError:
luke/examples/ner/utils.py
Line 239 in 9323b21
Do you have any idea what's wrong with these examples?
The text was updated successfully, but these errors were encountered: