Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -20,7 +20,7 @@ from transformers_rec import (
|
|
20 |
|
21 |
|
22 |
# Helper methods
|
23 |
-
@st.
|
24 |
def analyzer_engine(model_path: str):
|
25 |
"""Return AnalyzerEngine.
|
26 |
|
@@ -67,19 +67,19 @@ def analyzer_engine(model_path: str):
|
|
67 |
return analyzer
|
68 |
|
69 |
|
70 |
-
@st.
|
71 |
def anonymizer_engine():
|
72 |
"""Return AnonymizerEngine."""
|
73 |
return AnonymizerEngine()
|
74 |
|
75 |
|
76 |
-
@st.
|
77 |
def get_supported_entities():
|
78 |
"""Return supported entities from the Analyzer Engine."""
|
79 |
return analyzer_engine(st_model).get_supported_entities()
|
80 |
|
81 |
|
82 |
-
@st.
|
83 |
def analyze(**kwargs):
|
84 |
"""Analyze input using Analyzer engine and input arguments (kwargs)."""
|
85 |
if "entities" not in kwargs or "All" in kwargs["entities"]:
|
|
|
20 |
|
21 |
|
22 |
# Helper methods
|
23 |
+
@st.cache
|
24 |
def analyzer_engine(model_path: str):
|
25 |
"""Return AnalyzerEngine.
|
26 |
|
|
|
67 |
return analyzer
|
68 |
|
69 |
|
70 |
+
@st.cache
|
71 |
def anonymizer_engine():
|
72 |
"""Return AnonymizerEngine."""
|
73 |
return AnonymizerEngine()
|
74 |
|
75 |
|
76 |
+
@st.cache
|
77 |
def get_supported_entities():
|
78 |
"""Return supported entities from the Analyzer Engine."""
|
79 |
return analyzer_engine(st_model).get_supported_entities()
|
80 |
|
81 |
|
82 |
+
@st.cache
|
83 |
def analyze(**kwargs):
|
84 |
"""Analyze input using Analyzer engine and input arguments (kwargs)."""
|
85 |
if "entities" not in kwargs or "All" in kwargs["entities"]:
|