Update app.py
Browse files
app.py
CHANGED
|
@@ -111,9 +111,11 @@ def generate_charts(ner_output_ext: dict) -> Tuple[go.Figure, np.ndarray]:
|
|
| 111 |
|
| 112 |
return fig1, wordcloud_image
|
| 113 |
|
| 114 |
-
def generate_wordcloud(entities: List[Dict], color_map: Dict[str, str],
|
| 115 |
|
| 116 |
-
image_path = os.path.join(os.path.dirname(__file__),
|
|
|
|
|
|
|
| 117 |
|
| 118 |
token_texts = []
|
| 119 |
token_scores = []
|
|
|
|
| 111 |
|
| 112 |
return fig1, wordcloud_image
|
| 113 |
|
| 114 |
+
def generate_wordcloud(entities: List[Dict], color_map: Dict[str, str], file_path: str) -> np.ndarray:
|
| 115 |
|
| 116 |
+
image_path = os.path.join(os.path.dirname(__file__), file_path)
|
| 117 |
+
|
| 118 |
+
mask_image = np.array(Image.open(image_path))
|
| 119 |
|
| 120 |
token_texts = []
|
| 121 |
token_scores = []
|