code: def _get_valid_text_attribute(self, sample_info):
      if "captions" in sample_info:
          return "captions"
  
      if "sentences" in sample_info:
          return "sentences"
  
      raise AttributeError("No valid text attribution was found")
  
file_path: mmf/mmf/datasets/builders/retrieval/dataset.py
imports: import random
  import torch
  from mmf.common.sample import Sample, SampleList
  from mmf.common.typings import MMFDatasetConfigType
  from mmf.datasets.builders.retrieval.datasets import CaptionsDatabase, COCOAnnotationDatabase, ConceptualCaptionsDatabase
  from mmf.datasets.mmf_dataset import MMFDataset
label_desc: Use image node_id 3 for calling the RetrievalDataset obj's underlying member method code with example usage: obj._get_valid_text_attribute(sample_info) and returns: str, str