chrismay commited on
Commit
6402ee3
·
verified ·
1 Parent(s): a8a259c

changed to a sentiment text classifier

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -6,13 +6,14 @@ st.header("Sentiment-demo-app")
6
  st.subheader("Please be patient and wait up to a minute until the demo app is loaded.")
7
  st.caption("This is a very simple demo application for a zero-shot classification pipeline to classify positive, neutral, or negative sentiment for a short text. Enter your text in the box below and press CTRl+ENTER to run the model.")
8
 
9
- classifier = pipeline("zero-shot-classification", model='tabularisai/multilingual-sentiment-analysis') #model='facebook/bart-large-mnli')
10
 
11
  text = st.text_area('Enter text here!')
12
- candidate_labels = ['Positive', 'Neutral', 'Negative']
 
13
 
14
  if text:
15
- out = classifier(text, candidate_labels)
16
  st.json(out)
17
  del out
18
  gc.collect()
 
6
  st.subheader("Please be patient and wait up to a minute until the demo app is loaded.")
7
  st.caption("This is a very simple demo application for a zero-shot classification pipeline to classify positive, neutral, or negative sentiment for a short text. Enter your text in the box below and press CTRl+ENTER to run the model.")
8
 
9
+ classifier = pipeline("text-classification", model='tabularisai/multilingual-sentiment-analysis') #"zero-shot-classification" model='facebook/bart-large-mnli')
10
 
11
  text = st.text_area('Enter text here!')
12
+ #candidate_labels = ['Positive', 'Neutral', 'Negative']
13
+ result = pipe(texts)
14
 
15
  if text:
16
+ out = classifier(text, result)
17
  st.json(out)
18
  del out
19
  gc.collect()