aiDevzz commited on
Commit
0f07ba4
1 Parent(s): 335c7d5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -4
app.py CHANGED
@@ -1,6 +1,21 @@
1
  import streamlit as st
 
2
 
3
- st.text("darwin is a Pre-Trained Model, use on google colab , or on your own Gpu/cpu, requirements<nvidia,intel,23Gb+, atleast a 4Gb+>")
4
- st.text("how to use Darwin")
5
- st.text("")
6
- st.textBox("insert or type a prompt")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  import streamlit as st
2
+ from transformers import pipeline
3
 
4
+ def main():
5
+ st.title("Hugging Face Sentiment Analysis")
6
+
7
+ # User input for text
8
+ user_input = st.text_input("Enter some text:")
9
+
10
+ if user_input:
11
+ # Load sentiment analysis pipeline
12
+ sentiment_pipeline = pipeline("sentiment-analysis")
13
+
14
+ # Perform sentiment analysis
15
+ result = sentiment_pipeline(user_input)
16
+
17
+ # Display sentiment analysis result
18
+ st.write("Sentiment:", result[0]['label'], "- Confidence:", round(result[0]['score'], 4))
19
+
20
+ if __name__ == "__main__":
21
+ main()