cstr commited on
Commit
343d404
·
verified ·
1 Parent(s): afcdc52

no caching of examples for now vastly enriched data

Browse files
Files changed (1) hide show
  1. app.py +21 -11
app.py CHANGED
@@ -1,5 +1,5 @@
1
  # ============================================================================
2
- # GERMAN LINGUISTICS HUB (CONSOLIDATED APP V22)
3
  #
4
  # This script combines multiple NLP tools into a single Gradio interface.
5
  #
@@ -3223,7 +3223,8 @@ def create_languagetool_tab():
3223
  gr.Examples(
3224
  [["Das ist ein Huas."], ["Ich sehe dem Mann."],
3225
  ["Die Katze schlafen auf dem Tisch."], ["Er fragt ob er gehen kann."]],
3226
- inputs=[text_input], outputs=[output], fn=lt_check_grammar
 
3227
  )
3228
 
3229
  def create_odenet_tab():
@@ -3245,7 +3246,8 @@ def create_odenet_tab():
3245
  )
3246
  gr.Examples(
3247
  [["Hund"], ["gut"], ["laufen"], ["Haus"], ["schnell"]],
3248
- inputs=[word_input], outputs=[output], fn=odenet_get_thesaurus_info
 
3249
  )
3250
 
3251
  def create_pattern_tab():
@@ -3267,7 +3269,8 @@ def create_pattern_tab():
3267
  )
3268
  gr.Examples(
3269
  [["Haus"], ["gehen"], ["schön"], ["besser"], ["ging"], ["schnellem"], ["Katze"], ["Lauf"], ["See"]],
3270
- inputs=[word_input], outputs=[output], fn=pattern_get_all_inflections
 
3271
  )
3272
 
3273
  def create_conceptnet_tab():
@@ -3295,7 +3298,8 @@ def create_conceptnet_tab():
3295
  )
3296
  gr.Examples(
3297
  [["Baum", "de"], ["tree", "en"], ["Katze", "de"], ["gato", "es"]],
3298
- inputs=[word_input, lang_input], outputs=[output], fn=conceptnet_get_relations
 
3299
  )
3300
 
3301
  def create_combined_tab():
@@ -3352,7 +3356,8 @@ def create_combined_tab():
3352
  ["Ich fahre an den See.", 3]],
3353
  inputs=[text_input, top_n_number],
3354
  outputs=[status_output, output],
3355
- fn=run_analysis_with_status
 
3356
  )
3357
 
3358
  def create_word_encyclopedia_tab():
@@ -3408,7 +3413,8 @@ def create_word_encyclopedia_tab():
3408
  ["gebildet", 0, "dwdsmor"]], # Example to show the new engine
3409
  inputs=[word_input, top_n_number, engine_radio],
3410
  outputs=[output],
3411
- fn=analyze_word_encyclopedia
 
3412
  )
3413
 
3414
  def create_wiktionary_tab():
@@ -3433,7 +3439,8 @@ def create_wiktionary_tab():
3433
  )
3434
  gr.Examples(
3435
  [["Haus"], ["gehe"], ["heute"], ["Lauf"]],
3436
- inputs=[word_input], outputs=[output], fn=lambda word: _analyze_word_with_wiktionary(word, 0)
 
3437
  )
3438
 
3439
  def create_dwdsmor_tab():
@@ -3488,7 +3495,8 @@ def create_dwdsmor_tab():
3488
  )
3489
  gr.Examples(
3490
  [["gebildet"], ["schnell"], ["Häuser"], ["gehe"]],
3491
- inputs=[word_input], outputs=[output], fn=dwdsmor_raw_analysis
 
3492
  )
3493
 
3494
  def create_hanta_tab():
@@ -3513,7 +3521,8 @@ def create_hanta_tab():
3513
  )
3514
  gr.Examples(
3515
  [["Haus"], ["gehe"], ["heute"], ["Lauf"]],
3516
- inputs=[word_input], outputs=[output], fn=lambda word: _analyze_word_with_hanta(word, 0)
 
3517
  )
3518
 
3519
  def create_iwnlp_tab():
@@ -3538,7 +3547,8 @@ def create_iwnlp_tab():
3538
  )
3539
  gr.Examples(
3540
  [["Haus"], ["gehe"], ["heute"], ["Lauf"]],
3541
- inputs=[word_input], outputs=[output], fn=lambda word: _analyze_word_with_iwnlp(word, 0)
 
3542
  )
3543
 
3544
  # --- Main UI Builder ---
 
1
  # ============================================================================
2
+ # GERMAN LINGUISTICS HUB (CONSOLIDATED APP V23)
3
  #
4
  # This script combines multiple NLP tools into a single Gradio interface.
5
  #
 
3223
  gr.Examples(
3224
  [["Das ist ein Huas."], ["Ich sehe dem Mann."],
3225
  ["Die Katze schlafen auf dem Tisch."], ["Er fragt ob er gehen kann."]],
3226
+ inputs=[text_input], outputs=[output], fn=lt_check_grammar,
3227
+ cache_examples=False
3228
  )
3229
 
3230
  def create_odenet_tab():
 
3246
  )
3247
  gr.Examples(
3248
  [["Hund"], ["gut"], ["laufen"], ["Haus"], ["schnell"]],
3249
+ inputs=[word_input], outputs=[output], fn=odenet_get_thesaurus_info,
3250
+ cache_examples=False
3251
  )
3252
 
3253
  def create_pattern_tab():
 
3269
  )
3270
  gr.Examples(
3271
  [["Haus"], ["gehen"], ["schön"], ["besser"], ["ging"], ["schnellem"], ["Katze"], ["Lauf"], ["See"]],
3272
+ inputs=[word_input], outputs=[output], fn=pattern_get_all_inflections,
3273
+ cache_examples=False
3274
  )
3275
 
3276
  def create_conceptnet_tab():
 
3298
  )
3299
  gr.Examples(
3300
  [["Baum", "de"], ["tree", "en"], ["Katze", "de"], ["gato", "es"]],
3301
+ inputs=[word_input, lang_input], outputs=[output], fn=conceptnet_get_relations,
3302
+ cache_examples=False
3303
  )
3304
 
3305
  def create_combined_tab():
 
3356
  ["Ich fahre an den See.", 3]],
3357
  inputs=[text_input, top_n_number],
3358
  outputs=[status_output, output],
3359
+ fn=run_analysis_with_status,
3360
+ cache_examples=False
3361
  )
3362
 
3363
  def create_word_encyclopedia_tab():
 
3413
  ["gebildet", 0, "dwdsmor"]], # Example to show the new engine
3414
  inputs=[word_input, top_n_number, engine_radio],
3415
  outputs=[output],
3416
+ fn=analyze_word_encyclopedia,
3417
+ cache_examples=False
3418
  )
3419
 
3420
  def create_wiktionary_tab():
 
3439
  )
3440
  gr.Examples(
3441
  [["Haus"], ["gehe"], ["heute"], ["Lauf"]],
3442
+ inputs=[word_input], outputs=[output], fn=lambda word: _analyze_word_with_wiktionary(word, 0),
3443
+ cache_examples=False
3444
  )
3445
 
3446
  def create_dwdsmor_tab():
 
3495
  )
3496
  gr.Examples(
3497
  [["gebildet"], ["schnell"], ["Häuser"], ["gehe"]],
3498
+ inputs=[word_input], outputs=[output], fn=dwdsmor_raw_analysis,
3499
+ cache_examples=False
3500
  )
3501
 
3502
  def create_hanta_tab():
 
3521
  )
3522
  gr.Examples(
3523
  [["Haus"], ["gehe"], ["heute"], ["Lauf"]],
3524
+ inputs=[word_input], outputs=[output], fn=lambda word: _analyze_word_with_hanta(word, 0),
3525
+ cache_examples=False
3526
  )
3527
 
3528
  def create_iwnlp_tab():
 
3547
  )
3548
  gr.Examples(
3549
  [["Haus"], ["gehe"], ["heute"], ["Lauf"]],
3550
+ inputs=[word_input], outputs=[output], fn=lambda word: _analyze_word_with_iwnlp(word, 0),
3551
+ cache_examples=False
3552
  )
3553
 
3554
  # --- Main UI Builder ---