Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -38,34 +38,34 @@ sentiment_extractor = get_sentiment_model()
|
|
38 |
summarizer = get_summarizer_model()
|
39 |
answer_generator = get_qa_model()
|
40 |
|
41 |
-
# First some code.
|
42 |
streamlit = "cool"
|
43 |
theming = "fantastic"
|
44 |
both = "💥"
|
45 |
|
46 |
st.header("Analyze a review..")
|
47 |
|
48 |
-
action = st.sidebar.selectbox("Pick an Action", ["Analyse a Review","Generate an Article","Create an Image"])
|
49 |
|
50 |
-
if action == "Analyse a Review":
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
if st.button("Summarize the review"):
|
61 |
-
summary = summarizer(review, max_length=130, min_length=30, do_sample=False)
|
62 |
-
st.write(summary)
|
63 |
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
|
|
|
|
|
|
|
|
69 |
|
70 |
|
71 |
|
|
|
38 |
summarizer = get_summarizer_model()
|
39 |
answer_generator = get_qa_model()
|
40 |
|
|
|
41 |
streamlit = "cool"
|
42 |
theming = "fantastic"
|
43 |
both = "💥"
|
44 |
|
45 |
st.header("Analyze a review..")
|
46 |
|
47 |
+
#action = st.sidebar.selectbox("Pick an Action", ["Analyse a Review","Generate an Article","Create an Image"])
|
48 |
|
49 |
+
#if action == "Analyse a Review":
|
50 |
+
st.subheader("Paste/write a review here")
|
51 |
+
review = st.text_area("")
|
52 |
+
|
53 |
+
if review:
|
54 |
+
#res = text_generator( prompt, max_length=100, temperature=0.7)
|
55 |
+
#st.write(res)
|
56 |
+
if st.button("Get the Sentiment of the Review"):
|
57 |
+
sentiment = get_sentiment(review)
|
58 |
+
st.write(sentiment)
|
|
|
|
|
|
|
59 |
|
60 |
+
if st.button("Summarize the review"):
|
61 |
+
summary = summarizer(review, max_length=130, min_length=30, do_sample=False)
|
62 |
+
st.write(summary)
|
63 |
+
|
64 |
+
if st.button("Find the key topic"):
|
65 |
+
QA_input = {'question': 'what is the review about?',
|
66 |
+
'context': review}
|
67 |
+
answer = answer_generator(QA_input)
|
68 |
+
st.write(answer)
|
69 |
|
70 |
|
71 |
|