ayoni02 commited on
Commit
7db39be
·
1 Parent(s): 823c495
Files changed (2) hide show
  1. app.py +22 -0
  2. requirements.txt +4 -0
app.py ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import pipeline
2
+ import streamlit as st
3
+ #from functions import classify
4
+
5
+ st.write("welcome")
6
+ classifier = pipeline("zero-shot-classification", model="facebook/bart-large-mnli")
7
+ #res = classify("i am a good boy")
8
+ #st.write(res)
9
+
10
+
11
+ def main():
12
+ text = st.text_input("Enter the text to classify: ") #input("Enter the text to classify: ")
13
+ labels = ["POSITIVE", "NEGATIVE", "NEUTRAL"]
14
+ if text:
15
+ results = classifier(text, labels)
16
+ st.write(results['sequence'])
17
+ st.write(results['labels'])
18
+ st.write(results['scores'])
19
+ else:
20
+ st.write("Please enter some text to classify")
21
+
22
+ main()
requirements.txt ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ pip
2
+ transformers
3
+ streamlit
4
+ torch