AjayKr09 commited on
Commit
7dd988a
·
verified ·
1 Parent(s): 1777a5c

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -0
app.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import pandas as pd
3
+ import numpy as np
4
+ import torch
5
+ import transformers
6
+
7
+ # Use a pipeline as a high-level helper
8
+ from transformers import pipeline
9
+
10
+ pipe = pipeline("text-classification", model="bhadresh-savani/bert-base-uncased-emotion")
11
+
12
+ st.write('Enter Text for Emotion Detection:')
13
+
14
+ text=st.text_input("")
15
+
16
+ if st.button("Submit"):
17
+ st.write(pipe(text)[0]["label"])