class_docstr: Detects abbreviations using the algorithm in "A simple algorithm for identifying
  abbreviation definitions in biomedical text.", (Schwartz & Hearst, 2003).
  
  This class sets the `._.abbreviations` attribute on spaCy Doc.
  
  The abbreviations attribute is a `List[Span]` where each Span has the `Span._.long_form`
  attribute set to the long form definition of the abbreviation.
  
  Note that this class does not replace the spans, or merge them.
  
  Parameters
  ----------
  
  nlp: `Language`, a required argument for spacy to use this as a factory
  name: `str`, a required argument for spacy to use this as a factory
  make_serializable: `bool`, a required argument for whether we want to use the serializable
  or non serializable version.
class_docstr_tok: ["Detects","abbreviations","using","the","algorithm","in","``","A","simple","algorithm","for","identifying","abbreviation","definitions","in","biomedical","text",".","``",",","(","Schwartz","&","Hearst",",","2003",")",".","This","class","sets","the","`","._.abbreviations","`","attribute","on","spaCy","Doc",".","The","abbreviations","attribute","is","a","`","List","[","Span","]","`","where","each","Span","has","the","`","Span._.long_form","`","attribute","set","to","the","long","form","definition","of","the","abbreviation",".","Note","that","this","class","does","not","replace","the","spans",",","or","merge","them",".","Parameters","--","--","--","--","--","nlp",":","`","Language","`",",","a","required","argument","for","spacy","to","use","this","as","a","factory","name",":","`","str","`",",","a","required","argument","for","spacy","to","use","this","as","a","factory","make_serializable",":","`","bool","`",",","a","required","argument","for","whether","we","want","to","use","the","serializable","or","non","serializable","version","."]
code: def __call__(self, doc: Doc) -> Doc:
      matches = self.matcher(doc)
      matches_no_brackets = [
          (x[0], x[1] + 1, x[2] - 1) for x in matches
      ]
      filtered = filter_matches(matches_no_brackets, doc)
      occurences = self.find_matches_for(filtered, doc)
  
      for long_form, short_forms in occurences:
          for short in short_forms:
              short._.long_form = long_form
              doc._.abbreviations.append(short)
      if self.make_serializable:
          abbreviations = doc._.abbreviations
          doc._.abbreviations = [
              self.make_short_form_serializable(abbreviation)
              for abbreviation in abbreviations
          ]
      return doc
  
file_path: scispacy/scispacy/abbreviation.py
imports: from typing import Tuple, List, Optional, Set, Dict
  from collections import defaultdict
  from spacy.tokens import Span, Doc
  from spacy.matcher import Matcher
  from spacy.language import Language
label_desc: Use image node_id 3 for calling the AbbreviationDetector obj's underlying member method code with example usage: obj.__call__(doc) and returns: doc