Spaces:
Running
Running
Commit
·
4b17270
1
Parent(s):
b26c06c
all references to logging removed
Browse files
app.py
CHANGED
@@ -1,5 +1,3 @@
|
|
1 |
-
import logging
|
2 |
-
import logging.config
|
3 |
import re
|
4 |
from pathlib import Path
|
5 |
|
@@ -70,9 +68,6 @@ def redact(text: str, model_name: str):
|
|
70 |
|
71 |
model_path = model_paths.get(model_name, "StanfordAIMI/stanford-deidentifier-base")
|
72 |
|
73 |
-
# Log the model being changed to
|
74 |
-
log.info(f"Changing to model: {model_path}")
|
75 |
-
|
76 |
if model_path:
|
77 |
change_model(model_path)
|
78 |
else:
|
@@ -261,12 +256,6 @@ def redact_and_visualize(text: str, model_name: str):
|
|
261 |
reference_text, redacted_text
|
262 |
)
|
263 |
|
264 |
-
# Print the final texts with flags for debugging
|
265 |
-
log.debug("Final Reference Text with False Negatives:")
|
266 |
-
log.debug(reference_text_with_fn)
|
267 |
-
log.debug("\nFinal Redacted Text with False Positives:")
|
268 |
-
log.debug(redacted_text_with_fp)
|
269 |
-
|
270 |
# Count entities and compute metrics
|
271 |
tp_count, fn_count, fp_count, tn_count = count_entities_and_compute_metrics(
|
272 |
reference_text_with_fn, redacted_text_with_fp
|
|
|
|
|
|
|
1 |
import re
|
2 |
from pathlib import Path
|
3 |
|
|
|
68 |
|
69 |
model_path = model_paths.get(model_name, "StanfordAIMI/stanford-deidentifier-base")
|
70 |
|
|
|
|
|
|
|
71 |
if model_path:
|
72 |
change_model(model_path)
|
73 |
else:
|
|
|
256 |
reference_text, redacted_text
|
257 |
)
|
258 |
|
|
|
|
|
|
|
|
|
|
|
|
|
259 |
# Count entities and compute metrics
|
260 |
tp_count, fn_count, fp_count, tn_count = count_entities_and_compute_metrics(
|
261 |
reference_text_with_fn, redacted_text_with_fp
|