mirror of
https://github.com/qurator-spk/sbb_ner.git
synced 2025-07-04 00:19:56 +02:00
permit empty input
This commit is contained in:
parent
5f6d045755
commit
5d2a75b2b2
1 changed files with 10 additions and 1 deletions
|
@ -119,7 +119,13 @@ class NERPredictor:
|
||||||
|
|
||||||
prev_guid = fe.guid
|
prev_guid = fe.guid
|
||||||
|
|
||||||
assert len(sentences) == len(prediction)
|
try:
|
||||||
|
assert len(sentences) == len(prediction)
|
||||||
|
except AssertionError:
|
||||||
|
print('Sentences:\n')
|
||||||
|
print(sentences)
|
||||||
|
print('\n\nPrediciton:\n')
|
||||||
|
print(prediction)
|
||||||
|
|
||||||
return prediction
|
return prediction
|
||||||
|
|
||||||
|
@ -142,6 +148,9 @@ class NERTokenizer:
|
||||||
|
|
||||||
sen = [tok.replace(" ", "") for tok in sen]
|
sen = [tok.replace(" ", "") for tok in sen]
|
||||||
|
|
||||||
|
if len(sen) == 0:
|
||||||
|
continue
|
||||||
|
|
||||||
sentences.append((sen, []))
|
sentences.append((sen, []))
|
||||||
|
|
||||||
return sentences
|
return sentences
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue