This is documentation for Rasa Open Source Documentation v2.1.x, which is no longer actively maintained.
For up-to-date documentation, see the latest version (2.2.x).

Version: 2.1.x


CountVectorsFeaturizer Objects

class CountVectorsFeaturizer(SparseFeaturizer)

Creates a sequence of token counts features based on sklearn's CountVectorizer.

All tokens which consist only of digits (e.g. 123 and 99 but not ab12d) will be represented by a single feature.

Set analyzer to 'char_wb' to use the idea of Subword Semantic Hashing from


| __init__(component_config: Optional[Dict[Text, Any]] = None, vectorizers: Optional[Dict[Text, "CountVectorizer"]] = None) -> None

Construct a new count vectorizer using the sklearn framework.


| train(training_data: TrainingData, cfg: Optional[RasaNLUModelConfig] = None, **kwargs: Any, ,) -> None

Train the featurizer.

Take parameters from config and construct a new count vectorizer using the sklearn framework.


| process(message: Message, **kwargs: Any) -> None

Process incoming message and compute and set features


| persist(file_name: Text, model_dir: Text) -> Optional[Dict[Text, Any]]

Persist this model into the passed directory.

Returns the metadata necessary to load the model again.