Package opennlp.dl

Class AbstractDL

java.lang.Object
opennlp.dl.AbstractDL
Direct Known Subclasses:
DocumentCategorizerDL, NameFinderDL, SentenceVectorsDL

public abstract class AbstractDL extends Object
Base class for OpenNLP deep-learning classes using ONNX Runtime.
  • Field Details

  • Constructor Details

    • AbstractDL

      public AbstractDL()
  • Method Details

    • loadVocab

      public Map<String,Integer> loadVocab(File vocabFile) throws IOException
      Loads a vocabulary File from disk.
      Parameters:
      vocabFile - The vocabulary file.
      Returns:
      A map of vocabulary words to integer IDs.
      Throws:
      IOException - Thrown if the vocabulary file cannot be opened or read.