Sasidhar commited on
Commit
22f90c0
1 Parent(s): b1dfc1e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -20
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
- st.subheader("Paste/write a review here")
52
- review = st.text_area("")
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
 
 
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