taishi-i commited on
Commit
88b75d2
Β·
1 Parent(s): f450fdc

update app.py for gradio 4.36.0

Browse files
Files changed (2) hide show
  1. README.md +1 -1
  2. app.py +9 -8
README.md CHANGED
@@ -4,7 +4,7 @@ emoji: πŸ“š
4
  colorFrom: pink
5
  colorTo: red
6
  sdk: gradio
7
- sdk_version: 3.40.1
8
  app_file: app.py
9
  pinned: false
10
  license: mit
 
4
  colorFrom: pink
5
  colorTo: red
6
  sdk: gradio
7
+ sdk_version: 4.36.0
8
  app_file: app.py
9
  pinned: false
10
  license: mit
app.py CHANGED
@@ -2,7 +2,7 @@ import gradio as gr
2
  from toiro import tokenizers
3
 
4
  num_input_lines = 3
5
- default_text = "γ“γ“γ«γƒ†γ‚­γ‚Ήγƒˆγ‚’ε…₯εŠ›γ—γ€Submit γ‚’ζŠΌγ—γ¦γγ γ•γ„γ€‚"
6
  title = "Japanese Tokenizer Comparison"
7
  description = """
8
  This is a demo comparing Japanese tokenizers. You can compare the tokenization results of tools that are available with just a `pip install` in Python.
@@ -65,7 +65,7 @@ def tokenize(text):
65
 
66
  iface = gr.Interface(
67
  fn=tokenize,
68
- inputs=gr.inputs.Textbox(
69
  label="Input text",
70
  lines=num_input_lines,
71
  default=default_text,
@@ -74,13 +74,14 @@ iface = gr.Interface(
74
  description=description,
75
  article=article,
76
  outputs=[
77
- gr.outputs.Textbox(label="Janome"),
78
- gr.outputs.Textbox(label="nagisa"),
79
- gr.outputs.Textbox(label="sudachi.rs"),
80
- gr.outputs.Textbox(label="mecab-python3"),
81
- gr.outputs.Textbox(label="fugashi_ipadic"),
82
- gr.outputs.Textbox(label="fugashi_unidic"),
83
  ],
 
84
  )
85
 
86
 
 
2
  from toiro import tokenizers
3
 
4
  num_input_lines = 3
5
+ default_text = "γ“γ“γ«γƒ†γ‚­γ‚Ήγƒˆγ‚’ε…₯εŠ›γ—γ€Enter γ‚’ζŠΌγ—γ¦γγ γ•γ„γ€‚"
6
  title = "Japanese Tokenizer Comparison"
7
  description = """
8
  This is a demo comparing Japanese tokenizers. You can compare the tokenization results of tools that are available with just a `pip install` in Python.
 
65
 
66
  iface = gr.Interface(
67
  fn=tokenize,
68
+ inputs=gr.Textbox(
69
  label="Input text",
70
  lines=num_input_lines,
71
  default=default_text,
 
74
  description=description,
75
  article=article,
76
  outputs=[
77
+ gr.Textbox(label="Janome"),
78
+ gr.Textbox(label="nagisa"),
79
+ gr.Textbox(label="sudachi.rs"),
80
+ gr.Textbox(label="mecab-python3"),
81
+ gr.Textbox(label="fugashi_ipadic"),
82
+ gr.Textbox(label="fugashi_unidic"),
83
  ],
84
+ live=True,
85
  )
86
 
87