Commit
·
14a08a6
1
Parent(s):
ee7952e
Update
Browse files
app.py
CHANGED
@@ -11,11 +11,16 @@ args = TTSettings(num_beams=5, min_length=1)
|
|
11 |
|
12 |
# Streamlit app
|
13 |
def main():
|
14 |
-
st.title("Spelling and Grammar Checker")
|
|
|
15 |
|
16 |
# Input text area
|
17 |
text_input = st.text_area("Enter your text here:")
|
18 |
|
|
|
|
|
|
|
|
|
19 |
# Check button
|
20 |
if st.button("Check"):
|
21 |
# Spelling correction
|
@@ -25,6 +30,12 @@ def main():
|
|
25 |
result = happy_tt.generate_text(f"grammar: {text_input}", args=args)
|
26 |
corrected_grammar = result.text
|
27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
# Display corrected text
|
29 |
st.subheader("Corrected Text:")
|
30 |
st.write(corrected_grammar) # Display grammar-corrected text
|
@@ -32,6 +43,11 @@ def main():
|
|
32 |
# Display spelling correction if there's a difference
|
33 |
if corrected_spelling != corrected_grammar:
|
34 |
st.write(f"Spelling was also corrected to: {corrected_spelling}")
|
|
|
|
|
|
|
|
|
|
|
35 |
|
36 |
if __name__ == "__main__":
|
37 |
main()
|
|
|
11 |
|
12 |
# Streamlit app
|
13 |
def main():
|
14 |
+
st.title("WordWarden: Spelling and Grammar Checker")
|
15 |
+
st.caption("WordWarden is an advanced Spelling and Grammar Checker powered by state-of-the-art AI models. With the integration of T5 Grammar Correction and spelling-correction-english-base models, WordWarden ensures accurate and efficient correction of spelling and grammar errors in your text. Simply input your text, and WordWarden will swiftly identify and correct spelling mistakes, as well as enhance grammatical accuracy, providing you with polished and professional writing. Elevate your writing quality effortlessly with WordWarden!")
|
16 |
|
17 |
# Input text area
|
18 |
text_input = st.text_area("Enter your text here:")
|
19 |
|
20 |
+
# Initialize counters
|
21 |
+
spelling_counter = 0
|
22 |
+
grammar_counter = 0
|
23 |
+
|
24 |
# Check button
|
25 |
if st.button("Check"):
|
26 |
# Spelling correction
|
|
|
30 |
result = happy_tt.generate_text(f"grammar: {text_input}", args=args)
|
31 |
corrected_grammar = result.text
|
32 |
|
33 |
+
# Increment counters if corrections were made
|
34 |
+
if corrected_spelling != text_input:
|
35 |
+
spelling_counter += 1
|
36 |
+
if corrected_grammar != text_input:
|
37 |
+
grammar_counter += 1
|
38 |
+
|
39 |
# Display corrected text
|
40 |
st.subheader("Corrected Text:")
|
41 |
st.write(corrected_grammar) # Display grammar-corrected text
|
|
|
43 |
# Display spelling correction if there's a difference
|
44 |
if corrected_spelling != corrected_grammar:
|
45 |
st.write(f"Spelling was also corrected to: {corrected_spelling}")
|
46 |
+
|
47 |
+
# Display counters
|
48 |
+
st.sidebar.subheader("Corrections Summary")
|
49 |
+
st.sidebar.write(f"Spelling Corrections: {spelling_counter}")
|
50 |
+
st.sidebar.write(f"Grammar Corrections: {grammar_counter}")
|
51 |
|
52 |
if __name__ == "__main__":
|
53 |
main()
|