test / app.py
aaurelions's picture
Create app.py
d157479 verified
raw
history blame
587 Bytes
import streamlit as st
from grammarcorrector import GrammarCorrector
# Initialize the GrammarCorrector
corrector = GrammarCorrector()
# Streamlit app title
st.title("Grammar Correction App")
# Input text area
user_input = st.text_area("Enter text to correct:", height=200)
# Button to trigger correction
if st.button("Correct Grammar"):
if user_input:
# Perform grammar correction
corrected_text = corrector.correct(user_input)
st.subheader("Corrected Text:")
st.write(corrected_text)
else:
st.warning("Please enter text to correct.")