_encode_plus(text, {
        text_pair = null,
        add_special_tokens = true,
        return_token_type_ids = null,
    } = {}) {

        const { tokens, token_type_ids } = this._tokenize_helper(text, { pair: text_pair, add_special_tokens });

        const input_ids = this.model.convert_tokens_to_ids(tokens);

        const result = {
            input_ids,
            attention_mask: new Array(input_ids.length).fill(1),
        }
        if ((return_token_type_ids ?? this.return_token_type_ids) && token_type_ids) {
            result.token_type_ids = token_type_ids;
        }
        return result;
    }
Encodes a single text or a pair of texts using the model's tokenizer.

@param {string} text The text to encode.
@param {Object} options An optional object containing the following properties:
@param {string} [options.text_pair=null] The optional second text to encode.
@param {boolean} [options.add_special_tokens=true] Whether or not to add the special tokens associated with the corresponding model.
@param {boolean} [options.return_token_type_ids=null] Whether to return token_type_ids.
@returns {EncodingSingle} An object containing the encoded text.
@private