Samp007 commited on
Commit
180b28d
·
1 Parent(s): 103612d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -15
app.py CHANGED
@@ -2,21 +2,6 @@ import streamlit as st
2
  import pandas as pd
3
  from transformers import pipeline
4
 
5
- st.set_page_config(page_title="Sentiment Analysis App")
6
- st.sidebar.title("Sentiment Analysis App")
7
- st.sidebar.write("Choose a pre-trained model for sentiment analysis")
8
- model_name = st.sidebar.selectbox("Select Model", ["bert-base-uncased", "distilbert-base-uncased", "roberta-base"])
9
- text_input = st.text_input("Enter text for sentiment analysis")
10
-
11
- if st.button("Analyze"):
12
- if text_input:
13
- sentiment_classifier = pipeline("sentiment-analysis", model=model_name)
14
- result = sentiment_classifier(text_input)[0]
15
- st.write(f"Sentiment: {result['label']}")
16
- st.write(f"Score: {round(result['score'], 4)}")
17
- else:
18
- st.warning("Please enter some text for sentiment analysis")
19
-
20
  def main():
21
  st.set_page_config(page_title="Sentiment Analysis App")
22
  st.sidebar.title("Sentiment Analysis App")
 
2
  import pandas as pd
3
  from transformers import pipeline
4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  def main():
6
  st.set_page_config(page_title="Sentiment Analysis App")
7
  st.sidebar.title("Sentiment Analysis App")