From d569e66bc76f386375e64ea342a3fa57626b69c2 Mon Sep 17 00:00:00 2001 From: Julian Risch Date: Wed, 22 Sep 2021 16:35:20 +0200 Subject: [PATCH] Update Tutorial1_Basic_QA_Pipeline.ipynb (#1489) * Update Tutorial1_Basic_QA_Pipeline.ipynb passing params to pipeline as dict * Add latest docstring and tutorial changes Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- docs/_src/tutorials/tutorials/1.md | 8 +++++--- tutorials/Tutorial1_Basic_QA_Pipeline.ipynb | 10 ++++++---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/docs/_src/tutorials/tutorials/1.md b/docs/_src/tutorials/tutorials/1.md index cbdee1b74..b00234bcd 100644 --- a/docs/_src/tutorials/tutorials/1.md +++ b/docs/_src/tutorials/tutorials/1.md @@ -225,13 +225,15 @@ pipe = ExtractiveQAPipeline(reader, retriever) ```python # You can configure how many candidates the reader and retriever shall return # The higher top_k_retriever, the better (but also the slower) your answers. -prediction = pipe.run(query="Who is the father of Arya Stark?", top_k_retriever=10, top_k_reader=5) +prediction = pipe.run( + query="Who is the father of Arya Stark?", params={"Retriever": {"top_k": 10}, "Reader": {"top_k": 5}} +) ``` ```python -# prediction = pipe.run(query="Who created the Dothraki vocabulary?", top_k_reader=5) -# prediction = pipe.run(query="Who is the sister of Sansa?", top_k_reader=5) +# prediction = pipe.run(query="Who created the Dothraki vocabulary?", params={"Reader": {"top_k": 5}}) +# prediction = pipe.run(query="Who is the sister of Sansa?", params={"Reader": {"top_k": 5}}) ``` diff --git a/tutorials/Tutorial1_Basic_QA_Pipeline.ipynb b/tutorials/Tutorial1_Basic_QA_Pipeline.ipynb index 5efb48d58..5c0a365c3 100644 --- a/tutorials/Tutorial1_Basic_QA_Pipeline.ipynb +++ b/tutorials/Tutorial1_Basic_QA_Pipeline.ipynb @@ -349,7 +349,9 @@ "source": [ "# You can configure how many candidates the reader and retriever shall return\n", "# The higher top_k_retriever, the better (but also the slower) your answers. \n", - "prediction = pipe.run(query=\"Who is the father of Arya Stark?\", top_k_retriever=10, top_k_reader=5)" + "prediction = pipe.run(\n", + " query=\"Who is the father of Arya Stark?\", params={\"Retriever\": {\"top_k\": 10}, \"Reader\": {\"top_k\": 5}}\n", + ")" ] }, { @@ -358,8 +360,8 @@ "metadata": {}, "outputs": [], "source": [ - "# prediction = pipe.run(query=\"Who created the Dothraki vocabulary?\", top_k_reader=5)\n", - "# prediction = pipe.run(query=\"Who is the sister of Sansa?\", top_k_reader=5)" + "# prediction = pipe.run(query=\"Who created the Dothraki vocabulary?\", params={\"Reader\": {\"top_k\": 5}})\n", + "# prediction = pipe.run(query=\"Who is the sister of Sansa?\", params={\"Reader\": {\"top_k\": 5}})" ] }, { @@ -425,4 +427,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} \ No newline at end of file +}