Skip to content

Commit

Permalink
Fix parameter names in tutorial 5 and 12 (#1639)
Browse files Browse the repository at this point in the history
* Fix parameter names in tutorial 5

* Update parameters in tutorial notebook

* Add latest docstring and tutorial changes

* Add latest docstring and tutorial changes

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
julian-risch and github-actions[bot] committed Oct 22, 2021
1 parent 6da2c73 commit 6033319
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions docs/_src/tutorials/tutorials/12.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@ Before we blindly use the `RetribertRetriever` let's empirically test it to make


```python
from haystack.utils import print_answers, print_documents
from haystack.utils import print_documents
from haystack.pipeline import DocumentSearchPipeline

p_retrieval = DocumentSearchPipeline(retriever)
res = p_retrieval.run(
query="Tell me something about Arya Stark?",
params={"top_k": 5}
params={"Retriever": {"top_k": 10}}
)
print_documents(res, max_text_len=512)

Expand Down
6 changes: 3 additions & 3 deletions docs/_src/tutorials/tutorials/5.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,8 @@ from haystack import Pipeline
p = Pipeline()
p.add_node(component=retriever, name="Retriever", inputs=["Query"])
p.add_node(component=eval_retriever, name="EvalRetriever", inputs=["Retriever"])
p.add_node(component=reader, name="QAReader", inputs=["EvalRetriever"])
p.add_node(component=eval_reader, name="EvalReader", inputs=["QAReader"])
p.add_node(component=reader, name="Reader", inputs=["EvalRetriever"])
p.add_node(component=eval_reader, name="EvalReader", inputs=["Reader"])
results = []
```

Expand All @@ -226,7 +226,7 @@ for l in labels:
res = p.run(
query=l.query,
labels=l,
params={"index": doc_index, "Retriever": {"top_k": 10}, "QAReader": {"top_k": 5}},
params={"index": doc_index, "Retriever": {"top_k": 10}, "Reader": {"top_k": 5}},
)
results.append(res)
```
Expand Down
4 changes: 2 additions & 2 deletions tutorials/Tutorial12_LFQA.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -212,13 +212,13 @@
"id": "qpu-t9rndgpe"
},
"source": [
"from haystack.utils import print_answers, print_documents\n",
"from haystack.utils import print_documents\n",
"from haystack.pipeline import DocumentSearchPipeline\n",
"\n",
"p_retrieval = DocumentSearchPipeline(retriever)\n",
"res = p_retrieval.run(\n",
" query=\"Tell me something about Arya Stark?\",\n",
" params={\"top_k\": 5}\n",
" params={\"Retriever\": {\"top_k\": 10}}\n",
")\n",
"print_documents(res, max_text_len=512)\n"
],
Expand Down
2 changes: 1 addition & 1 deletion tutorials/Tutorial12_LFQA.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def tutorial12_lfqa():

"""Before we blindly use the `RetribertRetriever` let's empirically test it to make sure a simple search indeed finds the relevant documents."""

from haystack.utils import print_answers, print_documents
from haystack.utils import print_documents
from haystack.pipeline import DocumentSearchPipeline

p_retrieval = DocumentSearchPipeline(retriever)
Expand Down
6 changes: 3 additions & 3 deletions tutorials/Tutorial5_Evaluation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -499,8 +499,8 @@
"p = Pipeline()\n",
"p.add_node(component=retriever, name=\"Retriever\", inputs=[\"Query\"])\n",
"p.add_node(component=eval_retriever, name=\"EvalRetriever\", inputs=[\"Retriever\"])\n",
"p.add_node(component=reader, name=\"QAReader\", inputs=[\"EvalRetriever\"])\n",
"p.add_node(component=eval_reader, name=\"EvalReader\", inputs=[\"QAReader\"])\n",
"p.add_node(component=reader, name=\"Reader\", inputs=[\"EvalRetriever\"])\n",
"p.add_node(component=eval_reader, name=\"EvalReader\", inputs=[\"Reader\"])\n",
"results = []"
]
},
Expand All @@ -523,7 +523,7 @@
" res = p.run(\n",
" query=l.query,\n",
" labels=l,\n",
" params={\"index\": doc_index, \"Retriever\": {\"top_k\": 10}, \"QAReader\": {\"top_k\": 5}},\n",
" params={\"index\": doc_index, \"Retriever\": {\"top_k\": 10}, \"Reader\": {\"top_k\": 5}},\n",
" )\n",
" results.append(res)"
],
Expand Down
6 changes: 3 additions & 3 deletions tutorials/Tutorial5_Evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,15 +138,15 @@ def tutorial5_evaluation():
p = Pipeline()
p.add_node(component=retriever, name="Retriever", inputs=["Query"])
p.add_node(component=eval_retriever, name="EvalDocuments", inputs=["Retriever"])
p.add_node(component=reader, name="QAReader", inputs=["EvalDocuments"])
p.add_node(component=eval_reader, name="EvalAnswers", inputs=["QAReader"])
p.add_node(component=reader, name="Reader", inputs=["EvalDocuments"])
p.add_node(component=eval_reader, name="EvalAnswers", inputs=["Reader"])
results = []

for l in labels:
res = p.run(
query=l.query,
labels=l,
params={"index": doc_index, "Retriever": {"top_k": 10}, "QAReader": {"top_k": 5}},
params={"index": doc_index, "Retriever": {"top_k": 10}, "Reader": {"top_k": 5}},
)
results.append(res)

Expand Down

0 comments on commit 6033319

Please sign in to comment.