Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from haystack import Document
|
2 |
+
from haystack.components.readers import ExtractiveReader
|
3 |
+
|
4 |
+
docs = [
|
5 |
+
Document(content="Python is a popular programming language"),
|
6 |
+
Document(content="python ist eine beliebte Programmiersprache"),
|
7 |
+
]
|
8 |
+
|
9 |
+
reader = ExtractiveReader(model="deepset/roberta-large-squad2")
|
10 |
+
reader.warm_up()
|
11 |
+
|
12 |
+
question = "What is a popular programming language?"
|
13 |
+
result = reader.run(query=question, documents=docs)
|