Spaces:
Sleeping
Sleeping
Create app.py
Browse files
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"])
|