Skip to content

next_token_lm

allennlp_models.lm.predictors.next_token_lm

[SOURCE]


NextTokenLMPredictor#

@Predictor.register("next_token_lm")
class NextTokenLMPredictor(Predictor)

predict#

class NextTokenLMPredictor(Predictor):
 | ...
 | def predict(self, sentence: str) -> JsonDict

predictions_to_labeled_instances#

class NextTokenLMPredictor(Predictor):
 | ...
 | @overrides
 | def predictions_to_labeled_instances(
 |     self,
 |     instance: Instance,
 |     outputs: Dict[str, numpy.ndarray]
 | )