import streamlit as st from spellchecker import SpellChecker from language_tool_python import LanguageTool st.title("📝 Spelling and Grammar Checker") st.markdown("# Welcome to the Spelling and Grammar Checker! ✨📚") input_text = st.text_area("Enter your text:") if st.button("Check Spelling and Grammar 🚀"): # Initialize spell checker spell = SpellChecker() words = input_text.split() # Correct spelling using PySpellChecker corrected_words = [spell.correction(word) for word in words] corrected_text = " ".join(corrected_words) tool = LanguageTool('en-US') # Perform grammar and contextual correction grammar_corrected_text = tool.correct(corrected_text) st.subheader("✅ Corrected Text:") st.write(grammar_corrected_text)