class_docstr: A class that featurizes using Mitie.
class_docstr_tok: ["A","class","that","featurizes","using","Mitie","."]
docstr: Calculates features.
docstr_tok: ["Calculates","features","."]
code: def features_for_tokens(
      self,
      tokens: List[Token],
      feature_extractor: "mitie.total_word_feature_extractor",
  ) -> Tuple[np.ndarray, np.ndarray]:
      """Calculates features."""
      sequence_features = np.array(
          [
              feature_extractor.get_feature_vector(token.text)
              for token in tokens
          ]
      )
  
      sentence_fetaures = self.aggregate_sequence_features(
          sequence_features, self.pooling_operation
      )
  
      return sequence_features, sentence_fetaures
  
imports: from __future__ import annotations
  import numpy
  import logging
  import typing
  from typing import Any, List, Text, Dict, Tuple, Type
  from rasa.engine.graph import GraphComponent, ExecutionContext
  from rasa.engine.recipes.default_recipe import DefaultV1Recipe
  from rasa.engine.storage.resource import Resource
  from rasa.engine.storage.storage import ModelStorage
  from rasa.nlu.featurizers.dense_featurizer.dense_featurizer import DenseFeaturizer
  from rasa.nlu.tokenizers.tokenizer import Token, Tokenizer
  from rasa.nlu.constants import DENSE_FEATURIZABLE_ATTRIBUTES, FEATURIZER_CLASS_ALIAS, TOKENS_NAMES
  from rasa.nlu.utils.mitie_utils import MitieModel, MitieNLP
  from rasa.utils.tensorflow.constants import MEAN_POOLING, POOLING
  from rasa.shared.nlu.training_data.features import Features
  from rasa.shared.nlu.training_data.message import Message
  from rasa.shared.nlu.constants import FEATURE_TYPE_SENTENCE, FEATURE_TYPE_SEQUENCE
  from rasa.shared.nlu.training_data.training_data import TrainingData
label_desc: Use image node_id 13 for calling the MitieFeaturizer obj's underlying member method code with example usage: obj.features_for_tokens(tokens, feature_extractor) and returns: sequence_features,  sentence_fetaures