class_docstr: Use this indexer when (for whatever reason) you are not using a corresponding
  `PretrainedTransformerTokenizer` on your input. We assume that you used a tokenizer that splits
  strings into words, while the transformer expects wordpieces as input. This indexer splits the
  words into wordpieces and flattens them out. You should use the corresponding
  `PretrainedTransformerMismatchedEmbedder` to embed these wordpieces and then pull out a single
  vector for each original word.
  
  Registered as a `TokenIndexer` with name "pretrained_transformer_mismatched".
  
  # Parameters
  
  model_name : `str`
      The name of the `transformers` model to use.
  namespace : `str`, optional (default=`tags`)
      We will add the tokens in the pytorch_transformer vocabulary to this vocabulary namespace.
      We use a somewhat confusing default value of `tags` so that we do not add padding or UNK
      tokens to this namespace, which would break on loading because we wouldn't find our default
      OOV token.
  max_length : `int`, optional (default = `None`)
      If positive, split the document into segments of this many tokens (including special tokens)
      before feeding into the embedder. The embedder embeds these segments independently and
      concatenate the results to get the original document representation. Should be set to
      the same value as the `max_length` option on the `PretrainedTransformerMismatchedEmbedder`.
  tokenizer_kwargs : `Dict[str, Any]`, optional (default = `None`)
      Dictionary with
      [additional arguments](https://github.com/huggingface/transformers/blob/155c782a2ccd103cf63ad48a2becd7c76a7d2115/transformers/tokenization_utils.py#L691)
      for `AutoTokenizer.from_pretrained`.
class_docstr_tok: ["Use","this","indexer","when","(","for","whatever","reason",")","you","are","not","using","a","corresponding","`","PretrainedTransformerTokenizer","`","on","your","input",".","We","assume","that","you","used","a","tokenizer","that","splits","strings","into","words",",","while","the","transformer","expects","wordpieces","as","input",".","This","indexer","splits","the","words","into","wordpieces","and","flattens","them","out",".","You","should","use","the","corresponding","`","PretrainedTransformerMismatchedEmbedder","`","to","embed","these","wordpieces","and","then","pull","out","a","single","vector","for","each","original","word",".","Registered","as","a","`","TokenIndexer","`","with","name","``","pretrained_transformer_mismatched","''",".","#","Parameters","model_name",":","`","str","`","The","name","of","the","`","transformers","`","model","to","use",".","namespace",":","`","str","`",",","optional","(","default=","`","tags","`",")","We","will","add","the","tokens","in","the","pytorch_transformer","vocabulary","to","this","vocabulary","namespace",".","We","use","a","somewhat","confusing","default","value","of","`","tags","`","so","that","we","do","not","add","padding","or","UNK","tokens","to","this","namespace",",","which","would","break","on","loading","because","we","would","n't","find","our","default","OOV","token",".","max_length",":","`","int","`",",","optional","(","default","=","`","None","`",")","If","positive",",","split","the","document","into","segments","of","this","many","tokens","(","including","special","tokens",")","before","feeding","into","the","embedder",".","The","embedder","embeds","these","segments","independently","and","concatenate","the","results","to","get","the","original","document","representation",".","Should","be","set","to","the","same","value","as","the","`","max_length","`","option","on","the","`","PretrainedTransformerMismatchedEmbedder","`",".","tokenizer_kwargs",":","`","Dict","[","str",",","Any","]","`",",","optional","(","default","=","`","None","`",")","Dictionary","with","[","additional","arguments","]","(","https",":","\/\/github.com\/huggingface\/transformers\/blob\/155c782a2ccd103cf63ad48a2becd7c76a7d2115\/transformers\/tokenization_utils.py","#","L691",")","for","`","AutoTokenizer.from_pretrained","`","."]
code: def count_vocab_items(
      self, token: Token, counter: Dict[str, Dict[str, int]]
  ):
      return self._matched_indexer.count_vocab_items(token, counter)
  
file_path: allennlp/allennlp/data/token_indexers/pretrained_transformer_mismatched_indexer.py
imports: from typing import Dict, List, Any, Optional
  import logging
  import torch
  from allennlp.common.util import pad_sequence_to_length
  from allennlp.data.vocabulary import Vocabulary
  from allennlp.data.tokenizers import Token
  from allennlp.data.token_indexers import PretrainedTransformerIndexer, TokenIndexer
  from allennlp.data.token_indexers.token_indexer import IndexedTokenList
label_desc: Use image node_id 2 for calling the PretrainedTransformerMismatchedIndexer obj's underlying member method code with example usage: obj.count_vocab_items(token, counter) and returns: self