Skip to main content

TextLanguageRouter

Routes text strings to different output connections based on their language.

Basic Information

  • Type: haystack_integrations.routers.text_language_router.TextLanguageRouter

Inputs

ParameterTypeDefaultDescription
textstrA text string to route.

Outputs

ParameterTypeDefaultDescription

Overview

Work in Progress

Bear with us while we're working on adding pipeline examples and most common components connections.

Routes text strings to different output connections based on their language.

Provide a list of languages during initialization. If the document's text doesn't match any of the specified languages, the metadata value is set to "unmatched". For routing documents based on their language, use the DocumentLanguageClassifier component, followed by the MetaDataRouter.

Usage Example

components:
TextLanguageRouter:
type: components.routers.text_language_router.TextLanguageRouter
init_parameters:

Parameters

Init Parameters

These are the parameters you can configure in Pipeline Builder:

ParameterTypeDefaultDescription
languagesOptional[List[str]]NoneA list of ISO language codes. See the supported languages in langdetect documentation. If not specified, defaults to ["en"].

Run Method Parameters

These are the parameters you can configure for the component's run() method. This means you can pass these parameters at query time through the API, in Playground, or when running a job. For details, see Modify Pipeline Parameters at Query Time.

ParameterTypeDefaultDescription
textstrA text string to route.