Version: 3.x

rasa.nlu.featurizers.dense_featurizer.mitie_featurizer

MitieFeaturizer Objects

@DefaultV1Recipe.register(
DefaultV1Recipe.ComponentType.MESSAGE_FEATURIZER,
is_trainable=False,
model_from="MitieNLP",
)
class MitieFeaturizer(DenseFeaturizer, GraphComponent)

A class that featurizes using Mitie.

required_components

| @classmethod
| required_components(cls) -> List[Type]

Components that should be included in the pipeline before this component.

get_default_config

| @staticmethod
| get_default_config() -> Dict[Text, Any]

Returns the component's default config.

required_packages

| @staticmethod
| required_packages() -> List[Text]

Any extra python dependencies required for this component to run.

__init__

| __init__(config: Dict[Text, Any], execution_context: ExecutionContext) -> None

Instantiates a new MitieFeaturizer instance.

create

| @classmethod
| create(cls, config: Dict[Text, Any], model_storage: ModelStorage, resource: Resource, execution_context: ExecutionContext) -> MitieFeaturizer

Creates a new untrained component (see parent class for full docstring).

validate_config

| @classmethod
| validate_config(cls, config: Dict[Text, Any]) -> None

Validates that the component is configured properly.

ndim

| ndim(feature_extractor: "mitie.total_word_feature_extractor") -> int

Returns the number of dimensions.

process

| process(messages: List[Message], model: MitieModel) -> List[Message]

Featurizes all given messages in-place.

Returns:

The given list of messages which have been modified in-place.

process_training_data

| process_training_data(training_data: TrainingData, model: MitieModel) -> TrainingData

Processes the training examples in the given training data in-place.

Arguments:

  • training_data - Training data.
  • model - A Mitie model.

Returns:

Same training data after processing.

features_for_tokens

| features_for_tokens(tokens: List[Token], feature_extractor: "mitie.total_word_feature_extractor") -> Tuple[np.ndarray, np.ndarray]

Calculates features.