Package opennlp.dl

Class Tokens


  • public class Tokens
    extends Object
    Holds the tokens for input to an ONNX model.
    • Constructor Detail

      • Tokens

        public Tokens​(String[] tokens,
                      long[] ids,
                      long[] mask,
                      long[] types)
        Creates a new instance to hold the tokens for input to an ONNX model.
        Parameters:
        tokens - The tokens themselves.
        ids - The token IDs as retrieved from the vocabulary.
        mask - The token mask. (Typically all 1.)
        types - The token types. (Typically all 1.)
    • Method Detail

      • getTokens

        public String[] getTokens()
      • getIds

        public long[] getIds()
      • getMask

        public long[] getMask()
      • getTypes

        public long[] getTypes()