class_docstr: Reader for NLU training data.
docstr: Loads training data stored in the Dialogflow data format.
docstr_tok: ["Loads","training","data","stored","in","the","Dialogflow","data","format","."]
code: def read(
      self, filename: Union[Text, Path], **kwargs: Any
  ) -> "TrainingData":
      """Loads training data stored in the Dialogflow data format."""
      language = kwargs["language"]
      fformat = kwargs["fformat"]
  
      if fformat not in {DIALOGFLOW_INTENT, DIALOGFLOW_ENTITIES}:
          raise ValueError(
              "fformat must be either {}, or {}"
              "".format(DIALOGFLOW_INTENT, DIALOGFLOW_ENTITIES)
          )
  
      root_js = rasa.shared.utils.io.read_json_file(filename)
  
      if isinstance(filename, Path):
          filename = str(filename)
  
      examples = self._read_examples(filename, language, fformat)
  
      if not examples:
          rasa.shared.utils.io.raise_warning(
              f"No training examples found for dialogflow file {filename}!",
              docs=DOCS_URL_MIGRATE_GOOGLE,
          )
          return TrainingData()
      elif fformat == DIALOGFLOW_INTENT:
          return self._read_intent(root_js, examples)
      else:  # path for DIALOGFLOW_ENTITIES
          return self._read_entities(root_js, examples)
  
imports: import logging
  import os
  from pathlib import Path
  from typing import Any, Dict, Optional, Text, List, Tuple, Union
  import rasa.shared.nlu.training_data.util
  from rasa.shared.constants import DOCS_BASE_URL
  from rasa.shared.nlu.training_data.formats.readerwriter import TrainingDataReader
  from rasa.shared.nlu.training_data.util import transform_entity_synonyms
  import rasa.shared.utils.io
  from rasa.shared.nlu.training_data.training_data import TrainingData
  from rasa.shared.nlu.training_data.message import Message
label_desc: Use image node_id 1 for calling the DialogflowReader obj's underlying member method code with example usage: obj.read(filename) and returns: TrainingData, self, self