class_docstr: Text data processor that reads parallel source and target text.
  This can be used in, e.g., seq2seq models.
  
  Args:
      hparams (dict): Hyperparameters. See :meth:`default_hparams` for the
          defaults.
  
  By default, the processor reads raw data files, performs tokenization,
  batching and other pre-processing steps, and results in a TF Dataset
  whose element is a python `dict` including six fields:
  
      - "source_text":
          A string Tensor of shape `[batch_size, max_time]` containing
          the **raw** text toknes of source sequences. `max_time` is the
          length of the longest sequence in the batch.
          Short sequences in the batch are padded with **empty string**.
          By default only EOS token is appended to each sequence.
          Out-of-vocabulary tokens are **NOT** replaced with UNK.
      - "source_text_ids":
          An `int64` Tensor of shape `[batch_size, max_time]`
          containing the token indexes of source sequences.
      - "source_length":
          An `int` Tensor of shape `[batch_size]` containing the
          length of each source sequence in the batch (including BOS and/or
          EOS if added).
      - "target_text":
          A string Tensor as "source_text" but for target sequences. By
          default both BOS and EOS are added.
      - "target_text_ids":
          An `int64` Tensor as "source_text_ids" but for target sequences.
      - "target_length":
          An `int` Tensor of shape `[batch_size]` as "source_length" but for
          target sequences.
  
  If :attr:`'variable_utterance'` is set to `True` in :attr:`'source_dataset'`
  and/or :attr:`'target_dataset'` of :attr:`hparams`, the corresponding
  fields "source_*" and/or "target_*" are respectively changed to contain
  variable utterance text data, as in :class:`~texar.tf.data.MonoTextData`.
  
  The above field names can be accessed through :attr:`source_text_name`,
  :attr:`source_text_id_name`, :attr:`source_length_name`,
  :attr:`source_utterance_cnt_name`, and those prefixed with `target_`,
  respectively.
  
  Example:
  
      .. code-block:: python
  
          hparams={
              'source_dataset': {'files': 's', 'vocab_file': 'vs'},
              'target_dataset': {'files': ['t1', 't2'], 'vocab_file': 'vt'},
              'batch_size': 1
          }
          data = PairedTextData(hparams)
          iterator = DataIterator(data)
          batch = iterator.get_next()
  
          iterator.switch_to_dataset(sess) # initializes the dataset
          batch_ = sess.run(batch)
          # batch_ == {
          #    'source_text': [['source', 'sequence', '<EOS>']],
          #    'source_text_ids': [[5, 10, 2]],
          #    'source_length': [3]
          #    'target_text': [['<BOS>', 'target', 'sequence', '1', '<EOS>']],
          #    'target_text_ids': [[1, 6, 10, 20, 2]],
          #    'target_length': [5]
          # }
class_docstr_tok: ["Text","data","processor","that","reads","parallel","source","and","target","text",".","This","can","be","used","in",",","e.g.",",","seq2seq","models",".","Args",":","hparams","(","dict",")",":","Hyperparameters",".","See",":","meth",":","`","default_hparams","`","for","the","defaults",".","By","default",",","the","processor","reads","raw","data","files",",","performs","tokenization",",","batching","and","other","pre-processing","steps",",","and","results","in","a","TF","Dataset","whose","element","is","a","python","`","dict","`","including","six","fields",":","-","``","source_text","''",":","A","string","Tensor","of","shape","`","[","batch_size",",","max_time","]","`","containing","the","*","*","raw","*","*","text","toknes","of","source","sequences",".","`","max_time","`","is","the","length","of","the","longest","sequence","in","the","batch",".","Short","sequences","in","the","batch","are","padded","with","*","*","empty","string","*","*",".","By","default","only","EOS","token","is","appended","to","each","sequence",".","Out-of-vocabulary","tokens","are","*","*","NOT","*","*","replaced","with","UNK",".","-","``","source_text_ids","''",":","An","`","int64","`","Tensor","of","shape","`","[","batch_size",",","max_time","]","`","containing","the","token","indexes","of","source","sequences",".","-","``","source_length","''",":","An","`","int","`","Tensor","of","shape","`","[","batch_size","]","`","containing","the","length","of","each","source","sequence","in","the","batch","(","including","BOS","and\/or","EOS","if","added",")",".","-","``","target_text","''",":","A","string","Tensor","as","``","source_text","''","but","for","target","sequences",".","By","default","both","BOS","and","EOS","are","added",".","-","``","target_text_ids","''",":","An","`","int64","`","Tensor","as","``","source_text_ids","''","but","for","target","sequences",".","-","``","target_length","''",":","An","`","int","`","Tensor","of","shape","`","[","batch_size","]","`","as","``","source_length","''","but","for","target","sequences",".","If",":","attr",":","`","'variable_utterance","'","`","is","set","to","`","True","`","in",":","attr",":","`","'source_dataset","'","`","and\/or",":","attr",":","`","'target_dataset","'","`","of",":","attr",":","`","hparams","`",",","the","corresponding","fields","``","source_","*","''","and\/or","``","target_","*","''","are","respectively","changed","to","contain","variable","utterance","text","data",",","as","in",":","class",":","`","~texar.tf.data.MonoTextData","`",".","The","above","field","names","can","be","accessed","through",":","attr",":","`","source_text_name","`",",",":","attr",":","`","source_text_id_name","`",",",":","attr",":","`","source_length_name","`",",",":","attr",":","`","source_utterance_cnt_name","`",",","and","those","prefixed","with","`","target_","`",",","respectively",".","Example",":","..","code-block",":",":","python","hparams=","{","'source_dataset","'",":","{","'files","'",":","'s","'",",","'vocab_file","'",":","'vs","'","}",",","'target_dataset","'",":","{","'files","'",":","[","'t1","'",",","'t2","'","]",",","'vocab_file","'",":","'vt","'","}",",","'batch_size","'",":","1","}","data","=","PairedTextData","(","hparams",")","iterator","=","DataIterator","(","data",")","batch","=","iterator.get_next","(",")","iterator.switch_to_dataset","(","sess",")","#","initializes","the","dataset","batch_","=","sess.run","(","batch",")","#","batch_","==","{","#","'source_text","'",":","[","[","'source","'",",","'sequence","'",",","'","<","EOS",">","'","]","]",",","#","'source_text_ids","'",":","[","[","5",",","10",",","2","]","]",",","#","'source_length","'",":","[","3","]","#","'target_text","'",":","[","[","'","<","BOS",">","'",",","'target","'",",","'sequence","'",",","'","1","'",",","'","<","EOS",">","'","]","]",",","#","'target_text_ids","'",":","[","[","1",",","6",",","10",",","20",",","2","]","]",",","#","'target_length","'",":","[","5","]","#","}"]
docstr: The name of the source text utterance count tensor,
  "source_utterance_cnt" by default.
docstr_tok: ["The","name","of","the","source","text","utterance","count","tensor",",","''","source_utterance_cnt","''","by","default","."]
code: def source_utterance_cnt_name(self):
      """The name of the source text utterance count tensor,
      "source_utterance_cnt" by default.
      """
      if not self._hparams.source_dataset.variable_utterance:
          raise ValueError(
              "`utterance_cnt_name` of source data is undefined."
          )
      name = dsutils._connect_name(
          self._data_spec.name_prefix[0],
          self._src_decoder.utterance_cnt_tensor_name,
      )
      return name
  
imports: import copy
  import tensorflow
  from texar.tf.utils import utils
  from texar.tf.utils.dtypes import is_callable
  from texar.tf.data.data.mono_text_data import _default_mono_text_dataset_hparams
  from texar.tf.data.data.text_data_base import TextDataBase
  from texar.tf.data.data.mono_text_data import MonoTextData
  from texar.tf.data.data_utils import count_file_lines
  from texar.tf.data.data import dataset_utils
  from texar.tf.data.vocabulary import Vocab, SpecialTokens
  from texar.tf.data.embedding import Embedding
label_desc: Use image node_id 25 for calling the PairedTextData obj's underlying member method code with example usage: obj.source_utterance_cnt_name() and returns: name