Spaces:
Sleeping
Sleeping
Daryl Fung
commited on
Commit
•
1117254
1
Parent(s):
b48579c
fix bar plot
Browse files- keyphrase_extraction.py +2 -2
- keyword_extraction.py +2 -2
- word.py +2 -2
keyphrase_extraction.py
CHANGED
@@ -35,9 +35,9 @@ def get_top_key_phrases(text, top_n, save_output):
|
|
35 |
keyword_df = pd.DataFrame({'words': phrases[:top_n], 'scores': scores[:top_n]})
|
36 |
plt.title("Word Count")
|
37 |
plt.figure(figsize=(24, 8))
|
38 |
-
plt.yticks(fontsize=
|
39 |
sns.barplot(data=keyword_df, y='words', x='scores', palette='blend:#7AB,#EDA')
|
40 |
-
plt.savefig(save_output, dpi=300)
|
41 |
plt.close()
|
42 |
|
43 |
|
|
|
35 |
keyword_df = pd.DataFrame({'words': phrases[:top_n], 'scores': scores[:top_n]})
|
36 |
plt.title("Word Count")
|
37 |
plt.figure(figsize=(24, 8))
|
38 |
+
plt.yticks(fontsize=15)
|
39 |
sns.barplot(data=keyword_df, y='words', x='scores', palette='blend:#7AB,#EDA')
|
40 |
+
plt.savefig(save_output, dpi=300, bbox_inches="tight")
|
41 |
plt.close()
|
42 |
|
43 |
|
keyword_extraction.py
CHANGED
@@ -38,9 +38,9 @@ def keyword_extract(doc, kw_model, n_grams, save_output='results/'):
|
|
38 |
keyword_df = pd.DataFrame({'words': words, 'scores': scores})
|
39 |
plt.title("Word Count")
|
40 |
plt.figure(figsize=(24, 8))
|
41 |
-
plt.yticks(fontsize=
|
42 |
sns.barplot(data=keyword_df, y='words', x='scores', palette='blend:#7AB,#EDA')
|
43 |
-
plt.savefig(save_output, dpi=300)
|
44 |
plt.close()
|
45 |
|
46 |
if __name__ == '__main__':
|
|
|
38 |
keyword_df = pd.DataFrame({'words': words, 'scores': scores})
|
39 |
plt.title("Word Count")
|
40 |
plt.figure(figsize=(24, 8))
|
41 |
+
plt.yticks(fontsize=15)
|
42 |
sns.barplot(data=keyword_df, y='words', x='scores', palette='blend:#7AB,#EDA')
|
43 |
+
plt.savefig(save_output, dpi=300, bbox_inches="tight")
|
44 |
plt.close()
|
45 |
|
46 |
if __name__ == '__main__':
|
word.py
CHANGED
@@ -34,9 +34,9 @@ def show_gram_plot(doc, n_grams, top_words=10, save_output='results/'):
|
|
34 |
tokens_df = pd.DataFrame({'word': words, 'count': count})
|
35 |
plt.title("Word Count")
|
36 |
plt.figure(figsize=(24, 8))
|
37 |
-
plt.yticks(fontsize=
|
38 |
sns.barplot(data=tokens_df, y='word', x='count', palette='blend:#7AB,#EDA')
|
39 |
-
plt.savefig(save_output, dpi=300)
|
40 |
plt.close()
|
41 |
|
42 |
|
|
|
34 |
tokens_df = pd.DataFrame({'word': words, 'count': count})
|
35 |
plt.title("Word Count")
|
36 |
plt.figure(figsize=(24, 8))
|
37 |
+
plt.yticks(fontsize=15)
|
38 |
sns.barplot(data=tokens_df, y='word', x='count', palette='blend:#7AB,#EDA')
|
39 |
+
plt.savefig(save_output, dpi=300, bbox_inches="tight")
|
40 |
plt.close()
|
41 |
|
42 |
|