Other Module¶
pipelines.pipelines.nodes.other.docs2answers ¶
Docs2Answers ¶
This Node is used to convert retrieved documents into predicted answers format. It is useful for situations where you are calling a Retriever only pipeline via REST API. This ensures that your output is in a compatible format.
Source code in pipelines/pipelines/nodes/other/docs2answers.py
pipelines.pipelines.nodes.other.join_answers ¶
JoinAnswers ¶
A node to join Answers produced by multiple Reader nodes.
Source code in pipelines/pipelines/nodes/other/join_answers.py
__init__ ¶
__init__(join_mode: str = 'concatenate', weights: Optional[List[float]] = None, top_k_join: Optional[int] = None)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
join_mode |
str
|
|
'concatenate'
|
weights |
Optional[List[float]]
|
A node-wise list (length of list must be equal to the number of input nodes) of weights for adjusting |
None
|
top_k_join |
Optional[int]
|
Limit |
None
|
Source code in pipelines/pipelines/nodes/other/join_answers.py
pipelines.pipelines.nodes.other.join_docs ¶
JoinDocuments ¶
A node to join documents outputted by multiple retriever nodes.
The node allows multiple join modes:
* concatenate: combine the documents from multiple nodes. Any duplicate documents are discarded.
* merge: merge scores of documents from multiple nodes. Optionally, each input score can be given a different
weight & a top_k limit can be set. This mode can also be used for "reranking" retrieved documents.
* reciprocal_rank_fusion: combines the documents based on their rank in multiple nodes.
Source code in pipelines/pipelines/nodes/other/join_docs.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | |
__init__ ¶
__init__(join_mode: str = 'concatenate', weights: Optional[List[float]] = None, top_k_join: Optional[int] = None)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
join_mode |
str
|
|
'concatenate'
|
weights |
Optional[List[float]]
|
A node-wise list(length of list must be equal to the number of input nodes) of weights for adjusting document scores when using the |
None
|
top_k_join |
Optional[int]
|
Limit documents to top_k based on the resulting scores of the join. |
None
|
Source code in pipelines/pipelines/nodes/other/join_docs.py
pipelines.pipelines.nodes.other.route_documents ¶
RouteDocuments ¶
A node to split a list of Documents by content_type or by the values of a metadata field and route them to
different nodes.
Source code in pipelines/pipelines/nodes/other/route_documents.py
__init__ ¶
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
split_by |
str
|
Field to split the documents by, either |
'content_type'
|
metadata_values |
Optional[List[str]]
|
If the parameter |
None
|