Update app.py
Browse files
app.py
CHANGED
@@ -151,15 +151,22 @@ def label_visualization(clause2labels):
|
|
151 |
print(aspect_dict, genericity_dict, boundedness_dict)
|
152 |
fig, axs = plt.subplots(1, 3, figsize=(10, 6,))
|
153 |
fig.tight_layout(pad=5.0)
|
154 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
155 |
axs[0].set_title("Aspect")
|
156 |
-
axs[1].pie(
|
|
|
157 |
axs[1].set_title("Genericity")
|
158 |
-
axs[2].pie(
|
|
|
159 |
axs[2].set_title("Boundedness")
|
160 |
return fig
|
161 |
|
162 |
-
|
163 |
def run_pipeline(text):
|
164 |
snippets = auto_split(text)
|
165 |
print(snippets)
|
|
|
151 |
print(aspect_dict, genericity_dict, boundedness_dict)
|
152 |
fig, axs = plt.subplots(1, 3, figsize=(10, 6,))
|
153 |
fig.tight_layout(pad=5.0)
|
154 |
+
dict_aspect = {k : float(v / total_clauses) for k, v in aspect_dict.items() if v != 0}
|
155 |
+
dict_genericity = {k : float(v / total_clauses) for k, v in genericity_dict.items() if v != 0}
|
156 |
+
dict_boundedness = {k : float(v / total_clauses) for k, v in boundedness_dict.items() if v != 0}
|
157 |
+
print(dict_aspect)
|
158 |
+
print(list(dict_aspect.values()), len(dict_aspect.keys()), list(dict_aspect.keys()))
|
159 |
+
axs[0].pie(list(dict_aspect.values()), colors = sns.color_palette('pastel')[0:len(dict_aspect.keys())],
|
160 |
+
labels=dict_aspect.keys(), autopct='%.0f%%', normalize=True )
|
161 |
axs[0].set_title("Aspect")
|
162 |
+
axs[1].pie(list(dict_genericity.values()), colors = sns.color_palette('pastel')[3: 3 + len(dict_genericity.keys())],
|
163 |
+
labels=dict_genericity.keys(), autopct='%.0f%%', normalize=True)
|
164 |
axs[1].set_title("Genericity")
|
165 |
+
axs[2].pie(list(dict_boundedness.values()), colors = sns.color_palette('pastel')[6: 6 + len(dict_boundedness.keys())],
|
166 |
+
labels=dict_boundedness.keys(), autopct='%.0f%%', normalize=True)
|
167 |
axs[2].set_title("Boundedness")
|
168 |
return fig
|
169 |
|
|
|
170 |
def run_pipeline(text):
|
171 |
snippets = auto_split(text)
|
172 |
print(snippets)
|