Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -104,6 +104,11 @@ def paraphrase_and_correct(text):
|
|
| 104 |
final_text = correct_tense_errors(nlp(corrected_text))
|
| 105 |
|
| 106 |
return final_text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 107 |
|
| 108 |
# Gradio app setup with two tabs
|
| 109 |
with gr.Blocks() as demo:
|
|
@@ -125,4 +130,4 @@ with gr.Blocks() as demo:
|
|
| 125 |
paraphrase_button.click(paraphrase_and_correct, inputs=text_input, outputs=output_text)
|
| 126 |
|
| 127 |
# Launch the app with the remaining functionalities
|
| 128 |
-
demo.launch()
|
|
|
|
| 104 |
final_text = correct_tense_errors(nlp(corrected_text))
|
| 105 |
|
| 106 |
return final_text
|
| 107 |
+
def predict_en(text):
|
| 108 |
+
prediction = pipeline_en(text)
|
| 109 |
+
label = prediction[0]['label']
|
| 110 |
+
score = prediction[0]['score']
|
| 111 |
+
return label, round(score, 4)
|
| 112 |
|
| 113 |
# Gradio app setup with two tabs
|
| 114 |
with gr.Blocks() as demo:
|
|
|
|
| 130 |
paraphrase_button.click(paraphrase_and_correct, inputs=text_input, outputs=output_text)
|
| 131 |
|
| 132 |
# Launch the app with the remaining functionalities
|
| 133 |
+
demo.launch()
|