zbller commited on
Commit
a113688
·
verified ·
1 Parent(s): 7ef8a84

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +26 -2
app.py CHANGED
@@ -149,16 +149,40 @@ with gr.Blocks(theme=gr.themes.Soft(), css=FONT_CSS) as demo:
149
  """
150
  # Mecari Morpheme Analyzer
151
 
152
- GNNベースの形態素解析器"Mecari"のデモです。github: https://github.com/zbller/Mecari
153
  """
154
  )
155
 
156
  with gr.Row():
157
- inp = gr.Textbox(label="テキスト入力", value="とうきょうに行った", placeholder="とうきょうに行った", lines=3)
158
  btn = gr.Button("解析する")
159
  with gr.Row():
160
  out_mecari = gr.Textbox(label="Mecari", lines=10)
161
  out_mecab = gr.Textbox(label="MeCab(Jumandic)", lines=10)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
162
  btn.click(fn=analyze, inputs=inp, outputs=[out_mecari, out_mecab])
163
 
164
  # Optional warm-up
 
149
  """
150
  # Mecari Morpheme Analyzer
151
 
152
+ 形態素解析器"Mecari"のデモです。Googleが発表した手法の非公式再現実装です。GitHub: https://github.com/zbller/Mecari
153
  """
154
  )
155
 
156
  with gr.Row():
157
+ inp = gr.Textbox(label="テキスト入力", value="外国人参政権", placeholder="とうきょうに行った", lines=3)
158
  btn = gr.Button("解析する")
159
  with gr.Row():
160
  out_mecari = gr.Textbox(label="Mecari", lines=10)
161
  out_mecab = gr.Textbox(label="MeCab(Jumandic)", lines=10)
162
+ gr.Examples(
163
+ examples=[
164
+ ["とうきょうに行った"],
165
+ ["吾輩わがはいは猫である。名前はまだ無い。"]
166
+ ],
167
+ inputs=inp,
168
+ outputs=[out_mecari, out_mecab],
169
+ fn=analyze,
170
+ label="Good examples",
171
+ run_on_click=True,
172
+ cache_examples=False,
173
+ )
174
+ gr.Examples(
175
+ examples=[
176
+ ["すもももももももものうち"],
177
+ ["こちら葛飾区亀有公園前派出所"]
178
+ ],
179
+ inputs=inp,
180
+ outputs=[out_mecari, out_mecab],
181
+ fn=analyze,
182
+ label="Bad examples",
183
+ run_on_click=True,
184
+ cache_examples=False,
185
+ )
186
  btn.click(fn=analyze, inputs=inp, outputs=[out_mecari, out_mecab])
187
 
188
  # Optional warm-up