class_docstr: Construct a LUKE tokenizer.
  
  This tokenizer inherits from [`RobertaTokenizer`] which contains most of the main methods. Users should refer to
  this superclass for more information regarding those methods. Compared to [`RobertaTokenizer`], [`LukeTokenizer`]
  also creates entity sequences, namely `entity_ids`, `entity_attention_mask`, `entity_token_type_ids`, and
  `entity_position_ids` to be used by the LUKE model.
  
  Args:
      vocab_file (`str`):
          Path to the vocabulary file.
      merges_file (`str`):
          Path to the merges file.
      entity_vocab_file (`str`):
          Path to the entity vocabulary file.
      task (`str`, *optional*):
          Task for which you want to prepare sequences. One of `"entity_classification"`,
          `"entity_pair_classification"`, or `"entity_span_classification"`. If you specify this argument, the entity
          sequence is automatically created based on the given entity span(s).
      max_entity_length (`int`, *optional*, defaults to 32):
          The maximum length of `entity_ids`.
      max_mention_length (`int`, *optional*, defaults to 30):
          The maximum number of tokens inside an entity span.
      entity_token_1 (`str`, *optional*, defaults to `<ent>`):
          The special token used to represent an entity span in a word token sequence. This token is only used when
          `task` is set to `"entity_classification"` or `"entity_pair_classification"`.
      entity_token_2 (`str`, *optional*, defaults to `<ent2>`):
          The special token used to represent an entity span in a word token sequence. This token is only used when
          `task` is set to `"entity_pair_classification"`.
class_docstr_tok: ["Construct","a","LUKE","tokenizer",".","This","tokenizer","inherits","from","[","`","RobertaTokenizer","`","]","which","contains","most","of","the","main","methods",".","Users","should","refer","to","this","superclass","for","more","information","regarding","those","methods",".","Compared","to","[","`","RobertaTokenizer","`","]",",","[","`","LukeTokenizer","`","]","also","creates","entity","sequences",",","namely","`","entity_ids","`",",","`","entity_attention_mask","`",",","`","entity_token_type_ids","`",",","and","`","entity_position_ids","`","to","be","used","by","the","LUKE","model",".","Args",":","vocab_file","(","`","str","`",")",":","Path","to","the","vocabulary","file",".","merges_file","(","`","str","`",")",":","Path","to","the","merges","file",".","entity_vocab_file","(","`","str","`",")",":","Path","to","the","entity","vocabulary","file",".","task","(","`","str","`",",","*","optional","*",")",":","Task","for","which","you","want","to","prepare","sequences",".","One","of","`","``","entity_classification","''","`",",","`","``","entity_pair_classification","''","`",",","or","`","``","entity_span_classification","''","`",".","If","you","specify","this","argument",",","the","entity","sequence","is","automatically","created","based","on","the","given","entity","span","(","s",")",".","max_entity_length","(","`","int","`",",","*","optional","*",",","defaults","to","32",")",":","The","maximum","length","of","`","entity_ids","`",".","max_mention_length","(","`","int","`",",","*","optional","*",",","defaults","to","30",")",":","The","maximum","number","of","tokens","inside","an","entity","span",".","entity_token_1","(","`","str","`",",","*","optional","*",",","defaults","to","`","<","ent",">","`",")",":","The","special","token","used","to","represent","an","entity","span","in","a","word","token","sequence",".","This","token","is","only","used","when","`","task","`","is","set","to","`","``","entity_classification","''","`","or","`","``","entity_pair_classification","''","`",".","entity_token_2","(","`","str","`",",","*","optional","*",",","defaults","to","`","<","ent2",">","`",")",":","The","special","token","used","to","represent","an","entity","span","in","a","word","token","sequence",".","This","token","is","only","used","when","`","task","`","is","set","to","`","``","entity_pair_classification","''","`","."]
code: def _encode_plus(
      self,
      text: Union[TextInput],
      text_pair: Optional[Union[TextInput]] = None,
      entity_spans: Optional[EntitySpanInput] = None,
      entity_spans_pair: Optional[EntitySpanInput] = None,
      entities: Optional[EntityInput] = None,
      entities_pair: Optional[EntityInput] = None,
      add_special_tokens: bool = True,
      padding_strategy: PaddingStrategy = PaddingStrategy.DO_NOT_PAD,
      truncation_strategy: TruncationStrategy = TruncationStrategy.DO_NOT_TRUNCATE,
      max_length: Optional[int] = None,
      max_entity_length: Optional[int] = None,
      stride: int = 0,
      is_split_into_words: Optional[bool] = False,
      pad_to_multiple_of: Optional[int] = None,
      return_tensors: Optional[Union[str, TensorType]] = None,
      return_token_type_ids: Optional[bool] = None,
      return_attention_mask: Optional[bool] = None,
      return_overflowing_tokens: bool = False,
      return_special_tokens_mask: bool = False,
      return_offsets_mapping: bool = False,
      return_length: bool = False,
      verbose: bool = True,
      **kwargs,
  ) -> BatchEncoding:
      if return_offsets_mapping:
          raise NotImplementedError(
              "return_offset_mapping is not available when using Python tokenizers. "
              "To use this feature, change your tokenizer to one deriving from "
              "transformers.PreTrainedTokenizerFast. "
              "More information on available tokenizers at "
              "https://github.com/huggingface/transformers/pull/2674"
          )
  
      if is_split_into_words:
          raise NotImplementedError(
              "is_split_into_words is not supported in this tokenizer."
          )
  
      (
          first_ids,
          second_ids,
          first_entity_ids,
          second_entity_ids,
          first_entity_token_spans,
          second_entity_token_spans,
      ) = self._create_input_sequence(
          text=text,
          text_pair=text_pair,
          entities=entities,
          entities_pair=entities_pair,
          entity_spans=entity_spans,
          entity_spans_pair=entity_spans_pair,
          **kwargs,
      )
  
      # prepare_for_model will create the attention_mask and token_type_ids
      return self.prepare_for_model(
          first_ids,
          pair_ids=second_ids,
          entity_ids=first_entity_ids,
          pair_entity_ids=second_entity_ids,
          entity_token_spans=first_entity_token_spans,
          pair_entity_token_spans=second_entity_token_spans,
          add_special_tokens=add_special_tokens,
          padding=padding_strategy.value,
          truncation=truncation_strategy.value,
          max_length=max_length,
          max_entity_length=max_entity_length,
          stride=stride,
          pad_to_multiple_of=pad_to_multiple_of,
          return_tensors=return_tensors,
          prepend_batch_axis=True,
          return_attention_mask=return_attention_mask,
          return_token_type_ids=return_token_type_ids,
          return_overflowing_tokens=return_overflowing_tokens,
          return_special_tokens_mask=return_special_tokens_mask,
          return_length=return_length,
          verbose=verbose,
      )
  
imports: import itertools
  import json
  import os
  from collections.abc import Mapping
  from typing import Dict, List, Optional, Tuple, Union
  import numpy
  from ...None import RobertaTokenizer
  from ...tokenization_utils_base import ENCODE_KWARGS_DOCSTRING, AddedToken, BatchEncoding, EncodedInput, PaddingStrategy, TensorType, TextInput, TextInputPair, TruncationStrategy, to_py_obj
  from ...utils import add_end_docstrings, is_tf_tensor, is_torch_tensor, logging
label_desc: Use image node_id 3 for calling the LukeTokenizer obj's underlying member method code with example usage: obj._encode_plus(text, text_pair, entity_spans, entity_spans_pair, entities, entities_pair, add_special_tokens, padding_strategy, truncation_strategy, max_length, max_entity_length, stride, is_split_into_words, pad_to_multiple_of, return_tensors, return_token_type_ids, return_attention_mask, return_overflowing_tokens, return_special_tokens_mask, return_offsets_mapping, return_length, verbose) and returns: self