ScoreConsumer

class ScoreConsumer[source]

Bases: object

A consumer of scores for visitor pattern.

Methods Summary

__call__(batch, target, scores)

Consume scores for the given hr_batch.

finalize()

Finalize the result to build a score pack.

Methods Documentation

abstract __call__(batch, target, scores)[source]

Consume scores for the given hr_batch.

Return type:

None

Parameters:
  • batch (LongTensor) –

  • target (Literal['head', 'relation', 'tail']) –

  • scores (FloatTensor) –

finalize()[source]

Finalize the result to build a score pack.

Return type:

ScorePack