Update app.py
Browse files
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
|
| 84 |
|
| 85 |
|
| 86 |
|
|
@@ -99,20 +99,22 @@ def predict(test_query):
|
|
| 99 |
|
| 100 |
|
| 101 |
# Title for the Streamlit app
|
| 102 |
-
st.title("
|
| 103 |
|
| 104 |
# Text input
|
| 105 |
-
user_input = st.text_area("Enter the text for
|
| 106 |
-
|
| 107 |
|
| 108 |
# Check if there is input text
|
| 109 |
if user_input:
|
| 110 |
# Perform sentiment analysis
|
| 111 |
with st.spinner("Analyzing..."):
|
| 112 |
-
result =
|
| 113 |
|
| 114 |
# Display the result
|
| 115 |
-
|
|
|
|
|
|
|
| 116 |
|
| 117 |
|
| 118 |
-
st.write(f"**
|
|
|
|
| 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}")
|