JBDef commited on
Commit
942ab48
1 Parent(s): 9aebf92

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -8
app.py CHANGED
@@ -1,14 +1,20 @@
1
- # -*- coding: utf-8 -*-
2
- """app.ipynb
3
 
4
- Automatically generated by Colaboratory.
 
 
5
 
6
- Original file is located at
7
- https://colab.research.google.com/drive/1bXYJd-Dtj9a5gFAvEQDojckzYpN0pcRX
8
- """
 
 
 
 
9
 
10
- from transformers import pipeline
 
11
 
12
- question = pipeline("visual-question-answering")
13
 
14
  question("cat.png", "how many cat are there?")
 
1
+ import streamlit as st
2
+ from transformers import pipeline
3
 
4
+ question = pipeline("visual-question-answering")
5
+ def main():
6
+ st.title("Sentiment 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")
12
+ if clicked:
13
+ results = classifier([text])
14
+ st.json(results)
15
 
16
+ if __name__ == "__main__":
17
+ main()
18
 
 
19
 
20
  question("cat.png", "how many cat are there?")