File size: 440 Bytes
28a22c3
 
 
20da0a6
28a22c3
 
 
 
 
 
4913e99
28a22c3
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import streamlit as st
from transformers import pipeline

classifier = pipeline("text-classification", model="model")

st.title("TONE DETECTION | BCS WINTER PROJECT")
st.write("Enter a sentence to analyze text's Tone:")

user_input = st.text_input("")
if user_input:
    pred = classifier(user_input)
    tone = pred[0]['label'].upper()
    score = pred[0]['score']*100
    st.write("TONE :- ",tone)
    st.write("SCORE :- ",score,"%")