Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
from grammarcorrector import GrammarCorrector
|
3 |
+
|
4 |
+
# Initialize the GrammarCorrector
|
5 |
+
corrector = GrammarCorrector()
|
6 |
+
|
7 |
+
# Streamlit app title
|
8 |
+
st.title("Grammar Correction App")
|
9 |
+
|
10 |
+
# Input text area
|
11 |
+
user_input = st.text_area("Enter text to correct:", height=200)
|
12 |
+
|
13 |
+
# Button to trigger correction
|
14 |
+
if st.button("Correct Grammar"):
|
15 |
+
if user_input:
|
16 |
+
# Perform grammar correction
|
17 |
+
corrected_text = corrector.correct(user_input)
|
18 |
+
st.subheader("Corrected Text:")
|
19 |
+
st.write(corrected_text)
|
20 |
+
else:
|
21 |
+
st.warning("Please enter text to correct.")
|