Alex3456 commited on
Commit
c80a46b
·
1 Parent(s): 0cdfe70

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -2,9 +2,13 @@ import streamlit as st
2
  import transformers
3
  from transformers import pipeline
4
 
 
5
  classifier = pipeline("zero-shot-classification",model="facebook/bart-large-mnli")
6
- sequence_to_classify =
7
  candidate_labels = ['travel', 'cooking', 'dancing', 'exploration']
 
8
 
9
- classifier(sequence_to_classify, candidate_labels, multi_label=True)
10
 
 
 
 
 
 
2
  import transformers
3
  from transformers import pipeline
4
 
5
+ text = st.text_area("Enter the text here")
6
  classifier = pipeline("zero-shot-classification",model="facebook/bart-large-mnli")
 
7
  candidate_labels = ['travel', 'cooking', 'dancing', 'exploration']
8
+ classifier(text, candidate_labels, multi_label=True)
9
 
 
10
 
11
+ if text :
12
+ out = pipe(text)
13
+ st.json(out)
14
+