File size: 407 Bytes
7dd988a
 
 
 
 
 
 
 
 
 
 
8b0df03
 
7dd988a
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import streamlit as st
import pandas as pd
import numpy as np
import torch
import transformers

# Use a pipeline as a high-level helper
from transformers import pipeline

pipe = pipeline("text-classification", model="bhadresh-savani/bert-base-uncased-emotion")

st.write('')

st.write('Enter Text for Emotion Detection:')

text=st.text_input("")

if st.button("Submit"):
    st.write(pipe(text)[0]["label"])