Spaces:
Sleeping
Sleeping
JasmineQiuqiu
commited on
Commit
•
92387b3
1
Parent(s):
7f613e2
Update app.py
Browse files
app.py
CHANGED
@@ -1,24 +1,13 @@
|
|
1 |
-
|
2 |
-
from transformers import pipeline
|
3 |
|
4 |
-
|
|
|
5 |
|
6 |
-
#
|
7 |
-
|
8 |
|
9 |
-
|
10 |
-
|
11 |
-
return "Welcome to the Sentiment Analysis API!"
|
12 |
|
13 |
-
|
14 |
-
|
15 |
-
data = request.get_json()
|
16 |
-
text = data['text']
|
17 |
-
result = sentiment_analyzer(text)[0]
|
18 |
-
return jsonify({
|
19 |
-
'label': result['label'],
|
20 |
-
'score': result['score']
|
21 |
-
})
|
22 |
-
|
23 |
-
if __name__ == "__main__":
|
24 |
-
app.run(host='0.0.0.0', port=5000)
|
|
|
1 |
+
import streamlit as st
|
|
|
2 |
|
3 |
+
# Title of the application
|
4 |
+
st.title('Welcome to my Streamlit App!')
|
5 |
|
6 |
+
# Display text
|
7 |
+
st.write("This is a simple Streamlit application.")
|
8 |
|
9 |
+
# Display emoji
|
10 |
+
st.write("Here's an emoji for you: :smiley:")
|
|
|
11 |
|
12 |
+
# A placeholder for additional content
|
13 |
+
st.write("Use the endpoint /predict to get sentiment analysis results.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|