richardorama
commited on
Commit
•
4426139
1
Parent(s):
f35d308
Update app.py
Browse files
app.py
CHANGED
@@ -51,7 +51,7 @@ DEFAULT_SENTIMENT = [
|
|
51 |
]
|
52 |
|
53 |
# Create a text area for user input
|
54 |
-
SENTIMENT = st.sidebar.text_area('Enter
|
55 |
|
56 |
# Define the summarization function
|
57 |
def summarize(txt):
|
@@ -63,7 +63,7 @@ def summarize(txt):
|
|
63 |
results = sentiment_pipeline(txt)
|
64 |
|
65 |
# Display the results
|
66 |
-
for i, text in enumerate(
|
67 |
st.write(f"Text: {text}")
|
68 |
st.write(f"Sentiment: {results[i]['label']}, Score: {results[i]['score']:.2f}\n")
|
69 |
|
|
|
51 |
]
|
52 |
|
53 |
# Create a text area for user input
|
54 |
+
SENTIMENT = st.sidebar.text_area('Enter Sentiment', DEFAULT_SENTIMENT, height=150)
|
55 |
|
56 |
# Define the summarization function
|
57 |
def summarize(txt):
|
|
|
63 |
results = sentiment_pipeline(txt)
|
64 |
|
65 |
# Display the results
|
66 |
+
for i, text in enumerate(txt):
|
67 |
st.write(f"Text: {text}")
|
68 |
st.write(f"Sentiment: {results[i]['label']}, Score: {results[i]['score']:.2f}\n")
|
69 |
|