class_docstr: The EntityRuler lets you add spans to the `Doc.ents` using token-based
  rules or exact phrase matches. It can be combined with the statistical
  `EntityRecognizer` to boost accuracy, or used on its own to implement a
  purely rule-based entity recognition system. After initialization, the
  component is typically added to the pipeline using `nlp.add_pipe`.
  
  DOCS: https://spacy.io/api/entityruler
  USAGE: https://spacy.io/usage/rule-based-matching#entityruler
docstr: Initialize the pipe for training.
  
  get_examples (Callable[[], Iterable[Example]]): Function that
      returns a representative sample of gold-standard Example objects.
  nlp (Language): The current nlp object the component is part of.
  patterns Optional[Iterable[PatternType]]: The list of patterns.
  
  DOCS: https://spacy.io/api/entityruler#initialize
code: def initialize(
      self,
      get_examples: Callable[[], Iterable[Example]],
      *,
      nlp: Optional[Language] = None,
      patterns: Optional[Sequence[PatternType]] = None,
  ):
      """Initialize the pipe for training.
  
      get_examples (Callable[[], Iterable[Example]]): Function that
          returns a representative sample of gold-standard Example objects.
      nlp (Language): The current nlp object the component is part of.
      patterns Optional[Iterable[PatternType]]: The list of patterns.
  
      DOCS: https://spacy.io/api/entityruler#initialize
      """
      self.clear()
      if patterns:
          self.add_patterns(patterns)
  
imports: import warnings
  from collections import defaultdict
  from pathlib import Path
  from typing import Any, Callable, Dict, Iterable, List, Optional, Sequence, Tuple, Union
  import srsly
  from ..errors import Errors, Warnings
  from ..language import Language
  from ..matcher import Matcher, PhraseMatcher
  from ..matcher.levenshtein import levenshtein_compare
  from ..scorer import get_ner_prf
  from ..tokens import Doc, Span
  from ..training import Example
  from ..util import SimpleFrozenList, ensure_path, from_disk, registry, to_disk
  from .pipe import Pipe
label_desc: Use image node_id 8 for calling the EntityRuler obj's underlying member method code with example usage: obj.initialize(get_examples) without return types