File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 11__all__ = ['process_text' ]
22
33import os
4+ from tqdm import tqdm
45import logging
56
67logger = logging .getLogger (__name__ )
@@ -37,6 +38,9 @@ def create_extractor(
3738 role_model_path = "thomaslim6793/indra_bert_indra_stmt_agents_role_assigner" ,
3839 stmt_conf_threshold = stmt_conf_threshold
3940 )
41+ logger .info (f"Loaded ner_model from: { ise .ner_model_local_path } " )
42+ logger .info (f"Loaded stmt_model from: { ise .stmt_model_local_path } " )
43+ logger .info (f"Loaded role_model from: { ise .role_model_local_path } " )
4044 return ise
4145
4246def process_text (text ,
@@ -53,7 +57,7 @@ def process_text(text,
5357 )
5458 res = ise .extract_structured_statements_batch (text )
5559 ip = IndraBertProcessor (res , grounder = grounder )
56- return ip
60+ return ip , ise
5761
5862def process_texts (texts ,
5963 ner_model_path = "thomaslim6793/indra_bert_ner_agent_detection" ,
@@ -73,8 +77,8 @@ def process_texts(texts,
7377 )
7478
7579 ips = []
76- for text in texts :
80+ for text in tqdm ( texts , desc = "Processing texts" ) :
7781 res = ise .extract_structured_statements_batch (text )
7882 ip = IndraBertProcessor (res , grounder = grounder )
7983 ips .append (ip )
80- return ips
84+ return ips , ise
You can’t perform that action at this time.
0 commit comments