sumonta056 commited on
Commit
11701c0
·
verified ·
1 Parent(s): f6e3550

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -8
app.py CHANGED
@@ -1,17 +1,20 @@
1
  import streamlit as st
2
- from transformers import BertForSequenceClassification, BertTokenizerFast, pipeline
3
 
4
- model_path = "./"
5
- model = BertForSequenceClassification.from_pretrained(model_path)
6
- tokenizer = BertTokenizerFast.from_pretrained(model_path)
7
- nlp = pipeline("sentiment-analysis", model=model, tokenizer=tokenizer)
8
 
9
- # Streamlit app
10
- st.title("Simple Emotion Analyzer")
 
 
 
11
 
12
  # Input text
13
  text = st.text_area("Enter text to analyze:")
14
 
15
  if text:
16
- result = nlp(text)
17
  st.json(result)
 
1
  import streamlit as st
2
+ from transformers import pipeline
3
 
4
+ # model_path = "./"
5
+ # model = BertForSequenceClassification.from_pretrained(model_path)
6
+ # tokenizer = BertTokenizerFast.from_pretrained(model_path)
7
+ # nlp = pipeline("sentiment-analysis", model=model, tokenizer=tokenizer)
8
 
9
+ # # Streamlit app
10
+ # st.title("Simple Emotion Analyzer")
11
+
12
+
13
+ pipe = pipeline('sentiment-analysis')
14
 
15
  # Input text
16
  text = st.text_area("Enter text to analyze:")
17
 
18
  if text:
19
+ result = pipe(text)
20
  st.json(result)