sunil23391 commited on
Commit
28933e8
1 Parent(s): e67ae92

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -5
app.py CHANGED
@@ -1,6 +1,7 @@
1
  import os
2
  os.system('pip install transformers')
3
  os.system('pip install torch')
 
4
  # Import required libraries
5
  import torch
6
  import transformers
@@ -23,11 +24,12 @@ def analyze_sentiment(text):
23
  return result
24
 
25
  # Create the user input form
26
- col1, col2 = st.columns(2)
27
- with col1:
28
- text_input = st.text_area("Enter Text:", "", key="my_input")
29
- with col2:
30
- submitted = st.form_submit_button("Submit")
 
31
 
32
  # Display the sentiment analysis results
33
  if submitted:
 
1
  import os
2
  os.system('pip install transformers')
3
  os.system('pip install torch')
4
+
5
  # Import required libraries
6
  import torch
7
  import transformers
 
24
  return result
25
 
26
  # Create the user input form
27
+ with st.form(key='sentiment_analysis'):
28
+ col1, col2 = st.columns(2)
29
+ with col1:
30
+ text_input = st.text_area("Enter Text:", "", key="my_input")
31
+ with col2:
32
+ submitted = st.form_submit_button("Submit")
33
 
34
  # Display the sentiment analysis results
35
  if submitted: