class_docstr: Extracts entities via lookup tables and regexes defined in the training data.
docstr: Extract patterns from the training data.
  
  Args:
      training_data: the training data
docstr_tok: ["Extract","patterns","from","the","training","data",".","Args",":","training_data",":","the","training","data"]
code: def train(self, training_data: TrainingData) -> Resource:
      """Extract patterns from the training data.
  
      Args:
          training_data: the training data
      """
      self.patterns = pattern_utils.extract_patterns(
          training_data,
          use_lookup_tables=self._config["use_lookup_tables"],
          use_regexes=self._config["use_regexes"],
          use_only_entities=True,
          use_word_boundaries=self._config["use_word_boundaries"],
      )
  
      if not self.patterns:
          rasa.shared.utils.io.raise_warning(
              "No lookup tables or regexes defined in the training data that have "
              "a name equal to any entity in the training data. In order for this "
              "component to work you need to define valid lookup tables or regexes "
              "in the training data."
          )
      self.persist()
      return self._resource
  
imports: from __future__ import annotations
  import logging
  import re
  from typing import Any, Dict, List, Optional, Text
  from rasa.engine.graph import GraphComponent, ExecutionContext
  from rasa.engine.recipes.default_recipe import DefaultV1Recipe
  from rasa.engine.storage.storage import ModelStorage
  from rasa.engine.storage.resource import Resource
  import rasa.shared.utils.io
  import rasa.nlu.utils.pattern_utils
  from rasa.shared.nlu.training_data.training_data import TrainingData
  from rasa.shared.nlu.training_data.message import Message
  from rasa.shared.nlu.constants import ENTITIES, ENTITY_ATTRIBUTE_VALUE, ENTITY_ATTRIBUTE_START, ENTITY_ATTRIBUTE_END, TEXT, ENTITY_ATTRIBUTE_TYPE
  from rasa.nlu.extractors.extractor import EntityExtractorMixin
label_desc: Use image node_id 4 for calling the RegexEntityExtractor obj's underlying member method code with example usage: obj.train(training_data) and returns: self