speechemotion / app.py
Nattyboi's picture
Update app.py
e543504
raw
history blame
771 Bytes
import streamlit as st
from transformers.pipelines import pipeline
# Use a pipeline as a high-level helper
classifier = pipeline("zero-shot-classification", model="knowledgator/comprehend_it-base")
candidate_labels = ['Lecture quality', 'lecturer teaching strength', 'assignments given', 'comments on lecturers teaching venue','Lecturers test and exam grading']
sequence_to_classify = "I hate Mr Thomas class, he doesn't teach well and he doesn't give assignments"
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'}