notice

This is unreleased documentation for Rasa Open Source Documentation Master/Unreleased version.
For the latest released documentation, see the latest version (2.8.x).

Version: Master/Unreleased

rasa.nlu.featurizers.dense_featurizer.mitie_featurizer

MitieFeaturizerGraphComponent Objects

class MitieFeaturizerGraphComponent(DenseFeaturizer2, GraphComponent)

A class that featurizes using Mitie.

get_default_config

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

Returns the component's default config.

required_packages

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

Any extra python dependencies required for this component to run.

__init__

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

Instantiates a new MitieFeaturizerGraphComponent instance.

create

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

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

validate_config

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

Validates that the component is configured properly.

validate_compatibility_with_tokenizer

@classmethod
def validate_compatibility_with_tokenizer(cls, config: Dict[Text, Any], tokenizer_type: Type[Tokenizer]) -> None

Validate a configuration for this component in the context of a recipe.

ndim

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

Returns the number of dimensions.

process

def 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

def 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

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

Calculates features.