Spaces:
Runtime error
Runtime error
arogeriogel
commited on
Commit
•
4439610
1
Parent(s):
c1e69f0
update app
Browse files
app.py
CHANGED
@@ -37,7 +37,6 @@ def analyzer_engine():
|
|
37 |
|
38 |
def analyze(**kwargs):
|
39 |
"""Analyze input using Analyzer engine and input arguments (kwargs)."""
|
40 |
-
analyzer_engine_instance = analyzer_engine()
|
41 |
|
42 |
if "entities" not in kwargs or "All" in kwargs["entities"]:
|
43 |
kwargs["entities"] = None
|
@@ -46,12 +45,17 @@ def analyze(**kwargs):
|
|
46 |
logging.info(
|
47 |
f"type of excluded_words_recognizer: {type(st.session_state.excluded_words)}\n"
|
48 |
)
|
|
|
|
|
|
|
49 |
excluded_words_recognizer = PatternRecognizer(supported_entity="MANUAL ADD",
|
50 |
name="Excluded words recognizer",
|
51 |
deny_list=st.session_state.excluded_words.split(','))
|
52 |
-
|
53 |
|
54 |
-
|
|
|
|
|
55 |
|
56 |
def annotate():
|
57 |
text = st.session_state.text
|
|
|
37 |
|
38 |
def analyze(**kwargs):
|
39 |
"""Analyze input using Analyzer engine and input arguments (kwargs)."""
|
|
|
40 |
|
41 |
if "entities" not in kwargs or "All" in kwargs["entities"]:
|
42 |
kwargs["entities"] = None
|
|
|
45 |
logging.info(
|
46 |
f"type of excluded_words_recognizer: {type(st.session_state.excluded_words)}\n"
|
47 |
)
|
48 |
+
logging.info(
|
49 |
+
f"excluded words: {st.session_state.excluded_words.split(',')}\n"
|
50 |
+
)
|
51 |
excluded_words_recognizer = PatternRecognizer(supported_entity="MANUAL ADD",
|
52 |
name="Excluded words recognizer",
|
53 |
deny_list=st.session_state.excluded_words.split(','))
|
54 |
+
analyzer_engine().registry.add_recognizer(excluded_words_recognizer)
|
55 |
|
56 |
+
results = analyzer_engine().analyze(**kwargs)
|
57 |
+
|
58 |
+
return results
|
59 |
|
60 |
def annotate():
|
61 |
text = st.session_state.text
|