BM25VectorizerModel
DashAI.back.models.RAG.retrievers.sparse.BM25VectorizerModel
Component that encapsulates a :class:CountVectorizer for BM25.
The vectorizer provides term-frequency counts; the BM25 weighting
is applied by the parent :class:BM25Retriever.
Parameters
- strip_accents, default=
None - Remove accents during preprocessing.
- lowercase : boolean, default=
True - Convert all characters to lowercase.
- stop_words, default=
None - List of stop words.
- max_df : number, default=
1.0 - Ignore terms with document frequency above this threshold.
- min_df : number, default=
0.0 - Ignore terms with document frequency below this threshold.
- max_features, default=
None - Maximum number of features.
Methods
get_credential(self, name: str)
ConfigObjectResolve a registered credential component by name.
Parameters
- name : str
- Credential component class name (e.g. "HuggingFaceCredential").
Returns
- BaseCredential
- An instance of the requested credential component.
get_schema(cls) -> dict
ConfigObjectGenerates the component related Json Schema.
Returns
- dict
- Dictionary representing the Json Schema of the component.
validate_and_transform(self, raw_data: dict) -> dict
ConfigObjectIt takes the data given by the user to initialize the model and returns it with all the objects that the model needs to work.
Parameters
- raw_data : dict
- A dictionary with the data provided by the user to initialize the model.
Returns
- dict
- A validated dictionary with the necessary objects.