mirror of
https://github.com/qurator-spk/sbb_ner.git
synced 2025-06-07 19:35:14 +02:00
fix unicode problem
This commit is contained in:
parent
c05c04f01b
commit
53824bf904
1 changed files with 2 additions and 1 deletions
|
@ -253,7 +253,8 @@ def ner(model_id=None):
|
||||||
orig_pos = len(output_text + word)
|
orig_pos = len(output_text + word)
|
||||||
|
|
||||||
# are we on a word boundary?
|
# are we on a word boundary?
|
||||||
if orig_pos > 0 and original_word_positions[orig_pos-1] != original_word_positions[orig_pos]:
|
if len(word) > 0 and orig_pos > 0 \
|
||||||
|
and original_word_positions[orig_pos-1] != original_word_positions[orig_pos]:
|
||||||
|
|
||||||
# we are on a word boundary - start a new word ...
|
# we are on a word boundary - start a new word ...
|
||||||
output_sentence.append({'word': word, 'prediction': word_prediction})
|
output_sentence.append({'word': word, 'prediction': word_prediction})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue