1
0
Fork 0
mirror of https://github.com/qurator-spk/sbb_ner.git synced 2025-06-07 19:35:14 +02:00

fix model output handling bug

This commit is contained in:
Kai Labusch 2020-05-19 16:57:53 +02:00
parent 319c29fc96
commit fab5d460f2

View file

@ -244,6 +244,9 @@ def ner(model_id=None):
if not token.startswith('##') and word_pred == 'X': if not token.startswith('##') and word_pred == 'X':
word_pred = 'O' word_pred = 'O'
if word_pred == '[SEP]':
word_pred = 'O'
token = token[2:] if token.startswith('##') else token token = token[2:] if token.startswith('##') else token
word += token word += token