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","."]
docstr: Create a new entity.
  
  Args:
      tag_names: The tag names to include in the entity.
      entity_tag: The entity type value.
      group_tag: The entity group value.
      role_tag: The entity role value.
      token: The token.
      confidence: The confidence value.
  
  Returns:
      Created entity.
docstr_tok: ["Create","a","new","entity",".","Args",":","tag_names",":","The","tag","names","to","include","in","the","entity",".","entity_tag",":","The","entity","type","value",".","group_tag",":","The","entity","group","value",".","role_tag",":","The","entity","role","value",".","token",":","The","token",".","confidence",":","The","confidence","value",".","Returns",":","Created","entity","."]
code: def _create_new_entity(
      tag_names: List[Text],
      entity_tag: Text,
      group_tag: Text,
      role_tag: Text,
      token: Token,
      idx: int,
      confidences: Optional[Dict[Text, List[float]]] = None,
  ) -> Dict[Text, Any]:
      """Create a new entity.
  
      Args:
          tag_names: The tag names to include in the entity.
          entity_tag: The entity type value.
          group_tag: The entity group value.
          role_tag: The entity role value.
          token: The token.
          confidence: The confidence value.
  
      Returns:
          Created entity.
      """
      entity = {
          ENTITY_ATTRIBUTE_TYPE: entity_tag,
          ENTITY_ATTRIBUTE_START: token.start,
          ENTITY_ATTRIBUTE_END: token.end,
      }
  
      if confidences is not None:
          entity[ENTITY_ATTRIBUTE_CONFIDENCE_TYPE] = confidences[
              ENTITY_ATTRIBUTE_TYPE
          ][idx]
  
      if (
          ENTITY_ATTRIBUTE_ROLE in tag_names
          and role_tag != NO_ENTITY_TAG
      ):
          entity[ENTITY_ATTRIBUTE_ROLE] = role_tag
          if confidences is not None:
              entity[ENTITY_ATTRIBUTE_CONFIDENCE_ROLE] = confidences[
                  ENTITY_ATTRIBUTE_ROLE
              ][idx]
      if (
          ENTITY_ATTRIBUTE_GROUP in tag_names
          and group_tag != NO_ENTITY_TAG
      ):
          entity[ENTITY_ATTRIBUTE_GROUP] = group_tag
          if confidences is not None:
              entity[ENTITY_ATTRIBUTE_CONFIDENCE_GROUP] = confidences[
                  ENTITY_ATTRIBUTE_GROUP
              ][idx]
  
      return entity
  
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 11 for calling the EntityExtractorMixin obj's underlying member method code with example usage: obj._create_new_entity(tag_names, entity_tag, group_tag, role_tag, token, idx, confidences) and returns: entity