class_docstr: Provides functionality for components that do entity extraction.
  
  Inheriting from this class will add utility functions for entity extraction.
  Entity extraction is the process of identifying and extracting entities like a
  person's name, or a location from a message.
class_docstr_tok: ["Provides","functionality","for","components","that","do","entity","extraction",".","Inheriting","from","this","class","will","add","utility","functions","for","entity","extraction",".","Entity","extraction","is","the","process","of","identifying","and","extracting","entities","like","a","person","'s","name",",","or","a","location","from","a","message","."]
code: def find_entity(
      entity: Dict[Text, Any], text: Text, tokens: List[Token]
  ) -> Tuple[int, int]:
      offsets = [token.start for token in tokens]
      ends = [token.end for token in tokens]
  
      if entity[ENTITY_ATTRIBUTE_START] not in offsets:
          message = (
              "Invalid entity {} in example '{}': "
              "entities must span whole tokens. "
              "Wrong entity start.".format(entity, text)
          )
          raise ValueError(message)
  
      if entity[ENTITY_ATTRIBUTE_END] not in ends:
          message = (
              "Invalid entity {} in example '{}': "
              "entities must span whole tokens. "
              "Wrong entity end.".format(entity, text)
          )
          raise ValueError(message)
  
      start = offsets.index(entity[ENTITY_ATTRIBUTE_START])
      end = ends.index(entity[ENTITY_ATTRIBUTE_END]) + 1
      return start, end
  
imports: import abc
  from typing import Any, Dict, List, NamedTuple, Text, Tuple, Optional
  import rasa.shared.utils.io
  from rasa.shared.constants import DOCS_URL_TRAINING_DATA_NLU
  from rasa.shared.nlu.training_data.training_data import TrainingData
  from rasa.shared.nlu.training_data.message import Message
  from rasa.nlu.tokenizers.tokenizer import Token
  from rasa.nlu.constants import TOKENS_NAMES, ENTITY_ATTRIBUTE_CONFIDENCE_TYPE, ENTITY_ATTRIBUTE_CONFIDENCE_ROLE, ENTITY_ATTRIBUTE_CONFIDENCE_GROUP
  from rasa.shared.nlu.constants import TEXT, INTENT, ENTITIES, ENTITY_ATTRIBUTE_VALUE, ENTITY_ATTRIBUTE_START, ENTITY_ATTRIBUTE_END, EXTRACTOR, ENTITY_ATTRIBUTE_TYPE, ENTITY_ATTRIBUTE_GROUP, ENTITY_ATTRIBUTE_ROLE, NO_ENTITY_TAG, SPLIT_ENTITIES_BY_COMMA, SINGLE_ENTITY_ALLOWED_INTERLEAVING_CHARSET
  import rasa.utils.train_utils
label_desc: Use image node_id 5 for calling the EntityExtractorMixin obj's underlying member method code with example usage: obj.find_entity(entity, text, tokens) and returns: start,  end