amoldwalunj commited on
Commit
3306b9b
1 Parent(s): a9af246

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -13
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.write("Aspect and sentiment is:")
34
-
35
- examples=[]
36
- examples.append(input_string)
37
-
38
- inference_source = examples
39
- atepc_result = aspect_extractor.extract_aspect(inference_source=inference_source, #
40
- pred_sentiment=True, # Predict the sentiment of extracted aspect terms
41
- )
42
-
43
- for aspect, sentiment in zip(atepc_result[0]['aspect'], atepc_result[0]['sentiment']):
44
- st.write(aspect + ': ' + sentiment)
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__":