oberbics commited on
Commit
cf4340c
·
verified ·
1 Parent(s): b20ba89

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +62 -36
app.py CHANGED
@@ -303,52 +303,78 @@ with gr.Blocks(css=custom_css, title="Daten Strukturieren und Analysieren") as d
303
  <h1>Daten Strukturieren und Analysieren</h1>
304
  <p style="font-size: 1.1rem; margin-top: -10px;">Dies ist eine Demoversion für die Extrahierung und Visualisierung von Daten</p>
305
  </div>
306
- <p style="font-size: 1.1rem; margin-top: -10px;">In dieser Unterrichtseinheit befassen wir uns mit einer Methode zur Strukturierung unstrukturierter historischer Texte. Im Kern verbindet unsere Anwendung die systematische Strukturierung von Daten mit einem spezialisierten Sprachmodell, das auf der Question-Answering-Methode basiert.</p>
307
 
308
- <h3>Methodik: Vom unstrukturierten Text zur strukturierten Information</h3>
 
 
 
 
309
 
310
- <p>Die grundlegende Herausforderung bei der Arbeit mit historischen Quellen ist, dass relevante Informationen in langen Fließtexten eingebettet sind und manuell mühsam extrahiert werden müssen. Unser Ansatz automatisiert diesen Prozess.</p>
311
-
312
- <h4>Wie funktioniert die Informationsextraktion?</h4>
313
-
314
- <ol>
315
- <li><strong>Template-Definition</strong>: Sie definieren ein JSON-Template mit den Informationstypen, die Sie extrahieren möchten:
316
- <pre><code>{"earthquake location": "", "dateline location": ""}</code></pre>
317
- </li>
318
-
319
- <li><strong>Question-Answering-Methode</strong>: Das Sprachmodell interpretiert jedes leere Feld als implizite Frage:
320
- <ul>
321
- <li><code>"earthquake location": ""</code> → "Wo ist das Erdbeben passiert?"</li>
322
- <li><code>"dateline location": ""</code> → "Von wo wird berichtet?"</li>
323
- </ul>
324
- </li>
325
-
326
- <li><strong>Sprachmodell-Verarbeitung</strong>: Das NuExtract-1.5 Modell (ein Sequence-to-Sequence Transformer) analysiert den Text vollständig und identifiziert die relevanten Informationen für jedes Template-Feld.</li>
327
-
328
- <li><strong>Strukturierte Ausgabe</strong>: Das Modell füllt das Template mit den extrahierten Informationen:
329
- <pre><code>{"earthquake location": "Japan, Yokohama", "dateline location": "Tokio"}</code></pre>
330
- </li>
331
- </ol>
332
-
333
- <h4>Technische Funktionsweise des Sprachmodells</h4>
334
-
335
- <p>Das Modell verarbeitet den Input in diesem Format:</p>
 
 
 
 
 
 
 
 
 
 
336
 
337
- <pre><code>&lt;|input|&gt;
 
 
 
 
 
338
  ### Template:
339
  {"earthquake location": "", "dateline location": ""}
340
  ### Text:
341
  Neues Erdbeben in Japan. Aus Tokio wird berichtet, daß in Yokohama bei einem Erdbeben sechs Personen getötet...
342
  &lt;|output|&gt;</code></pre>
 
 
 
 
 
 
 
 
 
 
343
 
344
- <p>Intern erfolgt die Verarbeitung in mehreren Schritten:</p>
 
 
345
 
346
- <ol>
347
- <li><strong>Tokenisierung</strong>: Der Text wird in bearbeitbare Einheiten zerlegt.</li>
348
- <li><strong>Kontextuelle Analyse</strong>: Der Transformer-Mechanismus ermöglicht die Analyse von Beziehungen zwischen allen Textteilen gleichzeitig.</li>
349
- <li><strong>Selektive Aufmerksamkeit</strong>: Das Modell fokussiert sich auf Textpassagen, die Antworten auf die impliziten Fragen enthalten könnten.</li>
350
- <li><strong>Generierung</strong>: Die erkannten Informationen werden in das vorgegebene Template eingefügt.</li>
351
- </ol>
352
  """)
353
 
354
  with gr.Tabs() as tabs:
 
303
  <h1>Daten Strukturieren und Analysieren</h1>
304
  <p style="font-size: 1.1rem; margin-top: -10px;">Dies ist eine Demoversion für die Extrahierung und Visualisierung von Daten</p>
305
  </div>
306
+ <div style="font-family: 'Source Sans Pro', sans-serif; max-width: 800px; margin: 0 auto; color: #333; line-height: 1.6;">
307
 
308
+ <p style="font-size: 1.2rem; margin-bottom: 1.5rem; color: #2c3e50; font-weight: 400;">
309
+ In dieser Unterrichtseinheit befassen wir uns mit einer Methode zur Strukturierung unstrukturierter historischer Texte.
310
+ Im Kern verbindet unsere Anwendung die systematische Strukturierung von Daten mit einem spezialisierten Sprachmodell,
311
+ das auf der Question-Answering-Methode basiert.
312
+ </p>
313
 
314
+ <div style="background: #f8f9fa; padding: 1.5rem; border-radius: 8px; margin-bottom: 2rem; border-left: 4px solid #3498db;">
315
+ <h3 style="margin-top: 0; color: #2c3e50; border-bottom: 1px solid #eee; padding-bottom: 0.5rem;">
316
+ Methodik: Vom unstrukturierten Text zur strukturierten Information
317
+ </h3>
318
+
319
+ <p style="margin-bottom: 1.5rem;">
320
+ Die grundlegende Herausforderung bei der Arbeit mit historischen Quellen ist, dass relevante Informationen in langen
321
+ Fließtexten eingebettet sind und manuell mühsam extrahiert werden müssen. Unser Ansatz automatisiert diesen Prozess.
322
+ </p>
323
+
324
+ <h4 style="color: #2980b9; margin-top: 1.5rem;">Wie funktioniert die Informationsextraktion?</h4>
325
+
326
+ <ol style="padding-left: 1.5rem;">
327
+ <li style="margin-bottom: 1rem;">
328
+ <strong style="color: #2c3e50;">Template-Definition</strong>: Sie definieren ein JSON-Template mit den Informationstypen, die Sie extrahieren möchten:
329
+ <pre style="background: #f5f5f5; padding: 1rem; border-radius: 4px; overflow-x: auto; margin: 0.5rem 0 1rem;"><code>{"earthquake location": "", "dateline location": ""}</code></pre>
330
+ </li>
331
+
332
+ <li style="margin-bottom: 1rem;">
333
+ <strong style="color: #2c3e50;">Question-Answering-Methode</strong>: Das Sprachmodell interpretiert jedes leere Feld als implizite Frage:
334
+ <ul style="margin-top: 0.5rem; padding-left: 1.5rem;">
335
+ <li><code style="background: #f0f0f0; padding: 0.2rem 0.4rem; border-radius: 3px;">"earthquake location": ""</code> → "Wo ist das Erdbeben passiert?"</li>
336
+ <li><code style="background: #f0f0f0; padding: 0.2rem 0.4rem; border-radius: 3px;">"dateline location": ""</code> → "Von wo wird berichtet?"</li>
337
+ </ul>
338
+ </li>
339
+
340
+ <li style="margin-bottom: 1rem;">
341
+ <strong style="color: #2c3e50;">Sprachmodell-Verarbeitung</strong>: Das NuExtract-1.5 Modell (ein Sequence-to-Sequence Transformer) analysiert den Text vollständig und identifiziert die relevanten Informationen für jedes Template-Feld.
342
+ </li>
343
+
344
+ <li style="margin-bottom: 1rem;">
345
+ <strong style="color: #2c3e50;">Strukturierte Ausgabe</strong>: Das Modell füllt das Template mit den extrahierten Informationen:
346
+ <pre style="background: #f5f5f5; padding: 1rem; border-radius: 4px; overflow-x: auto; margin: 0.5rem 0 1rem;"><code>{"earthquake location": "Japan, Yokohama", "dateline location": "Tokio"}</code></pre>
347
+ </li>
348
+ </ol>
349
+ </div>
350
 
351
+ <div style="background: #f8f9fa; padding: 1.5rem; border-radius: 8px; border-left: 4px solid #9b59b6;">
352
+ <h4 style="color: #2980b9; margin-top: 0;">Technische Funktionsweise des Sprachmodells</h4>
353
+
354
+ <p>Das Modell verarbeitet den Input in diesem Format:</p>
355
+
356
+ <pre style="background: #f5f5f5; padding: 1rem; border-radius: 4px; overflow-x: auto;"><code>&lt;|input|&gt;
357
  ### Template:
358
  {"earthquake location": "", "dateline location": ""}
359
  ### Text:
360
  Neues Erdbeben in Japan. Aus Tokio wird berichtet, daß in Yokohama bei einem Erdbeben sechs Personen getötet...
361
  &lt;|output|&gt;</code></pre>
362
+
363
+ <p style="margin-top: 1.5rem;">Intern erfolgt die Verarbeitung in mehreren Schritten:</p>
364
+
365
+ <ol style="padding-left: 1.5rem;">
366
+ <li style="margin-bottom: 0.5rem;"><strong style="color: #2c3e50;">Tokenisierung</strong>: Der Text wird in bearbeitbare Einheiten zerlegt.</li>
367
+ <li style="margin-bottom: 0.5rem;"><strong style="color: #2c3e50;">Kontextuelle Analyse</strong>: Der Transformer-Mechanismus ermöglicht die Analyse von Beziehungen zwischen allen Textteilen gleichzeitig.</li>
368
+ <li style="margin-bottom: 0.5rem;"><strong style="color: #2c3e50;">Selektive Aufmerksamkeit</strong>: Das Modell fokussiert sich auf Textpassagen, die Antworten auf die impliziten Fragen enthalten könnten.</li>
369
+ <li style="margin-bottom: 0.5rem;"><strong style="color: #2c3e50;">Generierung</strong>: Die erkannten Informationen werden in das vorgegebene Template eingefügt.</li>
370
+ </ol>
371
+ </div>
372
 
373
+ <div style="margin-top: 2rem; padding: 1rem; background: #e8f4fd; border-radius: 8px; text-align: center; font-size: 0.9rem;">
374
+ <p style="margin: 0;">Diese Methode ermöglicht die effiziente Extraktion historischer Daten aus unstrukturierten Quellen.</p>
375
+ </div>
376
 
377
+ </div>
 
 
 
 
 
378
  """)
379
 
380
  with gr.Tabs() as tabs: