Skip to content

visual_entailment

allennlp_models.vision.dataset_readers.visual_entailment

[SOURCE]


VisualEntailmentReader#

@DatasetReader.register("visual-entailment")
class VisualEntailmentReader(VisionReader)

The dataset reader for visual entailment.

text_to_instance#

class VisualEntailmentReader(VisionReader):
 | ...
 | def text_to_instance(
 |     self,
 |     image: Union[str, Tuple[Tensor, Tensor, Optional[Tensor], Optional[Tensor]]],
 |     hypothesis: str,
 |     label: Optional[str] = None,
 |     *,
 |     use_cache: bool = True
 | ) -> Instance

apply_token_indexers#

class VisualEntailmentReader(VisionReader):
 | ...
 | def apply_token_indexers(self, instance: Instance) -> None