From 0da38d6ec6128fe4cd189e443a4f6b2158cf42aa Mon Sep 17 00:00:00 2001 From: Kai Date: Thu, 6 May 2021 13:01:41 +0200 Subject: [PATCH] support confidences in find-entities --- tsvtools/tsv.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tsvtools/tsv.py b/tsvtools/tsv.py index 27fd352..409f475 100644 --- a/tsvtools/tsv.py +++ b/tsvtools/tsv.py @@ -15,7 +15,10 @@ def read_tsv(tsv_file): def write_tsv(tsv, urls, tsv_out_file): - out_columns = ['No.', 'TOKEN', 'NE-TAG', 'NE-EMB', 'ID', 'url_id', 'left', 'right', 'top', 'bottom'] + if 'conf' in tsv.columns(): + out_columns = ['No.', 'TOKEN', 'NE-TAG', 'NE-EMB', 'ID', 'url_id', 'left', 'right', 'top', 'bottom', 'conf'] + else: + out_columns = ['No.', 'TOKEN', 'NE-TAG', 'NE-EMB', 'ID', 'url_id', 'left', 'right', 'top', 'bottom'] if len(urls) == 0: print('Writing to {}...'.format(tsv_out_file))