Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/stanfordnlp/stanza.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Bauer <horatio@gmail.com>2022-11-06 04:27:34 +0300
committerJohn Bauer <horatio@gmail.com>2022-11-06 04:27:34 +0300
commit96a43d2c9bcb04989eb27a6d96dd5ef5d8c9dc4d (patch)
treedd2151d4fab271675ada4da0a67da4cb8d94bb35
parent35637568473df11de95d0a6e35d0b41c1ea10e48 (diff)
Add the ability to quiet the logging
-rw-r--r--stanza/models/common/bert_embedding.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/stanza/models/common/bert_embedding.py b/stanza/models/common/bert_embedding.py
index 627076df..65a7fb16 100644
--- a/stanza/models/common/bert_embedding.py
+++ b/stanza/models/common/bert_embedding.py
@@ -65,7 +65,7 @@ def tokenize_manual(model_name, sent, tokenizer):
return tokenized, tokenized_sent
-def filter_data(model_name, data, tokenizer = None):
+def filter_data(model_name, data, tokenizer = None, log_level=logging.INFO):
"""
Filter out the (NER) data that is too long for BERT model.
"""
@@ -82,7 +82,7 @@ def filter_data(model_name, data, tokenizer = None):
filtered_data.append(sent)
- logger.info("Eliminated %d of %d datapoints because their length is over maximum size of BERT model. ", (len(data)-len(filtered_data)), len(data))
+ logger.log(log_level, "Eliminated %d of %d datapoints because their length is over maximum size of BERT model.", (len(data)-len(filtered_data)), len(data))
return filtered_data