AshenR commited on
Commit
f539e87
·
verified ·
1 Parent(s): c760052

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -7
app.py CHANGED
@@ -80,7 +80,7 @@ def predict(test_query):
80
  # print("Token:%s"%(temp_token[i]))
81
  asp.append(temp_token[i])
82
  # print("Predict_Tag:%s"%(tag2name[result_list[i]]))
83
- return asp, test_query
84
 
85
 
86
 
@@ -99,20 +99,22 @@ def predict(test_query):
99
 
100
 
101
  # Title for the Streamlit app
102
- st.title("Sentiment Analysis App")
103
 
104
  # Text input
105
- user_input = st.text_area("Enter the text for sentiment analysis:", "")
106
- user_input2 = st.text_area("Enter the Aspect Word:", "")
107
 
108
  # Check if there is input text
109
  if user_input:
110
  # Perform sentiment analysis
111
  with st.spinner("Analyzing..."):
112
- result = "predict_sentiment(user_input,user_input2)"
113
 
114
  # Display the result
115
- sentiment = result
 
 
116
 
117
 
118
- st.write(f"**Sentiment**: {sentiment}")
 
80
  # print("Token:%s"%(temp_token[i]))
81
  asp.append(temp_token[i])
82
  # print("Predict_Tag:%s"%(tag2name[result_list[i]]))
83
+ return asp
84
 
85
 
86
 
 
99
 
100
 
101
  # Title for the Streamlit app
102
+ st.title("Aspect Prediction App")
103
 
104
  # Text input
105
+ user_input = st.text_area("Enter the text for Aspect Prection:", "")
106
+
107
 
108
  # Check if there is input text
109
  if user_input:
110
  # Perform sentiment analysis
111
  with st.spinner("Analyzing..."):
112
+ result = predict(user_input)
113
 
114
  # Display the result
115
+ for i in result:
116
+
117
+ sentiment = i+"\n"
118
 
119
 
120
+ st.write(f"**Aspects** : {sentiment}")