Update output
Browse files- __pycache__/utils.cpython-310.pyc +0 -0
- app.py +7 -5
- utils.py +1 -0
__pycache__/utils.cpython-310.pyc
CHANGED
|
Binary files a/__pycache__/utils.cpython-310.pyc and b/__pycache__/utils.cpython-310.pyc differ
|
|
|
app.py
CHANGED
|
@@ -1,9 +1,11 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
from utils import *
|
| 3 |
|
| 4 |
-
def final_result(
|
| 5 |
-
|
| 6 |
-
return
|
| 7 |
|
| 8 |
-
demo = gr.Interface(fn=final_result, inputs="
|
| 9 |
-
|
|
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from utils import *
|
| 3 |
|
| 4 |
+
def final_result(input_text):
|
| 5 |
+
input_text_process = character_replacement(input_text, num_errors=3)
|
| 6 |
+
return str(input_text_process)
|
| 7 |
|
| 8 |
+
demo = gr.Interface(fn=final_result, inputs="textbox", outputs="textbox")
|
| 9 |
+
|
| 10 |
+
if __name__ == "__main__":
|
| 11 |
+
demo.launch()
|
utils.py
CHANGED
|
@@ -30,6 +30,7 @@ def character_replacement(text, num_errors=1):
|
|
| 30 |
Sử dụng ''.join(text) để ghép danh sách các ký tự lại thành chuỗi văn bản hoàn chỉnh.
|
| 31 |
|
| 32 |
'''
|
|
|
|
| 33 |
# Bàn phím QWERTY tiếng Việt
|
| 34 |
keyboard = {
|
| 35 |
'a': 'âăáàạảãấầậẩẫắằặẳẵ',
|
|
|
|
| 30 |
Sử dụng ''.join(text) để ghép danh sách các ký tự lại thành chuỗi văn bản hoàn chỉnh.
|
| 31 |
|
| 32 |
'''
|
| 33 |
+
|
| 34 |
# Bàn phím QWERTY tiếng Việt
|
| 35 |
keyboard = {
|
| 36 |
'a': 'âăáàạảãấầậẩẫắằặẳẵ',
|