rxn.metrics.classification_translation.classification_translation
- rxn.metrics.classification_translation.classification_translation(src_file, tgt_file, pred_file, model, n_best, beam_size, batch_size, gpu, max_length=3, as_external_command=False)[source]
Do a classification translation.
This function takes care of tokenizing/detokenizing the input.
Note: no check is made that the source is canonical.
- Parameters
src_file (
Union
[str
,Path
]) – source file (tokenized or detokenized).tgt_file (
Union
[str
,Path
,None
]) – ground truth class file (tokenized), not mandatory.pred_file (
Union
[str
,Path
]) – file where to save the predictions.model (
Union
[str
,Path
]) – model to do the translationn_best (
int
) – number of predictions to make for each input.beam_size (
int
) – beam size.batch_size (
int
) – batch size.gpu (
bool
) – whether to use the GPU.max_length (
int
, default:3
) – maximum sequence length.as_external_command (
bool
, default:False
) –
- Return type
None