class_docstr: Pipeline component to label spans of text.
  
  DOCS: https://spacy.io/api/spancategorizer
class_docstr_tok: ["Pipeline","component","to","label","spans","of","text",".","DOCS",":","https",":","\/\/spacy.io\/api\/spancategorizer"]
docstr: Add a new label to the pipe.
  
  label (str): The label to add.
  RETURNS (int): 0 if label is already present, otherwise 1.
  
  DOCS: https://spacy.io/api/spancategorizer#add_label
docstr_tok: ["Add","a","new","label","to","the","pipe",".","label","(","str",")",":","The","label","to","add",".","RETURNS","(","int",")",":","0","if","label","is","already","present",",","otherwise","1",".","DOCS",":","https",":","\/\/spacy.io\/api\/spancategorizer","#","add_label"]
code: def add_label(self, label: str) -> int:
      """Add a new label to the pipe.
  
      label (str): The label to add.
      RETURNS (int): 0 if label is already present, otherwise 1.
  
      DOCS: https://spacy.io/api/spancategorizer#add_label
      """
      if not isinstance(label, str):
          raise ValueError(Errors.E187)
      if label in self.labels:
          return 0
      self._allow_extra_label()
      self.cfg["labels"].append(label)  # type: ignore
      self.vocab.strings.add(label)
      return 1
  
imports: from dataclasses import dataclass
  from functools import partial
  from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple, Union, cast
  import numpy
  from thinc.api import Config, Model, Ops, Optimizer, get_current_ops, set_dropout_rate
  from thinc.types import Floats2d, Ints1d, Ints2d, Ragged
  from ..compat import Protocol, runtime_checkable
  from ..errors import Errors
  from ..language import Language
  from ..scorer import Scorer
  from ..tokens import Doc, Span, SpanGroup
  from ..training import Example, validate_examples
  from ..util import registry
  from ..vocab import Vocab
  from .trainable_pipe import TrainablePipe
label_desc: Use image node_id 4 for calling the SpanCategorizer obj's underlying member method code with example usage: obj.add_label(label) and returns: int, int