File size: 872 Bytes
741ea16
 
 
 
7e9aed2
 
 
 
 
741ea16
 
 
 
 
 
 
 
 
 
7e9aed2
 
741ea16
 
7e9aed2
 
 
741ea16
7e9aed2
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import streamlit as st
from transformers import pipeline

# Load your model
@st.cache_resource
def load_model():
    return pipeline("text-classification", model="KevSun/Personality_LM")

model = load_model()

st.title("Personality Prediction App")

st.write("Enter your text below to predict personality traits:")

user_input = st.text_area("Your text here:")

if st.button("Predict"):
    if user_input:
        # Process the input and get predictions
        with st.spinner("Analyzing..."):
            result = model(user_input)
        
        # Display results
        st.subheader("Predicted personality traits:")
        for trait in result:
            st.write(f"- {trait['label']}: {trait['score']:.2f}")
    else:
        st.warning("Please enter some text to analyze.")

st.info("Note: This is a demonstration and predictions may not be entirely accurate.")