Utility Components
See this section for a list of helper components you can use in your pipelines to perform a variety of functions, such as transforming text documents to speech, joining documents or answers, and more.
Component | Available Classes | Description |
---|---|---|
DocumentMerger | DocumentMerger | Concatenates multiple documents into a single one. Example usage: Creating summaries based on multiple documents. |
Docs2Answers | Docs2Answers | Converts documents into answers. Example usage: When using REST API for document retrieval. REST API expects Answer as output, you can use Doc2Answer as the last node to convert the retrieved documents to answers. |
JoinAnswers | JoinAnswers | Takes answers returned by multiple components and joins them in a single list of answers. Example usage: For running queries on different document types (for example, tables and text), where the documents are routed to different readers, and each reader returns a separate list of answers. |
JoinDocuments | JoinDocuments | Takes documents returned by different components and joins them to form one list of documents. Example usage: In document retrieval pipelines, where there are different types of documents, each routed to a different retriever. Each retriever returns a separate list of documents, and you can join them into one list using JoinDocuments. |
Shaper | Shaper | Currently functions mostly as PromptNode helper making sure the PromptNode input or output is correct. Example usage: In a question answering pipeline using PromptNode, where the PromptTemplate expects questions as input, while Haystack pipelines use query . You can use Shaper to rename query to questions . |
Summarizer | TransformersSummarizer | Creates an overview of a document. Example usage: To get a glimpse of the documents the Retriever is returning. |
TransformersImageToText | TransformersImageToText | Generates captions for images. Example usage: Automatically generating captions for a list of images that you can later use in your knowledge base. |
Translator | TransformersTranslator | Translates text from one language into another. Example usage: Running searches on documents in other languages. |
Updated over 1 year ago