WRX020510 commited on
Commit
5e438ff
·
verified ·
1 Parent(s): 2d0e494

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -0
app.py ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from transformers import pipeline
3
+ def main():
4
+
5
+ sentiment_pipeline = pipeline(model=______)
6
+ st.title("Sentiment Analysis with HuggingFace Spaces") st.write("Enter a sentence to analyze its sentiment:")
7
+ user_input = st.text_input("")
8
+ if user_input:
9
+ result = sentiment_pipeline(user_input) sentiment = result[0]["label"] confidence = result[0]["score"]
10
+ st.write(f"Sentiment: {sentiment}") st.write(f"Confidence: {confidence:.2f}")
11
+
12
+
13
+ if __name__ == "__main__":
14
+ main()