Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -107,9 +107,11 @@ def generate_charts(ner_output_bin: dict) -> Tuple[go.Figure, np.ndarray]:
|
|
| 107 |
|
| 108 |
return fig2, wordcloud_image
|
| 109 |
|
| 110 |
-
def generate_wordcloud(entities: List[Dict], color_map: Dict[str, str],
|
| 111 |
|
| 112 |
-
image_path = os.path.join(os.path.dirname(__file__),
|
|
|
|
|
|
|
| 113 |
|
| 114 |
token_texts = []
|
| 115 |
token_scores = []
|
|
|
|
| 107 |
|
| 108 |
return fig2, wordcloud_image
|
| 109 |
|
| 110 |
+
def generate_wordcloud(entities: List[Dict], color_map: Dict[str, str], file_path: str) -> np.ndarray:
|
| 111 |
|
| 112 |
+
image_path = os.path.join(os.path.dirname(__file__), file_path)
|
| 113 |
+
|
| 114 |
+
mask_image = np.array(Image.open(image_path))
|
| 115 |
|
| 116 |
token_texts = []
|
| 117 |
token_scores = []
|