Krittiya commited on
Commit
2174f72
·
1 Parent(s): 03e6c24

Upload 2 files

Browse files
Files changed (2) hide show
  1. app.py +17 -0
  2. requirements.txt +3 -0
app.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from transformers import pipeline
3
+
4
+ sentiment_classifier = pipeline("text-classification", model=model_path, tokenizer=model_path)
5
+ def main():
6
+ st.title("Mood Analysis")
7
+
8
+ with st.form("text_field"):
9
+ text = st.text_area('enter some text:')
10
+ # clicked==True only when the button is clicked
11
+ clicked = st.form_submit_button("Submit text")
12
+ if clicked:
13
+ results = sentiment_classifier([text])
14
+ st.json(results)
15
+
16
+ if __name__ == "__main__":
17
+ main()
requirements.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ torch
2
+ transformers
3
+ altair<5