Class BertFullTokenizer

    • Constructor Detail

      • BertFullTokenizer

        public BertFullTokenizer​(Vocabulary vocabulary,
                                 boolean lowerCase)
        Creates an instance of BertFullTokenizer.
        Parameters:
        vocabulary - the BERT vocabulary
        lowerCase - whether to convert tokens to lowercase
    • Method Detail

      • tokenize

        public java.util.List<java.lang.String> tokenize​(java.lang.String input)
        Breaks down the given sentence into a list of tokens that can be represented by embeddings.
        Specified by:
        tokenize in interface Tokenizer
        Overrides:
        tokenize in class BertTokenizer
        Parameters:
        input - the sentence to tokenize
        Returns:
        a List of tokens
      • tokenToString

        public java.lang.String tokenToString​(java.util.List<java.lang.String> tokens)
        Returns a string presentation of the tokens.
        Overrides:
        tokenToString in class BertTokenizer
        Parameters:
        tokens - a list of tokens
        Returns:
        a string presentation of the tokens
      • getPreprocessors

        public static java.util.List<TextProcessor> getPreprocessors​(boolean lowerCase)
        Get a list of TextProcessors to process input text for Bert models.
        Parameters:
        lowerCase - whether to convert input to lowercase
        Returns:
        List of TextProcessors