Spaces:
Running
Running
Initial commit
Browse files
app.py
CHANGED
|
@@ -13,7 +13,8 @@ import errant
|
|
| 13 |
import time
|
| 14 |
import os
|
| 15 |
|
| 16 |
-
def start_server():
|
|
|
|
| 17 |
os.system("uvicorn InferenceServer:app --port 8080 --host 0.0.0.0 --workers 1")
|
| 18 |
|
| 19 |
def load_models():
|
|
@@ -147,7 +148,7 @@ def get_correction(input_text):
|
|
| 147 |
correct_json = json.loads(correct_response.text)
|
| 148 |
scored_corrected_sentence = correct_json["scored_corrected_sentence"]
|
| 149 |
|
| 150 |
-
corrected_sentence, score = scored_corrected_sentence
|
| 151 |
st.markdown(f'##### Corrected text:')
|
| 152 |
st.write('')
|
| 153 |
st.success(corrected_sentence)
|
|
@@ -166,20 +167,20 @@ if __name__ == "__main__":
|
|
| 166 |
|
| 167 |
st.title('Gramformer')
|
| 168 |
st.subheader('A framework for correcting english grammatical errors')
|
| 169 |
-
st.markdown("Built for fun with π by
|
| 170 |
|
| 171 |
examples = [
|
| 172 |
"what be the reason for everyone leave the comapny",
|
| 173 |
-
"
|
| 174 |
"I am doing fine. How is you?",
|
| 175 |
-
"
|
| 176 |
"Matt like fish",
|
| 177 |
"the collection of letters was original used by the ancient Romans",
|
| 178 |
"We enjoys horror movies",
|
| 179 |
"Anna and Mike is going skiing",
|
| 180 |
"I walk to the store and I bought milk",
|
| 181 |
" We all eat the fish and then made dessert",
|
| 182 |
-
"I will eat fish for dinner and
|
| 183 |
]
|
| 184 |
|
| 185 |
nlp = spacy.load('en_core_web_sm')
|
|
|
|
| 13 |
import time
|
| 14 |
import os
|
| 15 |
|
| 16 |
+
def start_server():
|
| 17 |
+
os.system("python -m spacy download en_core_web_sm")
|
| 18 |
os.system("uvicorn InferenceServer:app --port 8080 --host 0.0.0.0 --workers 1")
|
| 19 |
|
| 20 |
def load_models():
|
|
|
|
| 148 |
correct_json = json.loads(correct_response.text)
|
| 149 |
scored_corrected_sentence = correct_json["scored_corrected_sentence"]
|
| 150 |
|
| 151 |
+
corrected_sentence, score = scored_corrected_sentence
|
| 152 |
st.markdown(f'##### Corrected text:')
|
| 153 |
st.write('')
|
| 154 |
st.success(corrected_sentence)
|
|
|
|
| 167 |
|
| 168 |
st.title('Gramformer')
|
| 169 |
st.subheader('A framework for correcting english grammatical errors')
|
| 170 |
+
st.markdown("Built for fun with π by Prithivi Da, The maker of [WhatTheFood](https://huggingface.co/spaces/prithivida/WhatTheFood), [Styleformer](https://github.com/PrithivirajDamodaran/Styleformer) and [Parrot paraphraser](https://github.com/PrithivirajDamodaran/Parrot_Paraphraser) | βοΈ [@prithivida](https://twitter.com/prithivida) |[[GitHub]](https://github.com/PrithivirajDamodaran)", unsafe_allow_html=True)
|
| 171 |
|
| 172 |
examples = [
|
| 173 |
"what be the reason for everyone leave the comapny",
|
| 174 |
+
"The girls's backpacks are gone in the morning",
|
| 175 |
"I am doing fine. How is you?",
|
| 176 |
+
"Each of you all should run fast",
|
| 177 |
"Matt like fish",
|
| 178 |
"the collection of letters was original used by the ancient Romans",
|
| 179 |
"We enjoys horror movies",
|
| 180 |
"Anna and Mike is going skiing",
|
| 181 |
"I walk to the store and I bought milk",
|
| 182 |
" We all eat the fish and then made dessert",
|
| 183 |
+
"I will eat fish for dinner and drank milk",
|
| 184 |
]
|
| 185 |
|
| 186 |
nlp = spacy.load('en_core_web_sm')
|