class_docstr: Implements conditional random fields (CRF) to do named entity recognition.
class_docstr_tok: ["Implements","conditional","random","fields","(","CRF",")","to","do","named","entity","recognition","."]
docstr: Get the entity tags with the highest confidence.
  
  Args:
      predictions: list of mappings from entity tag to confidence value
  
  Returns:
      List of entity tags and list of confidence values.
docstr_tok: ["Get","the","entity","tags","with","the","highest","confidence",".","Args",":","predictions",":","list","of","mappings","from","entity","tag","to","confidence","value","Returns",":","List","of","entity","tags","and","list","of","confidence","values","."]
code: def _most_likely_tag(
      self, predictions: List[Dict[Text, float]]
  ) -> Tuple[List[Text], List[float]]:
      """Get the entity tags with the highest confidence.
  
      Args:
          predictions: list of mappings from entity tag to confidence value
  
      Returns:
          List of entity tags and list of confidence values.
      """
      _tags = []
      _confidences = []
  
      for token_predictions in predictions:
          tag = max(
              token_predictions, key=lambda key: token_predictions[key]
          )
          _tags.append(tag)
  
          if self.component_config[BILOU_FLAG]:
              # if we are using BILOU flags, we will sum up the prob
              # of the B, I, L and U tags for an entity
              _confidences.append(
                  sum(
                      _confidence
                      for _tag, _confidence in token_predictions.items()
                      if bilou_utils.tag_without_prefix(tag)
                      == bilou_utils.tag_without_prefix(_tag)
                  )
              )
          else:
              _confidences.append(token_predictions[tag])
  
      return _tags, _confidences
  
imports: from __future__ import annotations
  from collections import OrderedDict
  from enum import Enum
  import logging
  import typing
  import numpy
  from typing import Any, Dict, List, Optional, Text, Tuple, Callable, Type
  import rasa.nlu.utils.bilou_utils
  import rasa.shared.utils.io
  import rasa.utils.train_utils
  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.test import determine_token_labels
  from rasa.nlu.tokenizers.spacy_tokenizer import POS_TAG_KEY
  from rasa.nlu.extractors.extractor import EntityExtractorMixin
  from rasa.nlu.tokenizers.tokenizer import Token, Tokenizer
  from rasa.shared.nlu.training_data.training_data import TrainingData
  from rasa.shared.nlu.training_data.message import Message
  from rasa.nlu.constants import TOKENS_NAMES
  from rasa.shared.nlu.constants import TEXT, ENTITIES, ENTITY_ATTRIBUTE_TYPE, ENTITY_ATTRIBUTE_GROUP, ENTITY_ATTRIBUTE_ROLE, NO_ENTITY_TAG, SPLIT_ENTITIES_BY_COMMA, SPLIT_ENTITIES_BY_COMMA_DEFAULT_VALUE
  from rasa.shared.constants import DOCS_URL_COMPONENTS
  from rasa.utils.tensorflow.constants import BILOU_FLAG, FEATURIZERS
label_desc: Use image node_id 12 for calling the CRFEntityExtractor obj's underlying member method code with example usage: obj._most_likely_tag(predictions) and returns: _tags,  _confidences