Spaces:
Runtime error
Runtime error
Commit
·
d19ecaa
1
Parent(s):
52c3eb7
Upload app.py
Browse files
app.py
CHANGED
|
@@ -38,7 +38,7 @@ orange = [197/255, 90/255, 17/255]
|
|
| 38 |
|
| 39 |
# Pipelines definieren
|
| 40 |
en_de_translator = pipeline("translation_de_to_en", model='google/bert2bert_L-24_wmt_de_en')
|
| 41 |
-
|
| 42 |
|
| 43 |
tab1, tab2, tab3, tab4 = st.tabs(
|
| 44 |
["Künstliche Neuronale Netze", "Wortvektoren Stimmung", "Wörter Maskieren", "Demos"])
|
|
@@ -366,3 +366,18 @@ with tab4:
|
|
| 366 |
|
| 367 |
a5 = en_de_translator(string_3)
|
| 368 |
st.text(a5)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
|
| 39 |
# Pipelines definieren
|
| 40 |
en_de_translator = pipeline("translation_de_to_en", model='google/bert2bert_L-24_wmt_de_en')
|
| 41 |
+
qa_pipeline = pipeline("question-answering", model='deepset/gelectra-base-germanquad')
|
| 42 |
|
| 43 |
tab1, tab2, tab3, tab4 = st.tabs(
|
| 44 |
["Künstliche Neuronale Netze", "Wortvektoren Stimmung", "Wörter Maskieren", "Demos"])
|
|
|
|
| 366 |
|
| 367 |
a5 = en_de_translator(string_3)
|
| 368 |
st.text(a5)
|
| 369 |
+
|
| 370 |
+
st.text('')
|
| 371 |
+
text_input_4 = 'Was ist der Schwerpunkt?'
|
| 372 |
+
|
| 373 |
+
string_4 = st.text_area('Frage zum Kontext beantworten', value=text_input_4, height=25)
|
| 374 |
+
|
| 375 |
+
text_input_5 = 'Wir ünterstützen Unternehmen bei der Datenanalyse durch individuelle Beratung und Projekte mit besonderem Fokus auf maschinelles Lernen und Deep Learning.'
|
| 376 |
+
|
| 377 |
+
string_5 = st.text_area('Kontext', value=text_input_5, height=75)
|
| 378 |
+
|
| 379 |
+
if st.button('Ein fertig trainiertes Transformer-Modell von HuggingFace anwenden', key=4):
|
| 380 |
+
with st.spinner('Die Beantwortung der Frage kann einige Sekunden dauern ...'):
|
| 381 |
+
|
| 382 |
+
a5 = qa_pipeline(question=string_4, context=string_5)
|
| 383 |
+
st.text(a5)
|