Skip to content

Commit acd54fa

Browse files
julian-rischclaudekacperlukawski
authored
Update tutorial 32 to use the langdetect-haystack integration (#466)
* Update tutorial 32 to use the langdetect-haystack integration DocumentLanguageClassifier and TextLanguageRouter moved from Haystack core to the langdetect-haystack package. Update the install command and imports, and refresh the notebook outputs from an end-to-end run. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix: update tutorial 32 dependency from langdetect to langdetect-haystack --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com> Co-authored-by: Kacper Łukawski <kacper.lukawski@deepset.ai>
1 parent b60f72f commit acd54fa

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

index.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ notebook = "32_Classifying_Documents_and_Queries_by_Language.ipynb"
7575
aliases = []
7676
completion_time = "15 min"
7777
created_at = 2024-02-06
78-
dependencies = ["langdetect"]
78+
dependencies = ["langdetect-haystack"]
7979

8080
[[tutorial]]
8181
title = "Creating a Hybrid Retrieval Pipeline"

tutorials/32_Classifying_Documents_and_Queries_by_Language.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"%%bash\n",
5757
"\n",
5858
"pip install haystack-ai\n",
59-
"pip install langdetect"
59+
"pip install langdetect-haystack"
6060
]
6161
},
6262
{
@@ -91,7 +91,7 @@
9191
"source": [
9292
"from haystack import Document, Pipeline\n",
9393
"from haystack.document_stores.in_memory import InMemoryDocumentStore\n",
94-
"from haystack.components.classifiers import DocumentLanguageClassifier\n",
94+
"from haystack_integrations.components.classifiers.langdetect import DocumentLanguageClassifier\n",
9595
"from haystack.components.routers import MetadataRouter\n",
9696
"from haystack.components.writers import DocumentWriter\n",
9797
"\n",
@@ -389,7 +389,7 @@
389389
"from haystack.components.builders import ChatPromptBuilder\n",
390390
"from haystack.components.generators.chat import OpenAIChatGenerator\n",
391391
"from haystack.dataclasses import ChatMessage\n",
392-
"from haystack.components.routers import TextLanguageRouter\n",
392+
"from haystack_integrations.components.routers.langdetect import TextLanguageRouter\n",
393393
"\n",
394394
"prompt_template = [\n",
395395
" ChatMessage.from_user(\n",

0 commit comments

Comments
 (0)