GrammarChecker2 / app.py
BigSalmon's picture
Create new file
41f493e
raw
history blame contribute delete
437 Bytes
import streamlit as st
import language_tool_python
@st.cache(allow_output_mutation=True)
def get_model():
tool = language_tool_python.LanguageTool('en-US')
return tool
tool = get_model()
with st.form(key='my_form'):
prompt = st.text_area(label='Enter sentence', value=g, height=500)
submit_button = st.form_submit_button(label='Submit')
if submit_button:
matches = tool.correct(prompt)
st.write(matches)