API Reference

readout_sketch

monad.ui.module.readout_sketch

monad.ui.module.readout_sketch(predictions_file, checkpoint_path)

Generates a dictionary mapping score indexes to entity values.

from  monad.ui.module import readout_sketch

# declare variables
checkpoint_path = "<path/to/downstream/model/checkpoints>" # location of recommendation model checkpoints
predictions_file = "<path/to/predictions/my_predictions.tsv>" # location where encoded predictions are stored

# Get a generator yielding entity id and all scored products
sketch_readout_generator = readout_sketch(
  predictions_file=predictions_file, 
  checkpoint_path=checkpoint_path,
)
Parameters

predictions_file: str
Saved predictions using OutputType.ENCODED.


checkpoint_path: str
Path to saved model checkpoint.


Returns

Iterable[tuple[str, np.ndarray]], generator yielding entity id and all scored products.