1
0
Fork 0
mirror of https://github.com/qurator-spk/page2tsv.git synced 2025-06-09 19:39:54 +02:00

make code more robust

This commit is contained in:
Kai Labusch 2024-11-12 15:15:52 +01:00
parent 8d8bf517b9
commit 80cf64abcf

View file

@ -346,7 +346,7 @@ def tsv2tsv(tsv_in_file, tsv_out_file, ner_rest_endpoint, noproxy,
prev_pos = 0
for idx, _ in tsv_out.iterrows():
if prev_pos != 0 and not tsv_out.loc[idx, 'NE-TAG'].startswith('I-') and \
if prev_pos != 0 and not str(tsv_out.loc[idx, 'NE-TAG']).startswith('I-') and \
tsv_out.loc[idx, 'No.'] == 0 or len(tsv_out.loc[idx, 'TOKEN']) == 0:
word_pos = 0