haystack-tutorials

Форк
0
/
33_Hybrid_Retrieval.ipynb 
1288 строк · 55.4 Кб
1
{
2
 "cells": [
3
  {
4
   "cell_type": "markdown",
5
   "metadata": {
6
    "id": "kTas9ZQ7lXP7"
7
   },
8
   "source": [
9
    "# Tutorial: Creating a Hybrid Retrieval Pipeline\n",
10
    "\n",
11
    "- **Level**: Intermediate\n",
12
    "- **Time to complete**: 15 minutes\n",
13
    "- **Components Used**: [`DocumentSplitter`](https://docs.haystack.deepset.ai/v2.0/docs/documentsplitter), [`SentenceTransformersDocumentEmbedder`](https://docs.haystack.deepset.ai/v2.0/docs/sentencetransformersdocumentembedder), [`DocumentJoiner`](https://docs.haystack.deepset.ai/v2.0/docs/documentjoiner), [`InMemoryDocumentStore`](https://docs.haystack.deepset.ai/v2.0/docs/inmemorydocumentstore), [`InMemoryBM25Retriever`](https://docs.haystack.deepset.ai/v2.0/docs/inmemorybm25retriever), [`InMemoryEmbeddingRetriever`](https://docs.haystack.deepset.ai/v2.0/docs/inmemoryembeddingretriever), and [`TransformersSimilarityRanker`](https://docs.haystack.deepset.ai/v2.0/docs/transformerssimilarityranker)\n",
14
    "- **Prerequisites**: None\n",
15
    "- **Goal**: After completing this tutorial, you will have learned about creating a hybrid retrieval and when it's useful.\n",
16
    "\n",
17
    "> This tutorial uses Haystack 2.0 Beta. To learn more, read the [Haystack 2.0 Beta announcement](https://haystack.deepset.ai/blog/introducing-haystack-2-beta-and-advent) or visit [Haystack 2.0 Documentation](https://docs.haystack.deepset.ai/v2.0/docs)."
18
   ]
19
  },
20
  {
21
   "cell_type": "markdown",
22
   "metadata": {
23
    "id": "0hw_zoKolXQL"
24
   },
25
   "source": [
26
    "## Overview\n",
27
    "\n",
28
    "**Hybrid Retrieval** combines keyword-based and embedding-based retrieval techniques, leveraging the strengths of both approaches. In essence, dense embeddings excel in grasping the contextual nuances of the query, while keyword-based methods excel in matching keywords.\n",
29
    "\n",
30
    "There are many cases when a simple keyword-based approaches like BM25 performs better than a dense retrieval (for example in a specific domain like healthcare) because a dense model needs to be trained on data. For more details about Hybrid Retrieval, check out [Blog Post: Hybrid Document Retrieval](https://haystack.deepset.ai/blog/hybrid-retrieval)."
31
   ]
32
  },
33
  {
34
   "cell_type": "markdown",
35
   "metadata": {
36
    "id": "ITs3WTT5lXQT"
37
   },
38
   "source": [
39
    "## Preparing the Colab Environment\n",
40
    "\n",
41
    "- [Enable GPU Runtime in Colab](https://docs.haystack.deepset.ai/v2.0/docs/enabling-gpu-acceleration)\n",
42
    "- [Set logging level to INFO](https://docs.haystack.deepset.ai/v2.0/docs/setting-the-log-level)"
43
   ]
44
  },
45
  {
46
   "cell_type": "markdown",
47
   "metadata": {
48
    "id": "2g9fhjxDlXQb"
49
   },
50
   "source": [
51
    "## Installing Haystack\n",
52
    "\n",
53
    "Install Haystack 2.0 Beta and other required packages with `pip`:"
54
   ]
55
  },
56
  {
57
   "cell_type": "code",
58
   "execution_count": null,
59
   "metadata": {
60
    "id": "L40ZxZW8lXQh"
61
   },
62
   "outputs": [],
63
   "source": [
64
    "%%bash\n",
65
    "\n",
66
    "pip install haystack-ai\n",
67
    "pip install \"datasets>=2.6.1\"\n",
68
    "pip install \"sentence-transformers>=2.2.0\"\n",
69
    "pip install accelerate"
70
   ]
71
  },
72
  {
73
   "cell_type": "markdown",
74
   "metadata": {
75
    "id": "CJBcPNbBlXQq"
76
   },
77
   "source": [
78
    "### Enabling Telemetry\n",
79
    "\n",
80
    "Knowing you're using this tutorial helps us decide where to invest our efforts to build a better product but you can always opt out by commenting the following line. See [Telemetry](https://docs.haystack.deepset.ai/v2.0/docs/telemetry) for more details."
81
   ]
82
  },
83
  {
84
   "cell_type": "code",
85
   "execution_count": null,
86
   "metadata": {
87
    "id": "lUbTGVo4lXQv"
88
   },
89
   "outputs": [],
90
   "source": [
91
    "from haystack.telemetry import tutorial_running\n",
92
    "\n",
93
    "tutorial_running(33)"
94
   ]
95
  },
96
  {
97
   "cell_type": "markdown",
98
   "metadata": {
99
    "id": "usdANiAGlXQ9"
100
   },
101
   "source": [
102
    "## Initializing the DocumentStore\n",
103
    "\n",
104
    "You'll start creating your question answering system by initializing a DocumentStore. A DocumentStore stores the Documents that your system uses to find answers to your questions. In this tutorial, you'll be using the [`InMemoryDocumentStore`](https://docs.haystack.deepset.ai/v2.0/docs/inmemorydocumentstore)."
105
   ]
106
  },
107
  {
108
   "cell_type": "code",
109
   "execution_count": 5,
110
   "metadata": {
111
    "id": "cLbh-UtelXRL"
112
   },
113
   "outputs": [],
114
   "source": [
115
    "from haystack.document_stores.in_memory import InMemoryDocumentStore\n",
116
    "\n",
117
    "document_store = InMemoryDocumentStore()"
118
   ]
119
  },
120
  {
121
   "cell_type": "markdown",
122
   "metadata": {
123
    "id": "GZWBHcc8TKcv"
124
   },
125
   "source": [
126
    "> `InMemoryDocumentStore` is the simplest DocumentStore to get started with. It requires no external dependencies and it's a good option for smaller projects and debugging. But it doesn't scale up so well to larger Document collections, so it's not a good choice for production systems. To learn more about the different types of external databases that Haystack supports, see [DocumentStore Integrations](https://haystack.deepset.ai/integrations?type=Document+Store&version=2.0)."
127
   ]
128
  },
129
  {
130
   "cell_type": "markdown",
131
   "metadata": {
132
    "id": "0rk8fdMzTb-I"
133
   },
134
   "source": [
135
    "## Fetching and Processing Documents\n",
136
    "\n",
137
    "As Documents, you will use the PubMed Abstracts. There are a lot of datasets from PubMed on Hugging Face Hub; you will use [anakin87/medrag-pubmed-chunk](https://huggingface.co/datasets/anakin87/medrag-pubmed-chunk) in this tutorial.\n",
138
    "\n",
139
    "Then, you will create Documents from the dataset with a simple for loop.\n",
140
    "Each data point in the PubMed dataset has 4 features:\n",
141
    "* *pmid*\n",
142
    "* *title*\n",
143
    "* *content*: the abstract\n",
144
    "* *contents*: abstract + title\n",
145
    "\n",
146
    "For searching, you will use the *contents* feature. The other features will be stored as metadata, and you will use them to have a **pretty print** of the search results or for [metadata filtering](https://docs.haystack.deepset.ai/v2.0/docs/metadata-filtering)."
147
   ]
148
  },
149
  {
150
   "cell_type": "code",
151
   "execution_count": null,
152
   "metadata": {
153
    "id": "RvrG_QzirSsq"
154
   },
155
   "outputs": [],
156
   "source": [
157
    "from datasets import load_dataset\n",
158
    "from haystack import Document\n",
159
    "\n",
160
    "dataset = load_dataset(\"anakin87/medrag-pubmed-chunk\", split=\"train\")\n",
161
    "\n",
162
    "docs = []\n",
163
    "for doc in dataset:\n",
164
    "    docs.append(\n",
165
    "        Document(content=doc[\"contents\"], meta={\"title\": doc[\"title\"], \"abstract\": doc[\"content\"], \"pmid\": doc[\"id\"]})\n",
166
    "    )"
167
   ]
168
  },
169
  {
170
   "cell_type": "markdown",
171
   "metadata": {
172
    "id": "XPngNEs5q8Tw"
173
   },
174
   "source": [
175
    "## Indexing Documents with a Pipeline\n",
176
    "\n",
177
    "Create a pipeline to store the data in the document store with their embedding. For this pipeline, you need a [DocumentSplitter](https://docs.haystack.deepset.ai/v2.0/docs/documentsplitter) to split documents into chunks of 512 words, [SentenceTransformersDocumentEmbedder](https://docs.haystack.deepset.ai/v2.0/docs/sentencetransformersdocumentembedder) to create document embeddings for dense retrieval and [DocumentWriter](https://docs.haystack.deepset.ai/v2.0/docs/documentwriter) to write documents to the document store.\n",
178
    "\n",
179
    "As an embedding model, you will use [BAAI/bge-small-en-v1.5](https://huggingface.co/BAAI/bge-small-en-v1.5) on Hugging Face. Feel free to test other models on Hugging Face or use another [Embedder](https://docs.haystack.deepset.ai/v2.0/docs/embedders) to switch the model provider.\n",
180
    "\n",
181
    "> If this step takes too long for you, replace the embedding model with a smaller model such as `sentence-transformers/all-MiniLM-L6-v2` or `sentence-transformers/all-mpnet-base-v2`. Make sure that the `split_length` is updated according to your model's token limit."
182
   ]
183
  },
184
  {
185
   "cell_type": "code",
186
   "execution_count": null,
187
   "metadata": {
188
    "id": "RrIN83JNCHhX"
189
   },
190
   "outputs": [],
191
   "source": [
192
    "from haystack.components.writers import DocumentWriter\n",
193
    "from haystack.components.embedders import SentenceTransformersDocumentEmbedder\n",
194
    "from haystack.components.preprocessors.document_splitter import DocumentSplitter\n",
195
    "from haystack import Pipeline\n",
196
    "from haystack.utils import ComponentDevice\n",
197
    "\n",
198
    "document_splitter = DocumentSplitter(split_by=\"word\", split_length=512, split_overlap=32)\n",
199
    "document_embedder = SentenceTransformersDocumentEmbedder(\n",
200
    "    model=\"BAAI/bge-small-en-v1.5\", device=ComponentDevice.from_str(\"cuda:0\")\n",
201
    ")\n",
202
    "document_writer = DocumentWriter(document_store)\n",
203
    "\n",
204
    "indexing_pipeline = Pipeline()\n",
205
    "indexing_pipeline.add_component(\"document_splitter\", document_splitter)\n",
206
    "indexing_pipeline.add_component(\"document_embedder\", document_embedder)\n",
207
    "indexing_pipeline.add_component(\"document_writer\", document_writer)\n",
208
    "\n",
209
    "indexing_pipeline.connect(\"document_splitter\", \"document_embedder\")\n",
210
    "indexing_pipeline.connect(\"document_embedder\", \"document_writer\")\n",
211
    "\n",
212
    "indexing_pipeline.run({\"document_splitter\": {\"documents\": docs}})"
213
   ]
214
  },
215
  {
216
   "cell_type": "markdown",
217
   "metadata": {
218
    "id": "wSJlHxrhgQby"
219
   },
220
   "source": [
221
    "Documents are stored in `InMemoryDocumentStore` with their embeddings, now it's time for creating the hybrid retrieval pipeline ✅"
222
   ]
223
  },
224
  {
225
   "cell_type": "markdown",
226
   "metadata": {
227
    "id": "UgMgY-d9najg"
228
   },
229
   "source": [
230
    "## Creating a Pipeline for Hybrid Retrieval\n",
231
    "\n",
232
    "Hybrid retrieval refers to the combination of multiple retrieval methods to enhance overall performance. In the context of search systems, a hybrid retrieval pipeline executes both traditional keyword-based search and dense vector search, later ranking the results with a cross-encoder model. This combination allows the search system to leverage the strengths of different approaches, providing more accurate and diverse results.\n",
233
    "\n",
234
    "Here are the required steps for a hybrid retrieval pipeline:"
235
   ]
236
  },
237
  {
238
   "cell_type": "markdown",
239
   "metadata": {
240
    "id": "Ha8pNmnvqj4n"
241
   },
242
   "source": [
243
    "### 1) Initialize Retrievers and the Embedder\n",
244
    "\n",
245
    "Initialize a [InMemoryEmbeddingRetriever](https://docs.haystack.deepset.ai/v2.0/docs/inmemoryembeddingretriever) and [InMemoryBM25Retriever](https://docs.haystack.deepset.ai/v2.0/docs/inmemorybm25retriever) to perform both dense and keyword-based retrieval. For dense retrieval, you also need a [SentenceTransformersTextEmbedder](https://docs.haystack.deepset.ai/v2.0/docs/sentencetransformerstextembedder) that computes the embedding of the search query by using the same embedding model `BAAI/bge-small-en-v1.5` that was used in the indexing pipeline:"
246
   ]
247
  },
248
  {
249
   "cell_type": "code",
250
   "execution_count": 7,
251
   "metadata": {
252
    "id": "DVfQvnWYrMWr"
253
   },
254
   "outputs": [],
255
   "source": [
256
    "from haystack.components.retrievers.in_memory import InMemoryBM25Retriever, InMemoryEmbeddingRetriever\n",
257
    "from haystack.components.embedders import SentenceTransformersTextEmbedder\n",
258
    "\n",
259
    "text_embedder = SentenceTransformersTextEmbedder(\n",
260
    "    model=\"BAAI/bge-small-en-v1.5\", device=ComponentDevice.from_str(\"cuda:0\")\n",
261
    ")\n",
262
    "embedding_retriever = InMemoryEmbeddingRetriever(document_store)\n",
263
    "bm25_retriever = InMemoryBM25Retriever(document_store)"
264
   ]
265
  },
266
  {
267
   "cell_type": "markdown",
268
   "metadata": {
269
    "id": "FC81c8RBrRFf"
270
   },
271
   "source": [
272
    "### 2) Join Retrieval Results\n",
273
    "\n",
274
    "Haystack offers several joining methods in [`DocumentJoiner`](https://docs.haystack.deepset.ai/v2.0/docs/documentjoiner) to be used for different use cases such as `merge` and `reciprocal_rank_fusion`. In this example, you will use the default `concatenate` mode to join the documents coming from two Retrievers as the [Ranker](https://docs.haystack.deepset.ai/v2.0/docs/rankers) will be the main component to rank the documents for relevancy."
275
   ]
276
  },
277
  {
278
   "cell_type": "code",
279
   "execution_count": 8,
280
   "metadata": {
281
    "id": "GYso6_8BrhY8"
282
   },
283
   "outputs": [],
284
   "source": [
285
    "from haystack.components.joiners import DocumentJoiner\n",
286
    "\n",
287
    "document_joiner = DocumentJoiner()"
288
   ]
289
  },
290
  {
291
   "cell_type": "markdown",
292
   "metadata": {
293
    "id": "r8_jHzmosbC_"
294
   },
295
   "source": [
296
    "### 3) Rank the Results\n",
297
    "\n",
298
    "Use the [TransformersSimilarityRanker](https://docs.haystack.deepset.ai/v2.0/docs/transformerssimilarityranker) that scores the relevancy of all retrieved documents for the given search query by using a cross encoder model. In this example, you will use [BAAI/bge-reranker-base](https://huggingface.co/BAAI/bge-reranker-base) model to rank the retrieved documents but you can replace this model with other cross-encoder models on Hugging Face."
299
   ]
300
  },
301
  {
302
   "cell_type": "code",
303
   "execution_count": 9,
304
   "metadata": {
305
    "id": "cN0woIxHs4Ng"
306
   },
307
   "outputs": [],
308
   "source": [
309
    "from haystack.components.rankers import TransformersSimilarityRanker\n",
310
    "\n",
311
    "ranker = TransformersSimilarityRanker(model=\"BAAI/bge-reranker-base\")"
312
   ]
313
  },
314
  {
315
   "cell_type": "markdown",
316
   "metadata": {
317
    "id": "Y5jzzvUIstQ4"
318
   },
319
   "source": [
320
    "### 4) Create the Hybrid Retrieval Pipeline\n",
321
    "\n",
322
    "Add all initialized components to your pipeline and connect them."
323
   ]
324
  },
325
  {
326
   "cell_type": "code",
327
   "execution_count": 10,
328
   "metadata": {
329
    "id": "y9sKO2Azjrsh"
330
   },
331
   "outputs": [],
332
   "source": [
333
    "from haystack import Pipeline\n",
334
    "\n",
335
    "hybrid_retrieval = Pipeline()\n",
336
    "hybrid_retrieval.add_component(\"text_embedder\", text_embedder)\n",
337
    "hybrid_retrieval.add_component(\"embedding_retriever\", embedding_retriever)\n",
338
    "hybrid_retrieval.add_component(\"bm25_retriever\", bm25_retriever)\n",
339
    "hybrid_retrieval.add_component(\"document_joiner\", document_joiner)\n",
340
    "hybrid_retrieval.add_component(\"ranker\", ranker)\n",
341
    "\n",
342
    "hybrid_retrieval.connect(\"text_embedder\", \"embedding_retriever\")\n",
343
    "hybrid_retrieval.connect(\"bm25_retriever\", \"document_joiner\")\n",
344
    "hybrid_retrieval.connect(\"embedding_retriever\", \"document_joiner\")\n",
345
    "hybrid_retrieval.connect(\"document_joiner\", \"ranker\")"
346
   ]
347
  },
348
  {
349
   "cell_type": "markdown",
350
   "metadata": {
351
    "id": "ii9x0gr9lXRT"
352
   },
353
   "source": [
354
    "### 5) Visualize the Pipeline (Optional)\n",
355
    "\n",
356
    "To understand how you formed a hybrid retrieval pipeline, use [draw()](https://docs.haystack.deepset.ai/v2.0/docs/drawing-pipeline-graphs) method of the pipeline. If you're running this notebook on Google Colab, the generate file will be saved in \"Files\" section on the sidebar."
357
   ]
358
  },
359
  {
360
   "cell_type": "code",
361
   "execution_count": 11,
362
   "metadata": {
363
    "id": "rXHbHru0lXRY"
364
   },
365
   "outputs": [],
366
   "source": [
367
    "hybrid_retrieval.draw(\"hybrid-retrieval.png\")"
368
   ]
369
  },
370
  {
371
   "cell_type": "markdown",
372
   "metadata": {
373
    "id": "eIYV19l16PKC"
374
   },
375
   "source": [
376
    "## Testing the Hybrid Retrieval\n",
377
    "\n",
378
    "Pass the query to `text_embedder`, `bm25_retriever` and `ranker` and run the retrieval pipeline:\n"
379
   ]
380
  },
381
  {
382
   "cell_type": "code",
383
   "execution_count": 13,
384
   "metadata": {
385
    "colab": {
386
     "base_uri": "https://localhost:8080/",
387
     "height": 81,
388
     "referenced_widgets": [
389
      "cf62bf3b3c6144629811874114dc527f",
390
      "0387b8e4546247f49f854f9729e6a3df",
391
      "d45dcf1e27a5401ca2c430cd6c322fdb",
392
      "864e853846b3406a9a8b743dbc1d96ff",
393
      "15f3697b990f40adb795dbcce3f626c1",
394
      "cf972cbfa1314f149b9860e199391170",
395
      "06c4d38f14674fd898aa85df17c0baa7",
396
      "a4d87d3d4a9a4dc4bccdc4a16be29096",
397
      "2398002062874506a558e59114359c54",
398
      "947922d2f75346cdbbb908d3888f832e",
399
      "c7a118b1f8a2491cacd5f76db668443e",
400
      "b395830b097f4862a6c8588ccd0fd91b",
401
      "4b9ea215e11844239e968960cd45cade",
402
      "097a7751c1b04aa3bf4a0a586a6dfa32",
403
      "9e5e169b22dd45068a2b03154b26ccf0",
404
      "827efd14f6f74c8ca0fb8df3a4359062",
405
      "2a7323e821724b129d01de39adb67c4f",
406
      "eeb568b15a1d465bab9f7a3843d611df",
407
      "c1626ca2ebf84556a692e76f16f3cab4",
408
      "5cd3d66281d247749d4c71daa7c6f49d",
409
      "107daf1c8f8f4203aff8058191ce9728",
410
      "31acc8ba63e240a6b4419ab4aa51c87a"
411
     ]
412
    },
413
    "id": "glS0-Xh3nLHY",
414
    "outputId": "eae6ba6e-136e-48a1-bfe3-3a97fcebca7c"
415
   },
416
   "outputs": [
417
    {
418
     "data": {
419
      "application/vnd.jupyter.widget-view+json": {
420
       "model_id": "cf62bf3b3c6144629811874114dc527f",
421
       "version_major": 2,
422
       "version_minor": 0
423
      },
424
      "text/plain": [
425
       "Batches:   0%|          | 0/1 [00:00<?, ?it/s]"
426
      ]
427
     },
428
     "metadata": {},
429
     "output_type": "display_data"
430
    },
431
    {
432
     "data": {
433
      "application/vnd.jupyter.widget-view+json": {
434
       "model_id": "b395830b097f4862a6c8588ccd0fd91b",
435
       "version_major": 2,
436
       "version_minor": 0
437
      },
438
      "text/plain": [
439
       "Ranking by BM25...:   0%|          | 0/37807 [00:00<?, ? docs/s]"
440
      ]
441
     },
442
     "metadata": {},
443
     "output_type": "display_data"
444
    }
445
   ],
446
   "source": [
447
    "query = \"apnea in infants\"\n",
448
    "\n",
449
    "result = hybrid_retrieval.run(\n",
450
    "    {\"text_embedder\": {\"text\": query}, \"bm25_retriever\": {\"query\": query}, \"ranker\": {\"query\": query}}\n",
451
    ")"
452
   ]
453
  },
454
  {
455
   "cell_type": "markdown",
456
   "metadata": {
457
    "id": "WvPv1cJ6gbBJ"
458
   },
459
   "source": [
460
    "### Pretty Print the Results\n",
461
    "Create a function to print a kind of *search page*."
462
   ]
463
  },
464
  {
465
   "cell_type": "code",
466
   "execution_count": 14,
467
   "metadata": {
468
    "id": "raL_z_sByDoQ"
469
   },
470
   "outputs": [],
471
   "source": [
472
    "def pretty_print_results(prediction):\n",
473
    "    for doc in prediction[\"documents\"]:\n",
474
    "        print(doc.meta[\"title\"], \"\\t\", doc.score)\n",
475
    "        print(doc.meta[\"abstract\"])\n",
476
    "        print(\"\\n\", \"\\n\")"
477
   ]
478
  },
479
  {
480
   "cell_type": "code",
481
   "execution_count": 15,
482
   "metadata": {
483
    "colab": {
484
     "base_uri": "https://localhost:8080/"
485
    },
486
    "id": "mSUiizGNytwX",
487
    "outputId": "38e05986-1737-4c2b-bc08-7399299de37f"
488
   },
489
   "outputs": [
490
    {
491
     "name": "stdout",
492
     "output_type": "stream",
493
     "text": [
494
      "State-of-the-Art HIV Management:An Update. \t 0.9928585290908813\n",
495
      "Within the past 3 years, dramatic changes have taken place in the standard of care for HIV patients. Despite improvements in care (with decreased mortality), the rate of new infections remains unchanged if not increased within most at-risk groups. This general overview is intended for the physician who, while not providing ongoing HIV care, desires an update on the major treatment issues. Current demographic trends, new methods available for testing, and the use of the viral load test for both staging and gauging response to the new combination antiretroviral treatment regimens are detailed. It is suggested that physicians consult with an experienced HIV clinician before starting a treatment regimen in the newly diagnosed patient.The primary HIV syndrome is reviewed in detail since this diagnosis is often missed and an opportunity for early intervention is lost. Physicians not providing ongoing HIV care must be comfortable making this diagnosis and doing an initial work-up. Focused prevention especially tailored to younger high-risk patients is reviewed. Treatment protocols (with an emphasis on new antiretrovirals), gauging success of treatment, and the management of treatment failures are reviewed in detail. Common antiretroviral drugs are listed with side effects, drug interactions, and average monthly costs. Care of pregnant patients and exposed healthcare workers is also briefly discussed. The need for more primary care-based prevention is also discussed.\n",
496
      "\n",
497
      " \n",
498
      "\n",
499
      "Management of tuberculosis in HIV-infected patients. \t 0.9715766310691833\n",
500
      "HIV-tuberculosis coinfection is currently one of the greatest health threats, affecting millions of people worldwide, with high morbidity and mortality. Treating both infections can be a challenge and requires some expertise due to multidirectional drug interactions, risk of overlapping side effects, high pill burden and risk of immune reconstitution inflammatory syndrome. This article reviews the general management of tuberculosis/HIV coinfection, focusing on the optimal time to start antiretroviral therapy and which treatments can be safely used. The randomized clinical trials designed to answer the question of when to start antiretroviral therapy (SAPIT, CAMELIA, STRIDE and TIME), published in the last two years, are described and discussed in detail. Summarizing these trials' conclusions, antiretroviral therapy should be started within two weeks of starting tuberculosis treatment if the patient has less than 50 CD4/mm3 and wait to the end of the induction phase (8-12 weeks after starting tuberculosis treatment) if higher CD4 cell counts exist. Treatment options for both tuberculosis and HIV, including the newer available drugs and those in clinical trials, are revised and recommendations for dose adjustments are made based on the latest available literature, with special attention to drug-drug interactions and the necessity of dose adjustments with some drug combinations.\n",
501
      "\n",
502
      " \n",
503
      "\n",
504
      "Why CCR5 is chosen as the target for stem cell gene therapy for HIV infection? \t 0.9700931310653687\n",
505
      "Since the first case reported in 1981, more than 60 million individuals have succumbed to HIV worldwide. Although great efforts have been put forth in developing therapeutic drugs and effective vaccines for the treatment and prevention of HIV infection, these efforts are not correlated to the reported case of cured HIV infection. The first case of cured HIV infection, from allogenic stem cell transplantation, may shed light on future prevention and therapy of HIV infection. The choice of gene target, however, must first be evaluated regarding stem cell based gene therapy for HIV infection. Out of the tens of genes that had shown anti-HIV infection potentials, CCR5 was described to be effective in stem cell based gene therapy in 2005. Here, we appreciate the clinical observations that directly led to the choice of CCR5, rather than other genes for stem cell gene therapy.\n",
506
      "\n",
507
      " \n",
508
      "\n",
509
      "Antiretroviral medication and HIV prevention: new steps forward and new questions. \t 0.9534240365028381\n",
510
      "During the past 2 years, several pivotal clinical trials have proven that the use of antiretrovirals by HIV-infected and at-risk uninfected persons can decrease the probability of HIV being transmitted sexually. The initial chemoprophylaxis studies evaluated tenofovir administered topically or orally (with or without emtricitabine). However, several questions remain. Some subsequent primary prevention studies did not replicate the results of the initial studies, raising questions about differences in the behaviors of participants in each study (in particular about medication adherence), as well as whether pharmacologic or local mucosal factors might explain the variable efficacy estimates. Other antiretrovirals and delivery systems are being evaluated to maximize the efficacy of primary chemoprophylactic approaches. At present, increasing access to antiretroviral treatment globally is a priority, because expanding access to medication that can prevent morbidity and mortality is itself an important public health goal and may reasonably be expected to decrease HIV incidence. However, for treatment as prevention to be maximally effective, increases in HIV testing, health care workers, and infrastructure are needed, in addition to medications and laboratory support for clinical monitoring. A combination of approaches is needed to most quickly decrease the current trends in HIV incidence, including early diagnosis and initiation of treatment for HIV-infected persons. These approaches can be coupled with appropriately tailored interventions for populations at greatest risk for infection (for example, men who have sex with men and sex workers), including male circumcision, behavioral interventions, and chemoprophylaxis. However, a substantial gap exists between current expenditures and unmet needs, which suggests that mobilization of political will is needed for this combination approach to be successful.\n",
511
      "\n",
512
      " \n",
513
      "\n",
514
      "Challenges of HIV treatment in resource-poor countries: a review. \t 0.9427611827850342\n",
515
      "The human immunodeficiency virus/acquired immunodeficiency syndrome pandemic have posed a significant public health challenge to the global community. Massive therapeutic interventions with antiretroviral drugs are being undertaken, yet problems and challenges exist. This review examines these problems and challenges as they affect the treatment of HIV infection in resource-poor countries such as Nigeria. The information was sourced from relevant literature using human immunodeficiency virus/acquired immunodeficiency syndrome journals, textbooks and Websites on human immunodeficiency virus/acquired immunodeficiency syndrome, highly active antiretroviral therapy, resource-poor countries as key words. Several studies have shown that the advent of highly active antiretroviral therapy in 1996 has significantly reduced morbidity and mortality among people living with HIV/AIDS (PLWHA). But in resource-poor countries, initiation and maintenance of highly active antiretroviral therapy has been associated with many challenges and problems such as: poor infrastructural base for the control programs; irregular or non availability of drugs; poor drug adherence; co-morbidities and opportunistic infections/malignancies; drug toxicities; drug/food and drug/drug interactions; laboratory monitoring of viral load; CD4 cell counts; full blood counts; electrolytes, kidney and liver functions. The review has shown that the solution to the pandemic lies in a multi-sectoral and holistic approach involving International and local agencies, and communities.\n",
516
      "\n",
517
      " \n",
518
      "\n",
519
      "Current progress and challenges in HIV gene therapy. \t 0.9385221600532532\n",
520
      "HIV-1 causes AIDS, a syndrome that affects millions of people globally. Existing HAART is efficient in slowing down disease progression but cannot eradicate the virus. Furthermore the severity of the side effects and the emergence of drug-resistant mutants call for better therapy. Gene therapy serves as an attractive alternative as it reconstitutes the immune system with HIV-resistant cells and could thereby provide a potential cure. The feasibility of this approach was first demonstrated with the 'Berlin patient', who was functionally cured from HIV/AIDS with undetectable HIV-1 viral load after transplantation of bone marrow harboring a naturally occurring CCR5 mutation that blocks viral entry. Here, we give an overview of the current status of HIV gene therapy and remaining challenges and obstacles.\n",
521
      "\n",
522
      " \n",
523
      "\n",
524
      "Newer drugs and earlier treatment: impact on lifetime cost of care for HIV-infected adults. \t 0.9286227822303772\n",
525
      "To determine the component costs of care to optimize treatment with limited resources. We used the Cost-Effectiveness of Preventing AIDS Complications Model of HIV disease and treatment to project life expectancy and both undiscounted and discounted lifetime costs (2010 €). We determined medical resource utilization among HIV-infected adults followed from 1998 to 2005 in northern France. Monthly HIV costs were stratified by CD4 cell count. Costs of CD4, HIV RNA and genotype tests and antiretroviral therapy (ART) were derived from published literature. Model inputs from national data included mean age 38 years, mean initial CD4 cell count 372 cells/μl, ART initiation at CD4 cell counts less than 350 cells/μl, and ART regimen costs ranging from €760 to 2570 per month. The model projected a mean undiscounted life expectancy of 26.5 years and a lifetime undiscounted cost of €535,000/patient (€320,700 discounted); 73% of costs were ART related. When patients presented to care with mean CD4 cell counts of 510 cells/μl and initiated ART at CD4 cell counts less than 500 cells/μl or HIV RNA more than 100,000 copies/ml, life expectancy was 27.4 years and costs increased 1-2%, to €546,700 (€324,500 discounted). When we assumed introducing generic drugs would result in a 50% decline in first-line ART costs, lifetime costs decreased 4-6%, to €514,200 (€302 ,800 discounted). As HIV disease is treated earlier with more efficacious drugs, survival and thus costs of care will continue to increase. The availability in high-income countries of widely used antiretroviral drugs in generic form could reduce these costs.\n",
526
      "\n",
527
      " \n",
528
      "\n",
529
      "Common clinical problems in children living with HIV/AIDS: systemic approach. \t 0.9138649106025696\n",
530
      "Clinical manifestations in children living with HIV/ AIDS differ from those in adults due to poorly developed immunity that allows greater dissemination throughout various organs. In developing countries, HIV-infected children have an increased frequency of malnutrition and common childhood infections such as ear infections, pneumonias, gastroenteritis and tuberculosis. The symptoms common to many treatable conditions, such as recurrent fever, diarrhea and generalized dermatitis, tend to be more persistent and severe and often do not respond as well to treatment. The use of Anti Retroviral Therapy (ART) has greatly increased the long term survival of perinatally infected children so that AIDS is becoming a manageable chronic illness. As the immunity is maintained, the incidence of infectious complications is declining while noninfectious complications of HIV are more frequently encountered. Regular clinical monitoring with immunological and virological monitoring and the introduction of genotypic and phenotypic resistance testing where resources are available have allowed for dramatically better clinical outcomes. However, these growing children are left facing the challenges of lifelong adherence with complex treatment regimens, compounded by complex psycho-social, mental and neuro-cognitive issues. These unique challenges must be recognized and understood in order to provide appropriate medical management.\n",
531
      "\n",
532
      " \n",
533
      "\n",
534
      "Barriers and facilitators of adherence to TB treatment in patients on concomitant TB and HIV treatment: a qualitative study. \t 0.9002022743225098\n",
535
      "Tuberculosis is a major public health problem in Ethiopia, and a high number of TB patients are co-infected with HIV. There is a need for more knowledge about factors influencing treatment adherence in co-infected patients on concomitant treatment. The aim of the present study is to explore patients' and health care professionals' views about barriers and facilitators to TB treatment adherence in TB/HIV co-infected patients on concomitant treatment for TB and HIV. Qualitative study using in-depth interviews with 15 TB/HIV co-infected patients and 9 health professionals and focus group discussions with 14 co-infected patients. We found that interplay of factors is involved in the decision making about medication intake. Factors that influenced adherence to TB treatment positively were beliefs in the curability of TB, beliefs in the severity of TB in the presence of HIV infection and support from families and health professionals. Barriers to treatment adherence were experiencing side effects, pill burden, economic constraints, lack of food, stigma with lack of disclosure, and lack of adequate communication with health professionals. Health professionals and policy makers should be aware of factors influencing TB treatment in TB/HIV co-infected patients on concomitant treatment for TB and HIV. Our results suggest that provision of food and minimal financial support might facilitate adherence. Counseling might also facilitate adherence, in particular for those who start ART in the early phases of TB treatment, and beliefs related to side-effects and pill burden should be addressed. Information to the public may reduce TB and HIV related stigma.\n",
536
      "\n",
537
      " \n",
538
      "\n",
539
      "Combination implementation for HIV prevention: moving from clinical trial evidence to population-level effects. \t 0.8731147646903992\n",
540
      "The promise of combination HIV prevention-the application of multiple HIV prevention interventions to maximise population-level effects-has never been greater. However, to succeed in achieving significant reductions in HIV incidence, an additional concept needs to be considered: combination implementation. Combination implementation for HIV prevention is the pragmatic, localised application of evidence-based strategies to enable high sustained uptake and quality of interventions for prevention of HIV. In this Review, we explore diverse implementation strategies including HIV testing and counselling models, task shifting, linkage to and retention in care, antiretroviral therapy support, behaviour change, demand creation, and structural interventions, and discusses how they could be used to complement HIV prevention efforts such as medical male circumcision and treatment as prevention. HIV prevention and treatment have arrived at a pivotal moment when combination efforts might result in substantial enough population-level effects to reverse the epidemic and drive towards elimination of HIV. Only through careful consideration of how to implement and operationalise HIV prevention interventions will the HIV community be able to move from clinical trial evidence to population-level effects.\n",
541
      "\n",
542
      " \n",
543
      "\n"
544
     ]
545
    }
546
   ],
547
   "source": [
548
    "pretty_print_results(result[\"ranker\"])"
549
   ]
550
  },
551
  {
552
   "cell_type": "markdown",
553
   "metadata": {
554
    "id": "HZ5_NJDz52VE"
555
   },
556
   "source": [
557
    "## What's next\n",
558
    "\n",
559
    "🎉 Congratulations! You've create a hybrid retrieval pipeline!\n",
560
    "\n",
561
    "If you'd like to use this retrieval method in a RAG pipeline, check out [Tutorial: Creating Your First QA Pipeline with Retrieval-Augmentation](https://haystack.deepset.ai/tutorials/27_first_rag_pipeline) to learn about the next steps.\n",
562
    "\n",
563
    "To stay up to date on the latest Haystack developments, you can [sign up for our newsletter](https://landing.deepset.ai/haystack-community-updates?utm_campaign=developer-relations&utm_source=tutorial&utm_medium=hybrid-retrieval) or [join Haystack discord community](https://discord.gg/haystack).\n",
564
    "\n",
565
    "Thanks for reading!"
566
   ]
567
  }
568
 ],
569
 "metadata": {
570
  "accelerator": "GPU",
571
  "colab": {
572
   "gpuType": "T4",
573
   "provenance": []
574
  },
575
  "kernelspec": {
576
   "display_name": "Python 3",
577
   "name": "python3"
578
  },
579
  "language_info": {
580
   "codemirror_mode": {
581
    "name": "ipython",
582
    "version": 3
583
   },
584
   "file_extension": ".py",
585
   "mimetype": "text/x-python",
586
   "name": "python",
587
   "nbconvert_exporter": "python",
588
   "pygments_lexer": "ipython3",
589
   "version": "3.11.4"
590
  },
591
  "orig_nbformat": 4,
592
  "vscode": {
593
   "interpreter": {
594
    "hash": "31f2aee4e71d21fbe5cf8b01ff0e069b9275f58929596ceb00d14d90e3e16cd6"
595
   }
596
  },
597
  "widgets": {
598
   "application/vnd.jupyter.widget-state+json": {
599
    "0387b8e4546247f49f854f9729e6a3df": {
600
     "model_module": "@jupyter-widgets/controls",
601
     "model_module_version": "1.5.0",
602
     "model_name": "HTMLModel",
603
     "state": {
604
      "_dom_classes": [],
605
      "_model_module": "@jupyter-widgets/controls",
606
      "_model_module_version": "1.5.0",
607
      "_model_name": "HTMLModel",
608
      "_view_count": null,
609
      "_view_module": "@jupyter-widgets/controls",
610
      "_view_module_version": "1.5.0",
611
      "_view_name": "HTMLView",
612
      "description": "",
613
      "description_tooltip": null,
614
      "layout": "IPY_MODEL_cf972cbfa1314f149b9860e199391170",
615
      "placeholder": "​",
616
      "style": "IPY_MODEL_06c4d38f14674fd898aa85df17c0baa7",
617
      "value": "Batches: 100%"
618
     }
619
    },
620
    "06c4d38f14674fd898aa85df17c0baa7": {
621
     "model_module": "@jupyter-widgets/controls",
622
     "model_module_version": "1.5.0",
623
     "model_name": "DescriptionStyleModel",
624
     "state": {
625
      "_model_module": "@jupyter-widgets/controls",
626
      "_model_module_version": "1.5.0",
627
      "_model_name": "DescriptionStyleModel",
628
      "_view_count": null,
629
      "_view_module": "@jupyter-widgets/base",
630
      "_view_module_version": "1.2.0",
631
      "_view_name": "StyleView",
632
      "description_width": ""
633
     }
634
    },
635
    "097a7751c1b04aa3bf4a0a586a6dfa32": {
636
     "model_module": "@jupyter-widgets/controls",
637
     "model_module_version": "1.5.0",
638
     "model_name": "FloatProgressModel",
639
     "state": {
640
      "_dom_classes": [],
641
      "_model_module": "@jupyter-widgets/controls",
642
      "_model_module_version": "1.5.0",
643
      "_model_name": "FloatProgressModel",
644
      "_view_count": null,
645
      "_view_module": "@jupyter-widgets/controls",
646
      "_view_module_version": "1.5.0",
647
      "_view_name": "ProgressView",
648
      "bar_style": "success",
649
      "description": "",
650
      "description_tooltip": null,
651
      "layout": "IPY_MODEL_c1626ca2ebf84556a692e76f16f3cab4",
652
      "max": 37807,
653
      "min": 0,
654
      "orientation": "horizontal",
655
      "style": "IPY_MODEL_5cd3d66281d247749d4c71daa7c6f49d",
656
      "value": 37807
657
     }
658
    },
659
    "107daf1c8f8f4203aff8058191ce9728": {
660
     "model_module": "@jupyter-widgets/base",
661
     "model_module_version": "1.2.0",
662
     "model_name": "LayoutModel",
663
     "state": {
664
      "_model_module": "@jupyter-widgets/base",
665
      "_model_module_version": "1.2.0",
666
      "_model_name": "LayoutModel",
667
      "_view_count": null,
668
      "_view_module": "@jupyter-widgets/base",
669
      "_view_module_version": "1.2.0",
670
      "_view_name": "LayoutView",
671
      "align_content": null,
672
      "align_items": null,
673
      "align_self": null,
674
      "border": null,
675
      "bottom": null,
676
      "display": null,
677
      "flex": null,
678
      "flex_flow": null,
679
      "grid_area": null,
680
      "grid_auto_columns": null,
681
      "grid_auto_flow": null,
682
      "grid_auto_rows": null,
683
      "grid_column": null,
684
      "grid_gap": null,
685
      "grid_row": null,
686
      "grid_template_areas": null,
687
      "grid_template_columns": null,
688
      "grid_template_rows": null,
689
      "height": null,
690
      "justify_content": null,
691
      "justify_items": null,
692
      "left": null,
693
      "margin": null,
694
      "max_height": null,
695
      "max_width": null,
696
      "min_height": null,
697
      "min_width": null,
698
      "object_fit": null,
699
      "object_position": null,
700
      "order": null,
701
      "overflow": null,
702
      "overflow_x": null,
703
      "overflow_y": null,
704
      "padding": null,
705
      "right": null,
706
      "top": null,
707
      "visibility": null,
708
      "width": null
709
     }
710
    },
711
    "15f3697b990f40adb795dbcce3f626c1": {
712
     "model_module": "@jupyter-widgets/base",
713
     "model_module_version": "1.2.0",
714
     "model_name": "LayoutModel",
715
     "state": {
716
      "_model_module": "@jupyter-widgets/base",
717
      "_model_module_version": "1.2.0",
718
      "_model_name": "LayoutModel",
719
      "_view_count": null,
720
      "_view_module": "@jupyter-widgets/base",
721
      "_view_module_version": "1.2.0",
722
      "_view_name": "LayoutView",
723
      "align_content": null,
724
      "align_items": null,
725
      "align_self": null,
726
      "border": null,
727
      "bottom": null,
728
      "display": null,
729
      "flex": null,
730
      "flex_flow": null,
731
      "grid_area": null,
732
      "grid_auto_columns": null,
733
      "grid_auto_flow": null,
734
      "grid_auto_rows": null,
735
      "grid_column": null,
736
      "grid_gap": null,
737
      "grid_row": null,
738
      "grid_template_areas": null,
739
      "grid_template_columns": null,
740
      "grid_template_rows": null,
741
      "height": null,
742
      "justify_content": null,
743
      "justify_items": null,
744
      "left": null,
745
      "margin": null,
746
      "max_height": null,
747
      "max_width": null,
748
      "min_height": null,
749
      "min_width": null,
750
      "object_fit": null,
751
      "object_position": null,
752
      "order": null,
753
      "overflow": null,
754
      "overflow_x": null,
755
      "overflow_y": null,
756
      "padding": null,
757
      "right": null,
758
      "top": null,
759
      "visibility": null,
760
      "width": null
761
     }
762
    },
763
    "2398002062874506a558e59114359c54": {
764
     "model_module": "@jupyter-widgets/controls",
765
     "model_module_version": "1.5.0",
766
     "model_name": "ProgressStyleModel",
767
     "state": {
768
      "_model_module": "@jupyter-widgets/controls",
769
      "_model_module_version": "1.5.0",
770
      "_model_name": "ProgressStyleModel",
771
      "_view_count": null,
772
      "_view_module": "@jupyter-widgets/base",
773
      "_view_module_version": "1.2.0",
774
      "_view_name": "StyleView",
775
      "bar_color": null,
776
      "description_width": ""
777
     }
778
    },
779
    "2a7323e821724b129d01de39adb67c4f": {
780
     "model_module": "@jupyter-widgets/base",
781
     "model_module_version": "1.2.0",
782
     "model_name": "LayoutModel",
783
     "state": {
784
      "_model_module": "@jupyter-widgets/base",
785
      "_model_module_version": "1.2.0",
786
      "_model_name": "LayoutModel",
787
      "_view_count": null,
788
      "_view_module": "@jupyter-widgets/base",
789
      "_view_module_version": "1.2.0",
790
      "_view_name": "LayoutView",
791
      "align_content": null,
792
      "align_items": null,
793
      "align_self": null,
794
      "border": null,
795
      "bottom": null,
796
      "display": null,
797
      "flex": null,
798
      "flex_flow": null,
799
      "grid_area": null,
800
      "grid_auto_columns": null,
801
      "grid_auto_flow": null,
802
      "grid_auto_rows": null,
803
      "grid_column": null,
804
      "grid_gap": null,
805
      "grid_row": null,
806
      "grid_template_areas": null,
807
      "grid_template_columns": null,
808
      "grid_template_rows": null,
809
      "height": null,
810
      "justify_content": null,
811
      "justify_items": null,
812
      "left": null,
813
      "margin": null,
814
      "max_height": null,
815
      "max_width": null,
816
      "min_height": null,
817
      "min_width": null,
818
      "object_fit": null,
819
      "object_position": null,
820
      "order": null,
821
      "overflow": null,
822
      "overflow_x": null,
823
      "overflow_y": null,
824
      "padding": null,
825
      "right": null,
826
      "top": null,
827
      "visibility": null,
828
      "width": null
829
     }
830
    },
831
    "31acc8ba63e240a6b4419ab4aa51c87a": {
832
     "model_module": "@jupyter-widgets/controls",
833
     "model_module_version": "1.5.0",
834
     "model_name": "DescriptionStyleModel",
835
     "state": {
836
      "_model_module": "@jupyter-widgets/controls",
837
      "_model_module_version": "1.5.0",
838
      "_model_name": "DescriptionStyleModel",
839
      "_view_count": null,
840
      "_view_module": "@jupyter-widgets/base",
841
      "_view_module_version": "1.2.0",
842
      "_view_name": "StyleView",
843
      "description_width": ""
844
     }
845
    },
846
    "4b9ea215e11844239e968960cd45cade": {
847
     "model_module": "@jupyter-widgets/controls",
848
     "model_module_version": "1.5.0",
849
     "model_name": "HTMLModel",
850
     "state": {
851
      "_dom_classes": [],
852
      "_model_module": "@jupyter-widgets/controls",
853
      "_model_module_version": "1.5.0",
854
      "_model_name": "HTMLModel",
855
      "_view_count": null,
856
      "_view_module": "@jupyter-widgets/controls",
857
      "_view_module_version": "1.5.0",
858
      "_view_name": "HTMLView",
859
      "description": "",
860
      "description_tooltip": null,
861
      "layout": "IPY_MODEL_2a7323e821724b129d01de39adb67c4f",
862
      "placeholder": "​",
863
      "style": "IPY_MODEL_eeb568b15a1d465bab9f7a3843d611df",
864
      "value": "Ranking by BM25...: 100%"
865
     }
866
    },
867
    "5cd3d66281d247749d4c71daa7c6f49d": {
868
     "model_module": "@jupyter-widgets/controls",
869
     "model_module_version": "1.5.0",
870
     "model_name": "ProgressStyleModel",
871
     "state": {
872
      "_model_module": "@jupyter-widgets/controls",
873
      "_model_module_version": "1.5.0",
874
      "_model_name": "ProgressStyleModel",
875
      "_view_count": null,
876
      "_view_module": "@jupyter-widgets/base",
877
      "_view_module_version": "1.2.0",
878
      "_view_name": "StyleView",
879
      "bar_color": null,
880
      "description_width": ""
881
     }
882
    },
883
    "827efd14f6f74c8ca0fb8df3a4359062": {
884
     "model_module": "@jupyter-widgets/base",
885
     "model_module_version": "1.2.0",
886
     "model_name": "LayoutModel",
887
     "state": {
888
      "_model_module": "@jupyter-widgets/base",
889
      "_model_module_version": "1.2.0",
890
      "_model_name": "LayoutModel",
891
      "_view_count": null,
892
      "_view_module": "@jupyter-widgets/base",
893
      "_view_module_version": "1.2.0",
894
      "_view_name": "LayoutView",
895
      "align_content": null,
896
      "align_items": null,
897
      "align_self": null,
898
      "border": null,
899
      "bottom": null,
900
      "display": null,
901
      "flex": null,
902
      "flex_flow": null,
903
      "grid_area": null,
904
      "grid_auto_columns": null,
905
      "grid_auto_flow": null,
906
      "grid_auto_rows": null,
907
      "grid_column": null,
908
      "grid_gap": null,
909
      "grid_row": null,
910
      "grid_template_areas": null,
911
      "grid_template_columns": null,
912
      "grid_template_rows": null,
913
      "height": null,
914
      "justify_content": null,
915
      "justify_items": null,
916
      "left": null,
917
      "margin": null,
918
      "max_height": null,
919
      "max_width": null,
920
      "min_height": null,
921
      "min_width": null,
922
      "object_fit": null,
923
      "object_position": null,
924
      "order": null,
925
      "overflow": null,
926
      "overflow_x": null,
927
      "overflow_y": null,
928
      "padding": null,
929
      "right": null,
930
      "top": null,
931
      "visibility": null,
932
      "width": null
933
     }
934
    },
935
    "864e853846b3406a9a8b743dbc1d96ff": {
936
     "model_module": "@jupyter-widgets/controls",
937
     "model_module_version": "1.5.0",
938
     "model_name": "HTMLModel",
939
     "state": {
940
      "_dom_classes": [],
941
      "_model_module": "@jupyter-widgets/controls",
942
      "_model_module_version": "1.5.0",
943
      "_model_name": "HTMLModel",
944
      "_view_count": null,
945
      "_view_module": "@jupyter-widgets/controls",
946
      "_view_module_version": "1.5.0",
947
      "_view_name": "HTMLView",
948
      "description": "",
949
      "description_tooltip": null,
950
      "layout": "IPY_MODEL_947922d2f75346cdbbb908d3888f832e",
951
      "placeholder": "​",
952
      "style": "IPY_MODEL_c7a118b1f8a2491cacd5f76db668443e",
953
      "value": " 1/1 [00:00&lt;00:00, 22.59it/s]"
954
     }
955
    },
956
    "947922d2f75346cdbbb908d3888f832e": {
957
     "model_module": "@jupyter-widgets/base",
958
     "model_module_version": "1.2.0",
959
     "model_name": "LayoutModel",
960
     "state": {
961
      "_model_module": "@jupyter-widgets/base",
962
      "_model_module_version": "1.2.0",
963
      "_model_name": "LayoutModel",
964
      "_view_count": null,
965
      "_view_module": "@jupyter-widgets/base",
966
      "_view_module_version": "1.2.0",
967
      "_view_name": "LayoutView",
968
      "align_content": null,
969
      "align_items": null,
970
      "align_self": null,
971
      "border": null,
972
      "bottom": null,
973
      "display": null,
974
      "flex": null,
975
      "flex_flow": null,
976
      "grid_area": null,
977
      "grid_auto_columns": null,
978
      "grid_auto_flow": null,
979
      "grid_auto_rows": null,
980
      "grid_column": null,
981
      "grid_gap": null,
982
      "grid_row": null,
983
      "grid_template_areas": null,
984
      "grid_template_columns": null,
985
      "grid_template_rows": null,
986
      "height": null,
987
      "justify_content": null,
988
      "justify_items": null,
989
      "left": null,
990
      "margin": null,
991
      "max_height": null,
992
      "max_width": null,
993
      "min_height": null,
994
      "min_width": null,
995
      "object_fit": null,
996
      "object_position": null,
997
      "order": null,
998
      "overflow": null,
999
      "overflow_x": null,
1000
      "overflow_y": null,
1001
      "padding": null,
1002
      "right": null,
1003
      "top": null,
1004
      "visibility": null,
1005
      "width": null
1006
     }
1007
    },
1008
    "9e5e169b22dd45068a2b03154b26ccf0": {
1009
     "model_module": "@jupyter-widgets/controls",
1010
     "model_module_version": "1.5.0",
1011
     "model_name": "HTMLModel",
1012
     "state": {
1013
      "_dom_classes": [],
1014
      "_model_module": "@jupyter-widgets/controls",
1015
      "_model_module_version": "1.5.0",
1016
      "_model_name": "HTMLModel",
1017
      "_view_count": null,
1018
      "_view_module": "@jupyter-widgets/controls",
1019
      "_view_module_version": "1.5.0",
1020
      "_view_name": "HTMLView",
1021
      "description": "",
1022
      "description_tooltip": null,
1023
      "layout": "IPY_MODEL_107daf1c8f8f4203aff8058191ce9728",
1024
      "placeholder": "​",
1025
      "style": "IPY_MODEL_31acc8ba63e240a6b4419ab4aa51c87a",
1026
      "value": " 37807/37807 [00:06&lt;00:00, 4599.09 docs/s]"
1027
     }
1028
    },
1029
    "a4d87d3d4a9a4dc4bccdc4a16be29096": {
1030
     "model_module": "@jupyter-widgets/base",
1031
     "model_module_version": "1.2.0",
1032
     "model_name": "LayoutModel",
1033
     "state": {
1034
      "_model_module": "@jupyter-widgets/base",
1035
      "_model_module_version": "1.2.0",
1036
      "_model_name": "LayoutModel",
1037
      "_view_count": null,
1038
      "_view_module": "@jupyter-widgets/base",
1039
      "_view_module_version": "1.2.0",
1040
      "_view_name": "LayoutView",
1041
      "align_content": null,
1042
      "align_items": null,
1043
      "align_self": null,
1044
      "border": null,
1045
      "bottom": null,
1046
      "display": null,
1047
      "flex": null,
1048
      "flex_flow": null,
1049
      "grid_area": null,
1050
      "grid_auto_columns": null,
1051
      "grid_auto_flow": null,
1052
      "grid_auto_rows": null,
1053
      "grid_column": null,
1054
      "grid_gap": null,
1055
      "grid_row": null,
1056
      "grid_template_areas": null,
1057
      "grid_template_columns": null,
1058
      "grid_template_rows": null,
1059
      "height": null,
1060
      "justify_content": null,
1061
      "justify_items": null,
1062
      "left": null,
1063
      "margin": null,
1064
      "max_height": null,
1065
      "max_width": null,
1066
      "min_height": null,
1067
      "min_width": null,
1068
      "object_fit": null,
1069
      "object_position": null,
1070
      "order": null,
1071
      "overflow": null,
1072
      "overflow_x": null,
1073
      "overflow_y": null,
1074
      "padding": null,
1075
      "right": null,
1076
      "top": null,
1077
      "visibility": null,
1078
      "width": null
1079
     }
1080
    },
1081
    "b395830b097f4862a6c8588ccd0fd91b": {
1082
     "model_module": "@jupyter-widgets/controls",
1083
     "model_module_version": "1.5.0",
1084
     "model_name": "HBoxModel",
1085
     "state": {
1086
      "_dom_classes": [],
1087
      "_model_module": "@jupyter-widgets/controls",
1088
      "_model_module_version": "1.5.0",
1089
      "_model_name": "HBoxModel",
1090
      "_view_count": null,
1091
      "_view_module": "@jupyter-widgets/controls",
1092
      "_view_module_version": "1.5.0",
1093
      "_view_name": "HBoxView",
1094
      "box_style": "",
1095
      "children": [
1096
       "IPY_MODEL_4b9ea215e11844239e968960cd45cade",
1097
       "IPY_MODEL_097a7751c1b04aa3bf4a0a586a6dfa32",
1098
       "IPY_MODEL_9e5e169b22dd45068a2b03154b26ccf0"
1099
      ],
1100
      "layout": "IPY_MODEL_827efd14f6f74c8ca0fb8df3a4359062"
1101
     }
1102
    },
1103
    "c1626ca2ebf84556a692e76f16f3cab4": {
1104
     "model_module": "@jupyter-widgets/base",
1105
     "model_module_version": "1.2.0",
1106
     "model_name": "LayoutModel",
1107
     "state": {
1108
      "_model_module": "@jupyter-widgets/base",
1109
      "_model_module_version": "1.2.0",
1110
      "_model_name": "LayoutModel",
1111
      "_view_count": null,
1112
      "_view_module": "@jupyter-widgets/base",
1113
      "_view_module_version": "1.2.0",
1114
      "_view_name": "LayoutView",
1115
      "align_content": null,
1116
      "align_items": null,
1117
      "align_self": null,
1118
      "border": null,
1119
      "bottom": null,
1120
      "display": null,
1121
      "flex": null,
1122
      "flex_flow": null,
1123
      "grid_area": null,
1124
      "grid_auto_columns": null,
1125
      "grid_auto_flow": null,
1126
      "grid_auto_rows": null,
1127
      "grid_column": null,
1128
      "grid_gap": null,
1129
      "grid_row": null,
1130
      "grid_template_areas": null,
1131
      "grid_template_columns": null,
1132
      "grid_template_rows": null,
1133
      "height": null,
1134
      "justify_content": null,
1135
      "justify_items": null,
1136
      "left": null,
1137
      "margin": null,
1138
      "max_height": null,
1139
      "max_width": null,
1140
      "min_height": null,
1141
      "min_width": null,
1142
      "object_fit": null,
1143
      "object_position": null,
1144
      "order": null,
1145
      "overflow": null,
1146
      "overflow_x": null,
1147
      "overflow_y": null,
1148
      "padding": null,
1149
      "right": null,
1150
      "top": null,
1151
      "visibility": null,
1152
      "width": null
1153
     }
1154
    },
1155
    "c7a118b1f8a2491cacd5f76db668443e": {
1156
     "model_module": "@jupyter-widgets/controls",
1157
     "model_module_version": "1.5.0",
1158
     "model_name": "DescriptionStyleModel",
1159
     "state": {
1160
      "_model_module": "@jupyter-widgets/controls",
1161
      "_model_module_version": "1.5.0",
1162
      "_model_name": "DescriptionStyleModel",
1163
      "_view_count": null,
1164
      "_view_module": "@jupyter-widgets/base",
1165
      "_view_module_version": "1.2.0",
1166
      "_view_name": "StyleView",
1167
      "description_width": ""
1168
     }
1169
    },
1170
    "cf62bf3b3c6144629811874114dc527f": {
1171
     "model_module": "@jupyter-widgets/controls",
1172
     "model_module_version": "1.5.0",
1173
     "model_name": "HBoxModel",
1174
     "state": {
1175
      "_dom_classes": [],
1176
      "_model_module": "@jupyter-widgets/controls",
1177
      "_model_module_version": "1.5.0",
1178
      "_model_name": "HBoxModel",
1179
      "_view_count": null,
1180
      "_view_module": "@jupyter-widgets/controls",
1181
      "_view_module_version": "1.5.0",
1182
      "_view_name": "HBoxView",
1183
      "box_style": "",
1184
      "children": [
1185
       "IPY_MODEL_0387b8e4546247f49f854f9729e6a3df",
1186
       "IPY_MODEL_d45dcf1e27a5401ca2c430cd6c322fdb",
1187
       "IPY_MODEL_864e853846b3406a9a8b743dbc1d96ff"
1188
      ],
1189
      "layout": "IPY_MODEL_15f3697b990f40adb795dbcce3f626c1"
1190
     }
1191
    },
1192
    "cf972cbfa1314f149b9860e199391170": {
1193
     "model_module": "@jupyter-widgets/base",
1194
     "model_module_version": "1.2.0",
1195
     "model_name": "LayoutModel",
1196
     "state": {
1197
      "_model_module": "@jupyter-widgets/base",
1198
      "_model_module_version": "1.2.0",
1199
      "_model_name": "LayoutModel",
1200
      "_view_count": null,
1201
      "_view_module": "@jupyter-widgets/base",
1202
      "_view_module_version": "1.2.0",
1203
      "_view_name": "LayoutView",
1204
      "align_content": null,
1205
      "align_items": null,
1206
      "align_self": null,
1207
      "border": null,
1208
      "bottom": null,
1209
      "display": null,
1210
      "flex": null,
1211
      "flex_flow": null,
1212
      "grid_area": null,
1213
      "grid_auto_columns": null,
1214
      "grid_auto_flow": null,
1215
      "grid_auto_rows": null,
1216
      "grid_column": null,
1217
      "grid_gap": null,
1218
      "grid_row": null,
1219
      "grid_template_areas": null,
1220
      "grid_template_columns": null,
1221
      "grid_template_rows": null,
1222
      "height": null,
1223
      "justify_content": null,
1224
      "justify_items": null,
1225
      "left": null,
1226
      "margin": null,
1227
      "max_height": null,
1228
      "max_width": null,
1229
      "min_height": null,
1230
      "min_width": null,
1231
      "object_fit": null,
1232
      "object_position": null,
1233
      "order": null,
1234
      "overflow": null,
1235
      "overflow_x": null,
1236
      "overflow_y": null,
1237
      "padding": null,
1238
      "right": null,
1239
      "top": null,
1240
      "visibility": null,
1241
      "width": null
1242
     }
1243
    },
1244
    "d45dcf1e27a5401ca2c430cd6c322fdb": {
1245
     "model_module": "@jupyter-widgets/controls",
1246
     "model_module_version": "1.5.0",
1247
     "model_name": "FloatProgressModel",
1248
     "state": {
1249
      "_dom_classes": [],
1250
      "_model_module": "@jupyter-widgets/controls",
1251
      "_model_module_version": "1.5.0",
1252
      "_model_name": "FloatProgressModel",
1253
      "_view_count": null,
1254
      "_view_module": "@jupyter-widgets/controls",
1255
      "_view_module_version": "1.5.0",
1256
      "_view_name": "ProgressView",
1257
      "bar_style": "success",
1258
      "description": "",
1259
      "description_tooltip": null,
1260
      "layout": "IPY_MODEL_a4d87d3d4a9a4dc4bccdc4a16be29096",
1261
      "max": 1,
1262
      "min": 0,
1263
      "orientation": "horizontal",
1264
      "style": "IPY_MODEL_2398002062874506a558e59114359c54",
1265
      "value": 1
1266
     }
1267
    },
1268
    "eeb568b15a1d465bab9f7a3843d611df": {
1269
     "model_module": "@jupyter-widgets/controls",
1270
     "model_module_version": "1.5.0",
1271
     "model_name": "DescriptionStyleModel",
1272
     "state": {
1273
      "_model_module": "@jupyter-widgets/controls",
1274
      "_model_module_version": "1.5.0",
1275
      "_model_name": "DescriptionStyleModel",
1276
      "_view_count": null,
1277
      "_view_module": "@jupyter-widgets/base",
1278
      "_view_module_version": "1.2.0",
1279
      "_view_name": "StyleView",
1280
      "description_width": ""
1281
     }
1282
    }
1283
   }
1284
  }
1285
 },
1286
 "nbformat": 4,
1287
 "nbformat_minor": 0
1288
}
1289

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.