class_docstr: Labels each token in a sequence as belonging to 1 of N token classes.
  
  :param config: A :py:class:`finetune.config.Settings` object or None (for default config).
  :param \**kwargs: key-value pairs of config items to override.
class_docstr_tok: ["Labels","each","token","in","a","sequence","as","belonging","to","1","of","N","token","classes",".",":","param","config",":","A",":","py",":","class",":","`","finetune.config.Settings","`","object","or","None","(","for","default","config",")",".",":","param","\\","*","*","kwargs",":","key-value","pairs","of","config","items","to","override","."]
docstr: Produces a list of most likely class labels as determined by the fine-tuned model.
  
  :param X: A list / array of text, shape [batch]
  :param per_token: If True, return raw probabilities and labels on a per token basis
  :returns: list of class labels.
docstr_tok: ["Produces","a","list","of","most","likely","class","labels","as","determined","by","the","fine-tuned","model",".",":","param","X",":","A","list","\/","array","of","text",",","shape","[","batch","]",":","param","per_token",":","If","True",",","return","raw","probabilities","and","labels","on","a","per","token","basis",":","returns",":","list","of","class","labels","."]
code: def predict(
      self,
      X,
      per_token=False,
      context=None,
      return_negative_confidence=False,
      **kwargs,
  ):
      """
      Produces a list of most likely class labels as determined by the fine-tuned model.
  
      :param X: A list / array of text, shape [batch]
      :param per_token: If True, return raw probabilities and labels on a per token basis
      :returns: list of class labels.
      """
      if self.config.max_document_chars:
          # Split each document into N "pre chunks" or length self.config.max_document_chars
          # before feeding them into the input pipeline. The split_indices will be used to
          # rejoin the labels after prediction
          X, split_indices = self._pre_chunk_document(X)
  
      preds = super().predict(
          X,
          per_token=per_token,
          context=context,
          return_negative_confidence=return_negative_confidence,
          **kwargs,
      )
  
      if self.config.max_document_chars:
          preds = self._merge_chunked_preds(
              preds, split_indices, return_negative_confidence
          )
  
      return preds
  
imports: import copy
  import os
  from collections import Counter, defaultdict
  import math
  from typing import Dict, List, Tuple, Union
  import tensorflow
  import numpy
  from finetune.base import BaseModel
  from finetune.encoding.target_encoders import SequenceLabelingEncoder, SequenceMultiLabelingEncoder
  from finetune.nn.target_blocks import sequence_labeler
  from finetune.nn.crf import sequence_decode
  from finetune.encoding.sequence_encoder import finetune_to_indico_sequence
  from finetune.encoding.input_encoder import get_spacy
  from finetune.input_pipeline import BasePipeline
  from finetune.util.metrics import sequences_overlap
  from finetune.encoding.input_encoder import tokenize_context
label_desc: Use image node_id 7 for calling the SequenceLabeler obj's underlying member method code with example usage: obj.predict(X, per_token, context, return_negative_confidence) and returns: preds