ShynBui commited on
Commit
86f6efe
·
1 Parent(s): 6df811c

Update output

Browse files
Files changed (3) hide show
  1. __pycache__/utils.cpython-310.pyc +0 -0
  2. app.py +7 -5
  3. 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(text):
5
- text = character_replacement(text, num_errors=3)
6
- return text
7
 
8
- demo = gr.Interface(fn=final_result, inputs="text", outputs="text")
9
- demo.launch()
 
 
 
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': 'âăáàạảãấầậẩẫắằặẳẵ',