File size: 558 Bytes
a97191b
 
7850de7
e43a9a5
00956db
e43a9a5
bf71f96
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import streamlit


from transformers.pipelines import pipeline


# Use a pipeline as a high-level helper


pipe = pipeline("zero-shot-classification", model="knowledgator/comprehend_it-base")

candidate_labels = ['travel', 'cooking', 'dancing', 'exploration']
st.write(classifier(sequence_to_classify, candidate_labels, multi_label=True))
#{'labels': ['travel', 'exploration', 'dancing', 'cooking'],
# 'scores': [0.9945111274719238,
#  0.9383890628814697,
#  0.0057061901316046715,
#  0.0018193122232332826],
# 'sequence': 'one day I will see the world'}