class_docstr: Visual representations obtained from Wikidata and encoded with a vision encoder.
  
  If no image could be found for a certain Wikidata ID, a plain (trainable) embedding will be used instead.
  
  Example usage::
  
  .. code-block:: python
  
      from pykeen.datasets import get_dataset
      from pykeen.models import ERModel
      from pykeen.nn import WikidataVisualRepresentation
      from pykeen.pipeline import pipeline
  
      dataset = get_dataset(dataset="codexsmall")
      entity_representations = WikidataVisualRepresentation.from_dataset(dataset=dataset)
  
      result = pipeline(
          dataset=dataset,
          model=ERModel,
          model_kwargs=dict(
              interaction="distmult",
              entity_representations=entity_representations,
              relation_representation_kwargs=dict(
                  shape=entity_representations.shape,
              ),
          ),
      )
  
  ---
  name: Wikidata Visual
docstr: Prepare representations from a dataset.
  
  :param dataset:
      the dataset; needs to have Wikidata IDs as entity names
  :param kwargs:
      additional keyword-based parameters passed to
      :meth:`WikidataVisualRepresentation.from_triples_factory`
  
  :return:
      the representation
  
  :raises TypeError:
      if the triples factory does not provide labels
docstr_tok: ["Prepare","representations","from","a","dataset",".",":","param","dataset",":","the","dataset",";","needs","to","have","Wikidata","IDs","as","entity","names",":","param","kwargs",":","additional","keyword-based","parameters","passed","to",":","meth",":","`","WikidataVisualRepresentation.from_triples_factory","`",":","return",":","the","representation",":","raises","TypeError",":","if","the","triples","factory","does","not","provide","labels"]
code: def from_dataset(
      cls,
      dataset: Dataset,
      **kwargs,
  ) -> "WikidataVisualRepresentation":
      """Prepare representations from a dataset.
  
      :param dataset:
          the dataset; needs to have Wikidata IDs as entity names
      :param kwargs:
          additional keyword-based parameters passed to
          :meth:`WikidataVisualRepresentation.from_triples_factory`
  
      :return:
          the representation
  
      :raises TypeError:
          if the triples factory does not provide labels
      """
      if not isinstance(dataset.training, TriplesFactory):
          raise TypeError(
              f"{cls.__name__} requires access to labels, but dataset.training does not provide such."
          )
      return cls.from_triples_factory(
          triples_factory=dataset.training, **kwargs
      )
  
imports: import functools
  import pathlib
  from typing import Any, Callable, Optional, Sequence, Union
  import torch
  import torch.nn
  import torch.utils.data
  from class_resolver import OptionalKwargs
  from docdata import parse_docdata
  from .representation import BackfillRepresentation, Representation
  from .utils import ShapeError, WikidataCache
  from ..datasets import Dataset
  from ..triples import TriplesFactory
  from ..typing import OneOrSequence
label_desc: Use image node_id 3 for calling the WikidataVisualRepresentation obj's underlying member method code with example usage: obj.from_dataset(cls, dataset) and returns: cls