class_docstr: A `SentenceSplitter` that uses spaCy's built-in sentence boundary detection.
  
  Spacy's default sentence splitter uses a dependency parse to detect sentence boundaries, so
  it is slow, but accurate.
  
  Another option is to use rule-based sentence boundary detection. It's fast and has a small memory footprint,
  since it uses punctuation to detect sentence boundaries. This can be activated with the `rule_based` flag.
  
  By default, `SpacySentenceSplitter` calls the default spacy boundary detector.
  
  Registered as a `SentenceSplitter` with name "spacy".
code: def __init__(
      self, language: str = "en_core_web_sm", rule_based: bool = False
  ) -> None:
      self._language = language
      self._rule_based = rule_based
  
      # we need spacy's dependency parser if we're not using rule-based sentence boundary detection.
      self.spacy = get_spacy_model(
          self._language, parse=not self._rule_based, ner=False
      )
      self._is_version_3 = spacy.__version__ >= "3.0"
      if rule_based:
          # we use `sentencizer`, a built-in spacy module for rule-based sentence boundary detection.
          # depending on the spacy version, it could be called 'sentencizer' or 'sbd'
          sbd_name = (
              "sbd" if spacy.__version__ < "2.1" else "sentencizer"
          )
          if not self.spacy.has_pipe(sbd_name):
              if self._is_version_3:
                  self.spacy.add_pipe(sbd_name)
              else:
                  sbd = self.spacy.create_pipe(sbd_name)
                  self.spacy.add_pipe(sbd)
  
file_path: allennlp/allennlp/data/tokenizers/sentence_splitter.py
imports: from typing import List, Dict, Any
  import spacy
  from allennlp.common import Registrable
  from allennlp.common.util import get_spacy_model
label_desc: Use image node_id 1 to create a new SpacySentenceSplitter object from inherited base classes: SentenceSplitter with example: obj = SpacySentenceSplitter(language, rule_based)