Token Classification

Initialize a HappyTokenClassification() object for token classification

Initialization Arguments:

  1. model_type (string): specify the model name in all caps, such as “ROBERTA” or “ALBERT”
  2. model_name(string): potential models can be found here
  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 5.0:

from happytransformer import HappyTokenClassification
# --------------------------------------#
happy_toc = HappyTokenClassification("BERT", "dslim/bert-base-NER")  # default 
happy_toc_large = HappyTokenClassification("XLM-ROBERTA", "xlm-roberta-large-finetuned-conll03-english") 
happy_toc_private = HappyTokenClassification("BERT", "user-repo/bert-base-NER", use_auth_token="123abc")

Table of contents