docstr: Register the component-specific extension attributes here and only
  if the component is added to the pipeline and used – otherwise, tokens
  will still get the attributes even if the component is only created and
  not added.
docstr_tok: ["Register","the","component-specific","extension","attributes","here","and","only","if","the","component","is","added","to","the","pipeline","and","used","\u2013","otherwise",",","tokens","will","still","get","the","attributes","even","if","the","component","is","only","created","and","not","added","."]
code: def init_component(self):
      """Register the component-specific extension attributes here and only
      if the component is added to the pipeline and used – otherwise, tokens
      will still get the attributes even if the component is only created and
      not added.
      """
      Doc.set_extension("_s2v", default=None)
      Doc.set_extension("s2v_phrases", getter=self.get_phrases)
      for obj in [Token, Span]:
          obj.set_extension("s2v_key", getter=self.s2v_key)
          obj.set_extension("in_s2v", getter=self.in_s2v)
          obj.set_extension("s2v_vec", getter=self.s2v_vec)
          obj.set_extension("s2v_freq", getter=self.s2v_freq)
          obj.set_extension(
              "s2v_other_senses", getter=self.s2v_other_senses
          )
          obj.set_extension(
              "s2v_most_similar", method=self.s2v_most_similar
          )
          obj.set_extension(
              "s2v_similarity", method=self.s2v_similarity
          )
  
imports: from typing import Tuple, Union, List, Dict, Callable, Iterable, Optional
  from spacy.language import Language
  from spacy.tokens import Doc, Token, Span
  from spacy.training import Example
  from spacy.vocab import Vocab
  from spacy.util import SimpleFrozenDict
  from pathlib import Path
  import numpy
  from .sense2vec import Sense2Vec
  from .util import registry
label_desc: Use image node_id 4 for calling the Sense2VecComponent obj's underlying member method code with example usage: obj.init_component() without return types