to_idx

ampligraph.evaluation.to_idx(X, ent_to_idx, rel_to_idx)

Convert statements (triples) into integer IDs.

Parameters:
  • X (ndarray) – The statements to be converted.
  • ent_to_idx (dict) – The mappings between entity strings and internal IDs.
  • rel_to_idx (dict) – The mappings between relation strings and internal IDs.
Returns:

X – The ndarray of converted statements.

Return type:

ndarray, shape [n, 3]