testspace / app.py
kdevoe's picture
Update app.py
69f85a6 verified
raw
history blame
666 Bytes
import pandas as pd
import streamlit as st
from inference import inference
from inference import DebertaEvaluator
st.title("Essay Scoring")
categories=['cohesion', 'syntax', 'vocabulary', 'phraseology', 'grammar', 'conventions']
initial_scores = {category: '-' for category in categories}
scores_df = pd.DataFrame(initial_scores, index=[0])
text = "Here is a sample essay."
user_input = st.text_area("Enter your essay here:", value=text)
# Display the initial scores table
st.table(scores_df)
if st.button("Calculate Scores"):
scores = inference(user_input)
scores_df = pd.DataFrame([scores], index=['Score'])
st.table(scored_df)
st.write(out)