Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -93,11 +93,10 @@ st.divider()
|
|
| 93 |
analyzer_results = analyzer.analyze(text=input_text, entities = supported_entities, language="en",return_decision_process=True,)
|
| 94 |
# Text Anonymizer
|
| 95 |
engine = AnonymizerEngine()
|
| 96 |
-
result = engine.anonymize(text=
|
| 97 |
|
| 98 |
# Restructuring anonymizer results
|
| 99 |
anonymization_results = {"anonymized": result.text,"found": [entity.to_dict() for entity in analyzer_results]}
|
| 100 |
-
words = [{'word': text_fr[obj['start']:obj['end']], 'entity_type':obj['entity_type'], 'start':obj['start'], 'end':obj['end']} for obj in anonymization_results['found']]
|
| 101 |
anonym = anonymization_results['anonymized']
|
| 102 |
|
| 103 |
doc = nlp(input_text)
|
|
|
|
| 93 |
analyzer_results = analyzer.analyze(text=input_text, entities = supported_entities, language="en",return_decision_process=True,)
|
| 94 |
# Text Anonymizer
|
| 95 |
engine = AnonymizerEngine()
|
| 96 |
+
result = engine.anonymize(text=input_text, analyzer_results=analyzer_results)
|
| 97 |
|
| 98 |
# Restructuring anonymizer results
|
| 99 |
anonymization_results = {"anonymized": result.text,"found": [entity.to_dict() for entity in analyzer_results]}
|
|
|
|
| 100 |
anonym = anonymization_results['anonymized']
|
| 101 |
|
| 102 |
doc = nlp(input_text)
|