ExtraRelationGraphPairCombinator

class ExtraRelationGraphPairCombinator[source]

Bases: GraphPairCombinator[FactoryType]

This combinator keeps all entities, but introduces a novel alignment relation.

Attributes Summary

ALIGNMENT_RELATION_NAME

the name of the additional alignment relation

Methods Summary

process(mapped_triples, alignment, offsets)

Process the combined mapped triples.

Attributes Documentation

ALIGNMENT_RELATION_NAME: ClassVar[str] = 'same-as'

the name of the additional alignment relation

Methods Documentation

process(mapped_triples: Tensor, alignment: Tensor, offsets: Tensor) ProcessedTuple[source]

Process the combined mapped triples.

Parameters:
  • mapped_triples (Tensor) – shape: (n, 3) the id-based merged triples

  • alignment (Tensor) – shape: (2, m) the id-based entity alignment

  • offsets (Tensor) – shape: (2, 2) the entity and relation offsets from merging

Returns:

updated triples and alignment tensor, as well as parameters for updating label-to-id mappings

Return type:

ProcessedTuple