Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -65,7 +65,7 @@ def keywords(text):
|
|
65 |
for i in range(len(most_freq_words)):
|
66 |
mfwp = most_freq_words[i][0]
|
67 |
most_freq_words_p.append(mfwp)
|
68 |
-
return '
|
69 |
|
70 |
|
71 |
# summary1
|
@@ -110,7 +110,7 @@ def summary_1(text):
|
|
110 |
summary_sentences.append(sentences[sentence_scores[1][0]])
|
111 |
|
112 |
summary = ' '.join(summary_sentences)
|
113 |
-
return summary
|
114 |
|
115 |
|
116 |
# summary2
|
@@ -134,7 +134,7 @@ def summary_2(text):
|
|
134 |
if word in most_freq_words_p and sent not in summary:
|
135 |
summary.append(sent)
|
136 |
|
137 |
-
return summary
|
138 |
|
139 |
|
140 |
def analyze_text(text):
|
@@ -155,11 +155,11 @@ if st.button("Analyze"):
|
|
155 |
if text:
|
156 |
nb_mots, polarite, subjectivite, mots_cles, resume1, resume2 = analyze_text(text)
|
157 |
|
158 |
-
st.write(
|
159 |
-
st.write(
|
160 |
-
st.write(
|
161 |
-
st.write(
|
162 |
-
st.write(
|
163 |
-
st.write(
|
164 |
|
165 |
|
|
|
65 |
for i in range(len(most_freq_words)):
|
66 |
mfwp = most_freq_words[i][0]
|
67 |
most_freq_words_p.append(mfwp)
|
68 |
+
return 'Mots clés :', ', '.join(most_freq_words_p)
|
69 |
|
70 |
|
71 |
# summary1
|
|
|
110 |
summary_sentences.append(sentences[sentence_scores[1][0]])
|
111 |
|
112 |
summary = ' '.join(summary_sentences)
|
113 |
+
return f'Résumé 1 : {summary}'
|
114 |
|
115 |
|
116 |
# summary2
|
|
|
134 |
if word in most_freq_words_p and sent not in summary:
|
135 |
summary.append(sent)
|
136 |
|
137 |
+
return f'Résumé 2 : {summary}'
|
138 |
|
139 |
|
140 |
def analyze_text(text):
|
|
|
155 |
if text:
|
156 |
nb_mots, polarite, subjectivite, mots_cles, resume1, resume2 = analyze_text(text)
|
157 |
|
158 |
+
st.write(nb_mots)
|
159 |
+
st.write(polarite)
|
160 |
+
st.write(subjectivite)
|
161 |
+
st.write(mots_cles)
|
162 |
+
st.write(resume1)
|
163 |
+
st.write(resume2)
|
164 |
|
165 |
|