class_docstr: Text classification pipeline using any `ModelForSequenceClassification`. See the [sequence classification
  examples](../task_summary#sequence-classification) for more information.
  
  This text classification pipeline can currently be loaded from [`pipeline`] using the following task identifier:
  `"sentiment-analysis"` (for classifying sequences according to positive or negative sentiments).
  
  If multiple classification labels are available (`model.config.num_labels >= 2`), the pipeline will run a softmax
  over the results. If there is a single label, the pipeline will run a sigmoid over the result.
  
  The models that this pipeline can use are models that have been fine-tuned on a sequence classification task. See
  the up-to-date list of available models on
  [huggingface.co/models](https://huggingface.co/models?filter=text-classification).
class_docstr_tok: ["Text","classification","pipeline","using","any","`","ModelForSequenceClassification","`",".","See","the","[","sequence","classification","examples","]","(","..","\/task_summary","#","sequence-classification",")","for","more","information",".","This","text","classification","pipeline","can","currently","be","loaded","from","[","`","pipeline","`","]","using","the","following","task","identifier",":","`","``","sentiment-analysis","''","`","(","for","classifying","sequences","according","to","positive","or","negative","sentiments",")",".","If","multiple","classification","labels","are","available","(","`","model.config.num_labels",">","=","2","`",")",",","the","pipeline","will","run","a","softmax","over","the","results",".","If","there","is","a","single","label",",","the","pipeline","will","run","a","sigmoid","over","the","result",".","The","models","that","this","pipeline","can","use","are","models","that","have","been","fine-tuned","on","a","sequence","classification","task",".","See","the","up-to-date","list","of","available","models","on","[","huggingface.co\/models","]","(","https",":","\/\/huggingface.co\/models","?","filter=text-classification",")","."]
code: def _sanitize_parameters(
      self,
      return_all_scores=None,
      function_to_apply=None,
      top_k="",
      **tokenizer_kwargs,
  ):
      # Using "" as default argument because we're going to use `top_k=None` in user code to declare
      # "No top_k"
      preprocess_params = tokenizer_kwargs
  
      postprocess_params = {}
      if (
          hasattr(self.model.config, "return_all_scores")
          and return_all_scores is None
      ):
          return_all_scores = self.model.config.return_all_scores
  
      if isinstance(top_k, int) or top_k is None:
          postprocess_params["top_k"] = top_k
          postprocess_params["_legacy"] = False
      elif return_all_scores is not None:
          warnings.warn(
              "`return_all_scores` is now deprecated,  if want a similar funcionality use `top_k=None` instead of"
              " `return_all_scores=True` or `top_k=1` instead of `return_all_scores=False`.",
              UserWarning,
          )
          if return_all_scores:
              postprocess_params["top_k"] = None
          else:
              postprocess_params["top_k"] = 1
  
      if isinstance(function_to_apply, str):
          function_to_apply = ClassificationFunction[
              function_to_apply.upper()
          ]
  
      if function_to_apply is not None:
          postprocess_params["function_to_apply"] = function_to_apply
      return preprocess_params, {}, postprocess_params
  
file_path: H2O/h2o_flexgen/benchmark/third_party/transformers/src/transformers/pipelines/text_classification.py
imports: import warnings
  from typing import Dict
  import numpy
  from ..utils import ExplicitEnum, add_end_docstrings, is_tf_available, is_torch_available
  from .base import PIPELINE_INIT_ARGS, GenericTensor, Pipeline
label_desc: Use image node_id 2 for calling the TextClassificationPipeline obj's underlying member method code with example usage: obj._sanitize_parameters(return_all_scores, function_to_apply, top_k) and returns: preprocess_params,  dict,  postprocess_params