Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -74,7 +74,7 @@ def process_ner(text: str, pipeline) -> dict:
|
|
74 |
|
75 |
return {"text": text, "entities": entities}
|
76 |
|
77 |
-
def generate_charts(
|
78 |
entities_ext = [entity['entity'] for entity in ner_output_ext['entities']]
|
79 |
|
80 |
# Counting entities for extended classification
|
@@ -149,7 +149,7 @@ def generate_wordcloud(entities: List[Dict], color_map: Dict[str, str]) -> np.nd
|
|
149 |
def all(text: str):
|
150 |
ner_output_ext = process_ner(text, pipe_ext)
|
151 |
|
152 |
-
pie_chart, wordcloud_image = generate_charts(
|
153 |
|
154 |
return (ner_output_ext, pie_chart, wordcloud_image)
|
155 |
|
|
|
74 |
|
75 |
return {"text": text, "entities": entities}
|
76 |
|
77 |
+
def generate_charts(ner_output_ext: dict) -> Tuple[go.Figure, np.ndarray]:
|
78 |
entities_ext = [entity['entity'] for entity in ner_output_ext['entities']]
|
79 |
|
80 |
# Counting entities for extended classification
|
|
|
149 |
def all(text: str):
|
150 |
ner_output_ext = process_ner(text, pipe_ext)
|
151 |
|
152 |
+
pie_chart, wordcloud_image = generate_charts(ner_output_ext)
|
153 |
|
154 |
return (ner_output_ext, pie_chart, wordcloud_image)
|
155 |
|