Spaces:
Sleeping
Sleeping
sunil23391
commited on
Update app.py
Browse files
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 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
|
|
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:
|