Next Sentence Prediction

Initialize a HappyNextSentence() object to next sentence prediction

Initialization Arguments:

  1. model_type (string): The default is “BERT”, which is currently the only available model
  2. model_name(string): We recommend BERT models like “bert-base-uncased” and “bert-large-uncased” that have not been finetuned
  3. use_auth_token (string): Specify the authentication token to load private models.
  4. trust_remote_code (bool): Allow for custom Python files to be used from the model_name location.

Example 6.0:

from happytransformer import HappyNextSentence
# --------------------------------------#
happy_ns = HappyNextSentence("BERT", "bert-base-uncased")  # default 
happy_ns_large = HappyNextSentence("BERT", "bert-large-uncased") 
happy_ns_private = HappyNextSentence("BERT", "ericfillion/bert-base-uncased", use_auth_token="123abc")

Table of contents