Class BPETokenizerFactory

java.lang.Object
opennlp.tools.util.BaseToolFactory
opennlp.tools.tokenize.BPETokenizerFactory

public class BPETokenizerFactory extends BaseToolFactory
A BaseToolFactory for BPE tokenization that manages the BPE merge rules artifact and its serialization within a BPEModel.

This factory is responsible for:

This class is typically not used directly. It is instantiated internally by BPETokenizerTrainer during training and by BPEModel during model loading.

See Also:
  • Field Details

    • MERGES_ENTRY_NAME

      static final String MERGES_ENTRY_NAME
      The artifact entry name for BPE merge rules.
      See Also:
    • languageCode

      private String languageCode
      The ISO language code.
  • Constructor Details

    • BPETokenizerFactory

      public BPETokenizerFactory()
      Creates a BPETokenizerFactory. Required empty constructor for model loading.
    • BPETokenizerFactory

      public BPETokenizerFactory(String langCode)
      Creates a BPETokenizerFactory with the given language code.
      Parameters:
      langCode - The ISO language code. Must not be null.
      Throws:
      IllegalArgumentException - if langCode is null.
  • Method Details