get_relation_cardinality_types_df

get_relation_cardinality_types_df(*, dataset: Dataset, parts: Collection[str] | None = None, add_labels: bool = True) DataFrame[source]

Determine the relation cardinality types.

The possible types are given in relation_cardinality_types.

Note

In the current implementation, we have by definition

\[1 = \sum_{type} conf(relation, type)\]

Note

These relation types are also mentioned in [wang2014]. However, the paper does not provide any details on their definition, nor is any code provided. Thus, their exact procedure is unknown and may not coincide with this implementation.

Parameters:
  • dataset (Dataset) – The dataset to investigate.

  • parts (Collection[str] | None) – Only use certain parts of the dataset, e.g., train triples. Defaults to using all triples, i.e. {“training”, “validation”, “testing}.

  • add_labels (bool) – Whether to add relation labels (if available).

Returns:

A dataframe with columns ( relation_id | relation_type )

Return type:

DataFrame