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 a visual representations for Wikidata entities from a triples factory.
  
  :param triples_factory:
      the triples factory
  :param for_entities:
      whether to create the initializer for entities (or relations)
  :param kwargs:
      additional keyword-based arguments passed to :meth:`WikidataVisualRepresentation.__init__`
  
  :returns:
      a visual representation from the triples factory
docstr_tok: ["Prepare","a","visual","representations","for","Wikidata","entities","from","a","triples","factory",".",":","param","triples_factory",":","the","triples","factory",":","param","for_entities",":","whether","to","create","the","initializer","for","entities","(","or","relations",")",":","param","kwargs",":","additional","keyword-based","arguments","passed","to",":","meth",":","`","WikidataVisualRepresentation.__init__","`",":","returns",":","a","visual","representation","from","the","triples","factory"]
code: def from_triples_factory(
      cls,
      triples_factory: TriplesFactory,
      for_entities: bool = True,
      **kwargs,
  ) -> "WikidataVisualRepresentation":
      """
      Prepare a visual representations for Wikidata entities from a triples factory.
  
      :param triples_factory:
          the triples factory
      :param for_entities:
          whether to create the initializer for entities (or relations)
      :param kwargs:
          additional keyword-based arguments passed to :meth:`WikidataVisualRepresentation.__init__`
  
      :returns:
          a visual representation from the triples factory
      """
      return cls(
          wikidata_ids=(
              triples_factory.entity_labeling
              if for_entities
              else triples_factory.relation_labeling
          ).all_labels(),
          **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 2 for calling the WikidataVisualRepresentation obj's underlying member method code with example usage: obj.from_triples_factory(cls, triples_factory, for_entities) and returns: cls