Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -89,24 +89,27 @@ def extract_keywords(text):
|
|
89 |
text = st.text_area('Enter the text to analyze', jd)
|
90 |
|
91 |
if st.button("Start Analysis"):
|
92 |
-
with st.
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
with st.expander("Summarization - β
Completed", expanded=False):
|
103 |
-
# Summarization
|
104 |
-
out_summ = pipe_summ(text)
|
105 |
-
summarized_text = out_summ[0]['summary_text']
|
106 |
-
st.write(summarized_text)
|
107 |
|
108 |
-
with st.
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
text = st.text_area('Enter the text to analyze', jd)
|
90 |
|
91 |
if st.button("Start Analysis"):
|
92 |
+
with st.spinner("Analyzing Sentiment"):
|
93 |
+
with st.expander("Sentiment Analysis - β
Completed", expanded=False):
|
94 |
+
# Sentiment analysis
|
95 |
+
out_sentiment = pipe_sent(text)
|
96 |
+
# Display sentiment analysis result
|
97 |
+
sentiment_score = out_sentiment[0]['score']
|
98 |
+
sentiment_label = out_sentiment[0]['label']
|
99 |
+
sentiment_emoji = 'π' if sentiment_label == 'POSITIVE' else 'π'
|
100 |
+
sentiment_text = f"Sentiment Score: {sentiment_score}, Sentiment Label: {sentiment_label.capitalize()} {sentiment_emoji}"
|
101 |
+
st.write(sentiment_text)
|
|
|
|
|
|
|
|
|
|
|
102 |
|
103 |
+
with st.spinner("Summarizing - This may take a while"):
|
104 |
+
with st.expander("Summarization - β
Completed", expanded=False):
|
105 |
+
# Summarization
|
106 |
+
out_summ = pipe_summ(text)
|
107 |
+
summarized_text = out_summ[0]['summary_text']
|
108 |
+
st.write(summarized_text)
|
109 |
+
|
110 |
+
with st.spinner("Extracting Keywords"):
|
111 |
+
with st.expander("Keywords Extraction - β
Completed", expanded=False):
|
112 |
+
# Keyword extraction
|
113 |
+
keywords = extract_keywords(text)
|
114 |
+
keyword_list = [keyword[1] for keyword in keywords]
|
115 |
+
st.write(keyword_list)
|