Accenture / AmpliGraph

Python library for Representation Learning on Knowledge Graphs https://docs.ampligraph.org
Apache License 2.0
2.12k stars 252 forks source link

discovery.py library, discover_facts function, when returning np.hstack if some array is empty #269

Open JRCabrejas opened 1 year ago

JRCabrejas commented 1 year ago

Description

There is an error when calling np.hstack because one of the arrays are empty (when returbing data) Installed version 1.4

Actual Behavior

ValueError: all the input array dimensions for the concatenation axis must match exactly, but along dimension 0, the array at index 0 has size 0 and the array at index 2 has size 2

Expected Behavior

before adding an empty array to discoveries and/or discovery_ranks lists, empty array should not being append to the list

Steps to Reproduce

just try with few candidates but it depends of your dartaset of triples