oberbics commited on
Commit
7ef1ca5
·
verified ·
1 Parent(s): aaf54ac

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -8
app.py CHANGED
@@ -353,27 +353,22 @@ with gr.Blocks(css=custom_css, title="Daten Strukturieren und Analysieren") as d
353
  <p style="font-size: 1.3rem; margin-bottom: 1.8rem; color: #2c3e50; font-weight: 400; padding: 0 1rem;">
354
  In dieser Unterrichtseinheit befassen wir uns mit der Strukturierung unstrukturierter historischer Texte und der Visualisierung von extrahierten Daten auf Karten. Die systematische Strukturierung von Daten wird mit einem für Informationsextrahierung trainiertem Sprachmodell durchgeführt, das auf der Question-Answering-Methode basiert. Diese Methode erlaubt es, Informationen mit Hilfe einer Frage zu extrahieren, wie etwa „Wo fand das Erdbeben statt"? Dies ermöglicht die Extrahierung des Ortes, an dem ein Erdbeben stattfand, auch wenn im Text selbst noch andere genannt werden.
355
  </p>
356
- I'll visualize the text with earthquake locations in green and other locations in orange:
357
 
358
  <div style="font-family: 'Source Sans Pro', sans-serif; line-height: 1.7; font-size: 1.15rem; background: #f8f9fa; padding: 20px; border-radius: 8px; margin: 20px 0;">
359
- Nene Erdbeben in <span style="background-color: #a8e6cf; font-weight: bold; padding: 2px 5px; border-radius: 3px;" title="Earthquake Location">Japan</span>. <span style="background-color: #ffdfba; font-weight: bold; padding: 2px 5px; border-radius: 3px;" title="Non-Earthquake Location">London</span>, 15. Jan. (Drahtber.) Reuter meldet aus <span style="background-color: #ffdfba; font-weight: bold; padding: 2px 5px; border-radius: 3px;" title="Non-Earthquake Location">Osaka</span>: Die telephonische Verbindung zwischen <span style="background-color: #ffdfba; font-weight: bold; padding: 2px 5px; border-radius: 3px;" title="Non-Earthquake Location">Osaka</span> und <span style="background-color: #ffdfba; font-weight: bold; padding: 2px 5px; border-radius: 3px;" title="Non-Earthquake Location">Tokio</span> ist heute um 5.45 Uhr durch ein Erdbeben unterbrochen worden. Die Straßenbahnen in <span style="background-color: #ffdfba; font-weight: bold; padding: 2px 5px; border-radius: 3px;" title="Non-Earthquake Location">Tokio</span> liegen still. Der Eisenbahnverkehr <span style="background-color: #ffdfba; font-weight: bold; padding: 2px 5px; border-radius: 3px;" title="Non-Earthquake Location">Tokio</span> — <span style="background-color: #ffdfba; font-weight: bold; padding: 2px 5px; border-radius: 3px;" title="Non-Earthquake Location">Osaka</span> ist unterbrochen. Die kaiserliche Familie ist in Sicherheit. In <span style="background-color: #ffdfba; font-weight: bold; padding: 2px 5px; border-radius: 3px;" title="Non-Earthquake Location">Suvamo</span>, einer Borstadt <span style="background-color: #ffdfba; font-weight: bold; padding: 2px 5px; border-radius: 3px;" title="Non-Earthquake Location">Tokios</span>, sind Brände ausgebrochen. Ein Eisenbahnzug stürzte in den <span style="background-color: #ffdfba; font-weight: bold; padding: 2px 5px; border-radius: 3px;" title="Non-Earthquake Location">Bajubawo</span>, einem Fluß zwischen <span style="background-color: #ffdfba; font-weight: bold; padding: 2px 5px; border-radius: 3px;" title="Non-Earthquake Location">Gotemba</span> und <span style="background-color: #ffdfba; font-weight: bold; padding: 2px 5px; border-radius: 3px;" title="Non-Earthquake Location">Tokio</span>. Sechs Züge wurden umgeworfen. <span style="background-color: #ffdfba; font-weight: bold; padding: 2px 5px; border-radius: 3px;" title="Non-Earthquake Location">Nenqork</span>, 15. Jan. (Drahtber.) Aus <span style="background-color: #ffdfba; font-weight: bold; padding: 2px 5px; border-radius: 3px;" title="Non-Earthquake Location">Tokio</span> wird berichtet, daß in <span style="background-color: #a8e6cf; font-weight: bold; padding: 2px 5px; border-radius: 3px;" title="Earthquake Location">Uokohama</span> bei dem Erdbeben sechs Personen getötet und 22 verletzt wurden. In <span style="background-color: #ffdfba; font-weight: bold; padding: 2px 5px; border-radius: 3px;" title="Non-Earthquake Location">Tokio</span> wurden vier Personen getötet und 20 verletzt. In <span style="background-color: #a8e6cf; font-weight: bold; padding: 2px 5px; border-radius: 3px;" title="Earthquake Location">Nokohama</span> wurden 800 Häuser zerstört.
360
  </div>
361
 
362
  <div style="display: flex; margin-top: 20px;">
363
  <div style="display: flex; align-items: center; margin-right: 20px;">
364
  <div style="width: 20px; height: 20px; background-color: #a8e6cf; margin-right: 10px; border-radius: 3px;"></div>
365
- <span>Earthquake Locations: Japan, Uokohama (Yokohama), Nokohama (Yokohama)</span>
366
  </div>
367
  <div style="display: flex; align-items: center;">
368
  <div style="width: 20px; height: 20px; background-color: #ffdfba; margin-right: 10px; border-radius: 3px;"></div>
369
- <span>Other Locations: London, Osaka, Tokio, Suvamo, Gotemba, Nenqork (New York), etc.</span>
370
  </div>
371
  </div>
372
 
373
- <div style="margin-top: 20px; font-style: italic;">
374
- Note: This visualization shows how the model would differentiate between locations where earthquakes occurred (in green) versus locations that are mentioned but were not earthquake sites (in orange). The model determines this based on contextual clues in the text.
375
- </div>
376
-
377
  <div style="background: #f8f9fa; padding: 2rem; border-radius: 10px; margin-bottom: 2.5rem; border-left: 5px solid #3498db;">
378
  <h3 style="margin-top: 0; color: #2c3e50; border-bottom: 2px solid #eee; padding-bottom: 0.8rem; font-size: 1.5rem;">
379
  Methodik: Vom unstrukturierten Text zur strukturierten Information
 
353
  <p style="font-size: 1.3rem; margin-bottom: 1.8rem; color: #2c3e50; font-weight: 400; padding: 0 1rem;">
354
  In dieser Unterrichtseinheit befassen wir uns mit der Strukturierung unstrukturierter historischer Texte und der Visualisierung von extrahierten Daten auf Karten. Die systematische Strukturierung von Daten wird mit einem für Informationsextrahierung trainiertem Sprachmodell durchgeführt, das auf der Question-Answering-Methode basiert. Diese Methode erlaubt es, Informationen mit Hilfe einer Frage zu extrahieren, wie etwa „Wo fand das Erdbeben statt"? Dies ermöglicht die Extrahierung des Ortes, an dem ein Erdbeben stattfand, auch wenn im Text selbst noch andere genannt werden.
355
  </p>
 
356
 
357
  <div style="font-family: 'Source Sans Pro', sans-serif; line-height: 1.7; font-size: 1.15rem; background: #f8f9fa; padding: 20px; border-radius: 8px; margin: 20px 0;">
358
+ Nene Erdbeben in <span style="background-color: #a8e6cf; font-weight: bold; padding: 2px 5px; border-radius: 3px;" title="Earthquake Location">Japan</span>. <span style="background-color: #ffdfba; font-weight: bold; padding: 2px 5px; border-radius: 3px;" title="Non-Earthquake Location">London</span>, 15. Jan. (Drahtber.) Reuter meldet aus <span style="background-color: #ffdfba; font-weight: bold; padding: 2px 5px; border-radius: 3px;" title="Non-Earthquake Location">Osaka</span>: Die telephonische Verbindung zwischen <span style="background-color: #ffdfba; font-weight: bold; padding: 2px 5px; border-radius: 3px;" title="Non-Earthquake Location">Osaka</span> und <span style="background-color: #ffdfba; font-weight: bold; padding: 2px 5px; border-radius: 3px;" title="Non-Earthquake Location">Tokio</span> ist heute um 5.45 Uhr durch ein Erdbeben unterbrochen worden. Die Straßenbahnen in <span style="background-color: #ffdfba; font-weight: bold; padding: 2px 5px; border-radius: 3px;" title="Non-Earthquake Location">Tokio</span> liegen still. Der Eisenbahnverkehr <span style="background-color: #ffdfba; font-weight: bold; padding: 2px 5px; border-radius: 3px;" title="Non-Earthquake Location">Tokio</span> — <span style="background-color: #ffdfba; font-weight: bold; padding: 2px 5px; border-radius: 3px;" title="Non-Earthquake Location">Osaka</span> ist unterbrochen. Die kaiserliche Familie ist in Sicherheit. In <span style="background-color: #ffdfba; font-weight: bold; padding: 2px 5px; border-radius: 3px;" title="Non-Earthquake Location">Suvamo</span>, einer Borstadt <span style="background-color: #ffdfba; font-weight: bold; padding: 2px 5px; border-radius: 3px;" title="Non-Earthquake Location">Tokios</span>, sind Brände ausgebrochen. Ein Eisenbahnzug stürzte in den <span style="background-color: #ffdfba; font-weight: bold; padding: 2px 5px; border-radius: 3px;" title="Non-Earthquake Location">Bajubawo</span>, einem Fluß zwischen <span style="background-color: #ffdfba; font-weight: bold; padding: 2px 5px; border-radius: 3px;" title="Non-Earthquake Location">Gotemba</span> und <span style="background-color: #ffdfba; font-weight: bold; padding: 2px 5px; border-radius: 3px;" title="Non-Earthquake Location">Tokio</span>. Sechs Züge wurden umgeworfen.
359
  </div>
360
 
361
  <div style="display: flex; margin-top: 20px;">
362
  <div style="display: flex; align-items: center; margin-right: 20px;">
363
  <div style="width: 20px; height: 20px; background-color: #a8e6cf; margin-right: 10px; border-radius: 3px;"></div>
364
+ <span>Ort des Erdbebens: Japan</span>
365
  </div>
366
  <div style="display: flex; align-items: center;">
367
  <div style="width: 20px; height: 20px; background-color: #ffdfba; margin-right: 10px; border-radius: 3px;"></div>
368
+ <span>Andere Orte: London, Osaka, Tokio, Suvamo, Gotemba.</span>
369
  </div>
370
  </div>
371
 
 
 
 
 
372
  <div style="background: #f8f9fa; padding: 2rem; border-radius: 10px; margin-bottom: 2.5rem; border-left: 5px solid #3498db;">
373
  <h3 style="margin-top: 0; color: #2c3e50; border-bottom: 2px solid #eee; padding-bottom: 0.8rem; font-size: 1.5rem;">
374
  Methodik: Vom unstrukturierten Text zur strukturierten Information