Spaces:
Runtime error
Runtime error
Create new file
Browse files
app.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
import language_tool_python
|
| 3 |
+
|
| 4 |
+
@st.cache(allow_output_mutation=True)
|
| 5 |
+
def get_model():
|
| 6 |
+
tool = language_tool_python.LanguageTool('en-US')
|
| 7 |
+
return tool
|
| 8 |
+
|
| 9 |
+
tool = get_model()
|
| 10 |
+
|
| 11 |
+
with st.form(key='my_form'):
|
| 12 |
+
prompt = st.text_area(label='Enter sentence', value=g, height=500)
|
| 13 |
+
submit_button = st.form_submit_button(label='Submit')
|
| 14 |
+
if submit_button:
|
| 15 |
+
matches = tool.correct(prompt)
|
| 16 |
+
st.write(matches)
|