1
0
Fork 0
mirror of https://github.com/qurator-spk/sbb_ner.git synced 2025-06-09 04:10:08 +02:00

fix NER output; fix BERT Tokenizer

This commit is contained in:
Kai Labusch 2019-11-22 16:55:13 +01:00
parent 9bf2e6f51b
commit 3eabe5054a

View file

@ -271,7 +271,7 @@ def ner(model_id):
if token == '[UNK]':
orig_pos = len("".join([pred['word'] for pred in output_sentence]))
output_sentence.append({'word': original_text[orig_pos], 'prediction': 'O'})
output_sentence.append({'word': original_text[orig_pos], 'prediction': last_prediction})
continue
token = token[2:] if token.startswith('##') else token