class_docstr: Token classification evaluator.
  
  This token classification evaluator can currently be loaded from [`evaluator`] using the default task name
  `token-classification`.
  
  Methods in this class assume a data format compatible with the [`~transformers.TokenClassificationPipeline`].
class_docstr_tok: ["Token","classification","evaluator",".","This","token","classification","evaluator","can","currently","be","loaded","from","[","`","evaluator","`","]","using","the","default","task","name","`","token-classification","`",".","Methods","in","this","class","assume","a","data","format","compatible","with","the","[","`","~transformers.TokenClassificationPipeline","`","]","."]
docstr: Convert a list of words to a list of offsets, where word are joined by `join_by`.
  
  Args:
      words (`List[str]`):
          List of words to get offsets from.
      join_by (`str`):
          String to insert between words.
  
  Returns:
      `List[Tuple[int, int]]`: List of the characters (start index, end index) for each of the words.
docstr_tok: ["Convert","a","list","of","words","to","a","list","of","offsets",",","where","word","are","joined","by","`","join_by","`",".","Args",":","words","(","`","List","[","str","]","`",")",":","List","of","words","to","get","offsets","from",".","join_by","(","`","str","`",")",":","String","to","insert","between","words",".","Returns",":","`","List","[","Tuple","[","int",",","int","]","]","`",":","List","of","the","characters","(","start","index",",","end","index",")","for","each","of","the","words","."]
code: def words_to_offsets(self, words: List[str], join_by: str):
      """
      Convert a list of words to a list of offsets, where word are joined by `join_by`.
  
      Args:
          words (`List[str]`):
              List of words to get offsets from.
          join_by (`str`):
              String to insert between words.
  
      Returns:
          `List[Tuple[int, int]]`: List of the characters (start index, end index) for each of the words.
      """
      offsets = []
  
      start = 0
      for word in words:
          end = start + len(word) - 1
          offsets.append((start, end))
          start = end + len(join_by) + 1
  
      return offsets
  
file_path: evaluate/src/evaluate/evaluator/token_classification.py
imports: from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Tuple, Union
  from datasets import ClassLabel, Dataset, Sequence
  from typing_extensions import Literal
  from ..module import EvaluationModule
  from ..utils.file_utils import add_end_docstrings, add_start_docstrings
  from .base import EVALUATOR_COMPUTE_RETURN_DOCSTRING, EVALUTOR_COMPUTE_START_DOCSTRING, Evaluator
  from .utils import DatasetColumn
label_desc: Use image node_id 3 for calling the TokenClassificationEvaluator obj's underlying member method code with example usage: obj.words_to_offsets(words, join_by) and returns: offsets