You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The most convenient way to use is this plugin is via our `build_chatbot` api as introduced in the [example code](https://github.com/intel/intel-extension-for-transformers/tree/main/intel_extension_for_transformers/neural_chat/examples/plugins/retrieval). The user could refer to it for a simple test.
45
+
Before using RAG in NeuralChat, please install the necessary dependencies in [requirements.txt](https://github.com/intel/intel-extension-for-transformers/blob/main/intel_extension_for_transformers/neural_chat/pipeline/plugins/retrieval/requirements.txt) to avoid the import errors. The most convenient way to use is this plugin is via our `build_chatbot` api as introduced in the [example code](https://github.com/intel/intel-extension-for-transformers/tree/main/intel_extension_for_transformers/neural_chat/examples/plugins/retrieval). The user could refer to it for a simple test.
46
46
47
-
We support multiple file formats for retrieval, including unstructured file formats such as pdf, docx, html, txt, and markdown, as well as structured file formats like jsonl and xlsx. For structured file formats, they must adhere to predefined structures.
47
+
We support multiple file formats for retrieval, including unstructured file formats such as pdf, docx, html, txt, and markdown, as well as structured file formats like jsonl/json, csv, xlsx. For structured file formats, they must adhere to predefined structures. We also support to upload the knowledge base via a http web link.
48
48
49
49
In the case of jsonl files, they should be formatted as dictionaries, such as: {'content':xxx, 'link':xxx}. The support for xlsx files is specifically designed for Question-Answer (QA) tasks. Users can input QA pairs for retrieval. Therefore, the table's header should include items labeled as "Question" and "Answer". The reference files could be found [here](https://github.com/intel/intel-extension-for-transformers/tree/main/intel_extension_for_transformers/neural_chat/assets/docs).
50
50
@@ -83,11 +83,15 @@ Below are the description for the available parameters in `agent_QA`,
83
83
| embedding_model | str | The name or path for the text embedding model |-|
84
84
| response_template | str | Default response when there is no available relevant documents for RAG |-|
85
85
| mode | str | The RAG behavior for different use case. Please check [here](#rag-mode)|"accuracy", "general"|
86
-
| retrieval_type | str | The type of the retriever. Please check [here](#retrievers) for more details | "default", "child_parent"|
86
+
| retrieval_type | str | The type of the retriever. Please check [here](#retrievers) for more details | "default", "child_parent", "bm25"|
87
87
| process | bool | Whether to split the long documents into small chucks. The size of each chuck is defined by `max_chuck_size` and `min_chuck_size`|True, False|
88
88
| max_chuck_size | int | The max token length for a single chuck in the knowledge base |-|
89
89
| min_chuck_size | int | The min token length for a single chuck in the knowledge base |-|
90
90
| append | bool | Whether the new knowledge will be append to the existing knowledge base or directly load the existing knowledge base |True, False|
91
+
| polish | bool | Whether to polish the input query before processing |True, False|
92
+
| enable_rerank | bool | Whether to enable retrieval then rerank pipeline |True, False|
93
+
| reranker_model | str | The name of the reranker model from the Huggingface or a local path |-|
94
+
| top_n | int | The return number of the reranker model |-|
91
95
92
96
More retriever- and vectorstore-related parameters please check [here](#langchain-extension)
"k" is the number of the returned most similar documents. "fetch_k" is the number of Documents to fetch to pass to MMR algorithm. "Lamabda_mult" is a number between 0 and 1 that determines the degree of diversity among the results with 0 corresponding to maximum diversity and 1 to minimum diversity. Defaults to 0.5.
196
200
197
201
If "search_type"="similarity_score_threshold":
198
-
>search_kwargs={"k"=xxx, "score_threshold"=xxx}
202
+
>search_kwargs={"k":xxx, "score_threshold":xxx}
199
203
200
204
"k" is the number of the returned most similar documents. "score_threshold" is the similar score threshold for the retrieved documents.
0 commit comments