CyberFox Claude Opus 5 (1M context) commited on
Commit
dfbcb2f
·
1 Parent(s): 1a93c81

feat: add Portuguese (PT) support to the demo

Browse files

- Add PT to both language dropdowns and the flag map
- Add PT text and URL examples (Cristiano Ronaldo, pt.wikipedia/Lisboa)
- Update header and README to six supported languages

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

Files changed (2) hide show
  1. README.md +3 -3
  2. app.py +6 -4
README.md CHANGED
@@ -9,7 +9,7 @@ app_file: app.py
9
  pinned: true
10
  license: apache-2.0
11
  python_version: "3.11"
12
- short_description: Multilingual NER + NED Entity Linking (EN/IT/FR/DE/ES)
13
  env:
14
  - GRADIO_SSR_MODE=false
15
  ---
@@ -18,10 +18,10 @@ env:
18
 
19
  Elevate your website's performance with our AI-powered entity extraction and disambiguation tool.
20
 
21
- Ready to turbocharge your SEO efforts and see your organic search performance soar? Look no further than our next-generation AI-powered entity linker — now with multilingual support across **five languages**!
22
 
23
  With our intelligent solution powered by **GLiNER** and **BGE-M3**, you can analyze your content — whether raw text or any URL — and instantly identify all relevant entities within it. Each entity is automatically linked to its corresponding **Wikidata entry**, complete with descriptions and confidence scores.
24
 
25
  This powerful combination helps search engines like Google better understand your content and rank it higher in search results. But that's not all! With precise entity disambiguation, our tool distinguishes between entities that share the same name, ensuring accurate knowledge graph connections that amplify your SEO benefits.
26
 
27
- **Supported languages:** English 🇬🇧 · Italian 🇮🇹 · French 🇫🇷 · German 🇩🇪 · Spanish 🇪🇸
 
9
  pinned: true
10
  license: apache-2.0
11
  python_version: "3.11"
12
+ short_description: Multilingual NER + NED Entity Linking (EN/IT/FR/DE/ES/PT)
13
  env:
14
  - GRADIO_SSR_MODE=false
15
  ---
 
18
 
19
  Elevate your website's performance with our AI-powered entity extraction and disambiguation tool.
20
 
21
+ Ready to turbocharge your SEO efforts and see your organic search performance soar? Look no further than our next-generation AI-powered entity linker — now with multilingual support across **six languages**!
22
 
23
  With our intelligent solution powered by **GLiNER** and **BGE-M3**, you can analyze your content — whether raw text or any URL — and instantly identify all relevant entities within it. Each entity is automatically linked to its corresponding **Wikidata entry**, complete with descriptions and confidence scores.
24
 
25
  This powerful combination helps search engines like Google better understand your content and rank it higher in search results. But that's not all! With precise entity disambiguation, our tool distinguishes between entities that share the same name, ensuring accurate knowledge graph connections that amplify your SEO benefits.
26
 
27
+ **Supported languages:** English 🇬🇧 · Italian 🇮🇹 · French 🇫🇷 · German 🇩🇪 · Spanish 🇪🇸 · Portuguese 🇵🇹
app.py CHANGED
@@ -281,7 +281,7 @@ def build_stats_html(result: dict) -> str:
281
  for t, c in sorted(type_counts.items(), key=lambda x: -x[1])
282
  )
283
 
284
- lang_flags = {"en": "🇬🇧", "it": "🇮🇹", "fr": "🇫🇷", "de": "🇩🇪", "es": "🇪🇸"}
285
  flag = lang_flags.get(lang, "🌐")
286
 
287
  return f'''
@@ -417,7 +417,7 @@ DESCRIPTION = """
417
  Multilingual Named Entity Recognition &amp; Disambiguation powered by
418
  <strong style="color: #4f46e5;">GLiNER</strong> +
419
  <strong style="color: #7c3aed;">BGE-M3</strong> •
420
- Supports <strong>EN</strong> 🇬🇧 <strong>IT</strong> 🇮🇹 <strong>FR</strong> 🇫🇷 <strong>DE</strong> 🇩🇪 <strong>ES</strong> 🇪🇸
421
  </p>
422
  <p style="color: #64748b; font-size: 0.8em; margin-top: 4px;">
423
  <strong style="color: #4f46e5;">NER</strong> detects entity mentions •
@@ -433,11 +433,13 @@ EXAMPLES_TEXT = [
433
  ["Emmanuel Macron a rencontré Angela Merkel à l'Élysée à Paris pour discuter du Brexit.", "Auto-detect", 0.5],
434
  ["Die Europäische Zentralbank in Frankfurt hat neue geldpolitische Maßnahmen angekündigt.", "Auto-detect", 0.5],
435
  ["Lionel Messi firmó un contrato con el Inter Miami en los Estados Unidos.", "Auto-detect", 0.5],
 
436
  ]
437
 
438
  EXAMPLES_URL = [
439
  ["https://en.wikipedia.org/wiki/OpenAI", "Auto-detect", 0.5],
440
  ["https://it.wikipedia.org/wiki/Roma", "Auto-detect", 0.5],
 
441
  ]
442
 
443
 
@@ -467,7 +469,7 @@ with gr.Blocks(
467
  )
468
  with gr.Column(scale=1):
469
  lang_dropdown = gr.Dropdown(
470
- choices=["Auto-detect", "en", "it", "fr", "de", "es"],
471
  value="Auto-detect",
472
  label="Language",
473
  )
@@ -504,7 +506,7 @@ with gr.Blocks(
504
  )
505
  with gr.Column(scale=1):
506
  url_lang = gr.Dropdown(
507
- choices=["Auto-detect", "en", "it", "fr", "de", "es"],
508
  value="Auto-detect",
509
  label="Language",
510
  )
 
281
  for t, c in sorted(type_counts.items(), key=lambda x: -x[1])
282
  )
283
 
284
+ lang_flags = {"en": "🇬🇧", "it": "🇮🇹", "fr": "🇫🇷", "de": "🇩🇪", "es": "🇪🇸", "pt": "🇵🇹"}
285
  flag = lang_flags.get(lang, "🌐")
286
 
287
  return f'''
 
417
  Multilingual Named Entity Recognition &amp; Disambiguation powered by
418
  <strong style="color: #4f46e5;">GLiNER</strong> +
419
  <strong style="color: #7c3aed;">BGE-M3</strong> •
420
+ Supports <strong>EN</strong> 🇬🇧 <strong>IT</strong> 🇮🇹 <strong>FR</strong> 🇫🇷 <strong>DE</strong> 🇩🇪 <strong>ES</strong> 🇪🇸 <strong>PT</strong> 🇵🇹
421
  </p>
422
  <p style="color: #64748b; font-size: 0.8em; margin-top: 4px;">
423
  <strong style="color: #4f46e5;">NER</strong> detects entity mentions •
 
433
  ["Emmanuel Macron a rencontré Angela Merkel à l'Élysée à Paris pour discuter du Brexit.", "Auto-detect", 0.5],
434
  ["Die Europäische Zentralbank in Frankfurt hat neue geldpolitische Maßnahmen angekündigt.", "Auto-detect", 0.5],
435
  ["Lionel Messi firmó un contrato con el Inter Miami en los Estados Unidos.", "Auto-detect", 0.5],
436
+ ["Cristiano Ronaldo nasceu na Madeira e jogou pelo Sporting antes de se mudar para o Manchester United.", "Auto-detect", 0.5],
437
  ]
438
 
439
  EXAMPLES_URL = [
440
  ["https://en.wikipedia.org/wiki/OpenAI", "Auto-detect", 0.5],
441
  ["https://it.wikipedia.org/wiki/Roma", "Auto-detect", 0.5],
442
+ ["https://pt.wikipedia.org/wiki/Lisboa", "Auto-detect", 0.5],
443
  ]
444
 
445
 
 
469
  )
470
  with gr.Column(scale=1):
471
  lang_dropdown = gr.Dropdown(
472
+ choices=["Auto-detect", "en", "it", "fr", "de", "es", "pt"],
473
  value="Auto-detect",
474
  label="Language",
475
  )
 
506
  )
507
  with gr.Column(scale=1):
508
  url_lang = gr.Dropdown(
509
+ choices=["Auto-detect", "en", "it", "fr", "de", "es", "pt"],
510
  value="Auto-detect",
511
  label="Language",
512
  )