- consume_scores(model, dataset, *consumers, batch_size=1, mode=None)
Batch-wise calculation of all triple scores and consumption.
From a high-level perspective, this method does the following:
for batch in dataset: scores = model.predict(batch) for consumer in consumers: consumer(batch, scores)
By bringing custom prediction datasets and/or score consumers, this method is highly configurable.
Model) – the model used to calculate scores
PredictionDataset) – the dataset defining the prediction tasks, i.e., inputs to model.predict to loop over.
ScoreConsumer) – the consumers of score batches
int) – the batch size to use. Will automatically be lowered, if the hardware cannot handle this large batch sizes
ValueError – if no score consumers are given
- Return type: