Class QATranslator.BaseBuilder<T extends QATranslator.BaseBuilder>

  • Enclosing class:
    QATranslator

    public abstract static class QATranslator.BaseBuilder<T extends QATranslator.BaseBuilder>
    extends java.lang.Object
    The builder for question answering translator.
    • Constructor Detail

      • BaseBuilder

        public BaseBuilder()
    • Method Detail

      • optTokenizer

        public T optTokenizer​(java.lang.String tokenizer)
        Sets the name of the tokenizer for the Translator.
        Parameters:
        tokenizer - the name of the tokenizer
        Returns:
        this builder
      • optVocab

        public T optVocab​(java.lang.String vocab)
        Sets the name of the vocabulary file for the Translator.
        Parameters:
        vocab - name of the vocabulary file
        Returns:
        this builder
      • optLocale

        public T optLocale​(java.lang.String locale)
        Sets the name of the locale for the Translator.
        Parameters:
        locale - the name of the locale
        Returns:
        this builder
      • optToLowerCase

        public T optToLowerCase​(boolean toLowerCase)
        Sets the if convert text to lower case for the Translator.
        Parameters:
        toLowerCase - if convert text to lower case
        Returns:
        this builder
      • optIncludeTokenTypes

        public T optIncludeTokenTypes​(boolean includeTokenTypes)
        Sets the if include token types for the Translator.
        Parameters:
        includeTokenTypes - if include token types
        Returns:
        this builder
      • optPadding

        public T optPadding​(boolean padding)
        Sets the if pad the tokens for the Translator.
        Parameters:
        padding - if pad the tokens
        Returns:
        this builder
      • optTruncation

        public T optTruncation​(boolean truncation)
        Sets the if truncate the tokens for the Translator.
        Parameters:
        truncation - if truncate the tokens
        Returns:
        this builder
      • optMaxLength

        public T optMaxLength​(int maxLength)
        Sets the max number of tokens for the Translator.
        Parameters:
        maxLength - the max number of tokens
        Returns:
        this builder
      • optMaxLabels

        public T optMaxLabels​(int maxLabels)
        Sets the max number of labels for the Translator.
        Parameters:
        maxLabels - the max number of labels
        Returns:
        this builder
      • configure

        public void configure​(java.util.Map<java.lang.String,​?> arguments)
        Configures the builder with the model arguments.
        Parameters:
        arguments - the model arguments
      • self

        protected abstract T self()