File size: 490 Bytes
ef1c326
5f1e84c
ef1c326
daf2555
 
 
 
 
 
5f1e84c
daf2555
5f1e84c
daf2555
5f1e84c
ef1c326
daf2555
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import streamlit as st
from transformers import pipeline

# Load pre-trained model pipeline
model_name = "lucieackley/autotrain-fitness_message_classification-40235104670"
pipe = pipeline('text-classification', model=model_name)

st.title("Fitness Message Classifier")

text = st.text_area("Enter text: ")

if text:
    # Get model's prediction
    out = pipe(text)

    # Show prediction
    st.write(f"The text was classified as: {out[0]['label']} with a score of {out[0]['score']:.2f}")