Update app.py
Browse files
app.py
CHANGED
@@ -8,6 +8,9 @@ import streamlit as st
|
|
8 |
from presidio_analyzer import AnalyzerEngine
|
9 |
from presidio_anonymizer import AnonymizerEngine
|
10 |
|
|
|
|
|
|
|
11 |
import spacy
|
12 |
spacy.cli.download("en_core_web_lg")
|
13 |
|
@@ -17,16 +20,16 @@ spacy.cli.download("en_core_web_lg")
|
|
17 |
def analyzer_engine():
|
18 |
"""Return AnalyzerEngine."""
|
19 |
|
20 |
-
|
21 |
|
22 |
-
|
23 |
-
|
24 |
|
25 |
-
|
26 |
-
|
27 |
|
28 |
|
29 |
-
return AnalyzerEngine()
|
30 |
|
31 |
|
32 |
@st.cache(allow_output_mutation=True)
|
|
|
8 |
from presidio_analyzer import AnalyzerEngine
|
9 |
from presidio_anonymizer import AnonymizerEngine
|
10 |
|
11 |
+
from transformers_recognizer import TransformersRecognizer
|
12 |
+
|
13 |
+
|
14 |
import spacy
|
15 |
spacy.cli.download("en_core_web_lg")
|
16 |
|
|
|
20 |
def analyzer_engine():
|
21 |
"""Return AnalyzerEngine."""
|
22 |
|
23 |
+
transformers_recognizer = TransformersRecognizer()
|
24 |
|
25 |
+
registry = RecognizerRegistry()
|
26 |
+
registry.add_recognizer(transformers_recognizer)
|
27 |
|
28 |
+
analyzer = AnalyzerEngine(registry=registry)
|
29 |
+
return analyzer
|
30 |
|
31 |
|
32 |
+
@return AnalyzerEngine()
|
33 |
|
34 |
|
35 |
@st.cache(allow_output_mutation=True)
|