Spaces:
Runtime error
Runtime error
Commit
·
3306b9b
1
Parent(s):
a9af246
Update app.py
Browse files
app.py
CHANGED
|
@@ -28,20 +28,19 @@ def main():
|
|
| 28 |
input_string = st.text_input("")
|
| 29 |
|
| 30 |
|
| 31 |
-
|
| 32 |
if st.button("Enter"):
|
| 33 |
-
st.
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
|
| 46 |
|
| 47 |
if __name__ == "__main__":
|
|
|
|
| 28 |
input_string = st.text_input("")
|
| 29 |
|
| 30 |
|
|
|
|
| 31 |
if st.button("Enter"):
|
| 32 |
+
with st.spinner("Extracting aspects and sentiments..."):
|
| 33 |
+
examples = []
|
| 34 |
+
examples.append(input_string)
|
| 35 |
+
|
| 36 |
+
inference_source = examples
|
| 37 |
+
atepc_result = aspect_extractor.extract_aspect(inference_source=inference_source, #
|
| 38 |
+
pred_sentiment=True, # Predict the sentiment of extracted aspect terms
|
| 39 |
+
)
|
| 40 |
+
|
| 41 |
+
st.write("Aspect and sentiment is:")
|
| 42 |
+
for aspect, sentiment in zip(atepc_result[0]['aspect'], atepc_result[0]['sentiment']):
|
| 43 |
+
st.write(aspect + ': ' + sentiment)
|
| 44 |
|
| 45 |
|
| 46 |
if __name__ == "__main__":
|