Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -308,7 +308,7 @@ h2 {
|
|
308 |
|
309 |
/* Fix for map container spacing */
|
310 |
#map-container {
|
311 |
-
height:
|
312 |
margin-bottom: 0 !important;
|
313 |
padding-bottom: 0 !important;
|
314 |
}
|
@@ -351,8 +351,28 @@ with gr.Blocks(css=custom_css, title="Daten Strukturieren und Analysieren") as d
|
|
351 |
<div style="font-family: 'Source Sans Pro', sans-serif; max-width: 1000px; margin: 0 auto; color: #333; line-height: 1.7; font-size: 1.15rem;">
|
352 |
|
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
|
355 |
</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
356 |
|
357 |
<div style="background: #f8f9fa; padding: 2rem; border-radius: 10px; margin-bottom: 2.5rem; border-left: 5px solid #3498db;">
|
358 |
<h3 style="margin-top: 0; color: #2c3e50; border-bottom: 2px solid #eee; padding-bottom: 0.8rem; font-size: 1.5rem;">
|
@@ -520,7 +540,7 @@ with gr.Blocks(css=custom_css, title="Daten Strukturieren und Analysieren") as d
|
|
520 |
map_output = gr.HTML(
|
521 |
label="Interaktive Karte",
|
522 |
value="""
|
523 |
-
<div style="text-align:center; height:
|
524 |
background-color:#f5f5f5; border:1px solid #e0e0e0; border-radius:8px;">
|
525 |
<div>
|
526 |
<img src="https://cdn-icons-png.flaticon.com/512/854/854878.png" width="100">
|
@@ -550,7 +570,7 @@ with gr.Blocks(css=custom_css, title="Daten Strukturieren und Analysieren") as d
|
|
550 |
|
551 |
if map_html and processed_path:
|
552 |
responsive_html = f"""
|
553 |
-
<div style="width:100%; height:
|
554 |
{map_html}
|
555 |
</div>
|
556 |
"""
|
|
|
308 |
|
309 |
/* Fix for map container spacing */
|
310 |
#map-container {
|
311 |
+
height: 20vh !important;
|
312 |
margin-bottom: 0 !important;
|
313 |
padding-bottom: 0 !important;
|
314 |
}
|
|
|
351 |
<div style="font-family: 'Source Sans Pro', sans-serif; max-width: 1000px; margin: 0 auto; color: #333; line-height: 1.7; font-size: 1.15rem;">
|
352 |
|
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;">
|
|
|
540 |
map_output = gr.HTML(
|
541 |
label="Interaktive Karte",
|
542 |
value="""
|
543 |
+
<div style="text-align:center; height:20vh; width:100%; display:flex; align-items:center; justify-content:center;
|
544 |
background-color:#f5f5f5; border:1px solid #e0e0e0; border-radius:8px;">
|
545 |
<div>
|
546 |
<img src="https://cdn-icons-png.flaticon.com/512/854/854878.png" width="100">
|
|
|
570 |
|
571 |
if map_html and processed_path:
|
572 |
responsive_html = f"""
|
573 |
+
<div style="width:100%; height:20vh; margin:0; padding:0; border:1px solid #e0e0e0; border-radius:8px; overflow:hidden;">
|
574 |
{map_html}
|
575 |
</div>
|
576 |
"""
|