omri374 commited on
Commit
4945c56
1 Parent(s): c37c05e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -6
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
- #transformers_recognizer = (TransformersRecognizer())
21
 
22
- #registry = RecognizerRegistry()
23
- #registry.add_recognizer(transformers_recognizer)
24
 
25
- #analyzer = AnalyzerEngine(registry=registry)
26
- #return analyzer
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)