Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -131,16 +131,16 @@ def fDistance(text2Party):
|
|
| 131 |
mem[x[0]]=x[1]
|
| 132 |
return normalize(mem)
|
| 133 |
|
| 134 |
-
def fDistancePlot(text2Party,plotN=
|
| 135 |
'''
|
| 136 |
Most Frequent Words Visualization
|
| 137 |
'''
|
| 138 |
word_tokens_party = word_tokenize(text2Party) #Tokenizing
|
| 139 |
fdistance = FreqDist(word_tokens_party)
|
| 140 |
plt.title('Frequency Distribution')
|
|
|
|
| 141 |
plt.figure(figsize=(4,3))
|
| 142 |
fdistance.plot(plotN)
|
| 143 |
-
plt.axis('off')
|
| 144 |
plt.tight_layout()
|
| 145 |
buf = BytesIO()
|
| 146 |
plt.savefig(buf)
|
|
|
|
| 131 |
mem[x[0]]=x[1]
|
| 132 |
return normalize(mem)
|
| 133 |
|
| 134 |
+
def fDistancePlot(text2Party,plotN=15):
|
| 135 |
'''
|
| 136 |
Most Frequent Words Visualization
|
| 137 |
'''
|
| 138 |
word_tokens_party = word_tokenize(text2Party) #Tokenizing
|
| 139 |
fdistance = FreqDist(word_tokens_party)
|
| 140 |
plt.title('Frequency Distribution')
|
| 141 |
+
plt.axis('off')
|
| 142 |
plt.figure(figsize=(4,3))
|
| 143 |
fdistance.plot(plotN)
|
|
|
|
| 144 |
plt.tight_layout()
|
| 145 |
buf = BytesIO()
|
| 146 |
plt.savefig(buf)
|