guillaumegenthial / sequence_tagging

Named Entity Recognition (LSTM + CRF) - Tensorflow
https://guillaumegenthial.github.io/sequence-tagging-with-tensorflow.html
Apache License 2.0
1.94k stars 703 forks source link

Prediction shows I-LOC without B-LOC #73

Open varshachawan opened 5 years ago

varshachawan commented 5 years ago

@guillaumegenthial 1) training Dataset used was In B-I-O format Begin Inside Out format 2) but for some of the predictions it shows I-LOC without B-LOC If I assume correctly, Inside should be always after Begin ... Any thoughts where it is going wrong? Is there any way to control this transitions

nihalnayak commented 5 years ago

I was able to resolve this issue by enabling the use_crf flag.

guillaumegenthial commented 5 years ago

@varshachawan , as @iampuntre pointed out, using a CRF should prevent you from such patterns, but because there is no actual mechanisms that strictly enforces it, it's still technically possible that this happens in your predictions. Remember, the model knows nothing about the tagging scheme, it's just trying to predict the right tags.