code: def get_noun_phrases(doc: Doc) -> List[Span]:
      """Compile a list of noun phrases in sense2vec's format (without
      determiners). Separated out to make it easier to customize, e.g. for
      languages that don't implement a noun_chunks iterator out-of-the-box, or
      use different label schemes.
  
      doc (Doc): The Doc to get noun phrases from.
      RETURNS (list): The noun phrases as a list of Span objects.
      """
      trim_labels = ("advmod", "amod", "compound")
      spans = []
      if doc.has_annotation("DEP"):
          for np in doc.noun_chunks:
              while len(np) > 1 and np[0].dep_ not in trim_labels:
                  np = np[1:]
              spans.append(np)
      return spans
  
file_path: sense2vec/sense2vec/util.py
imports: from typing import Union, List, Tuple, Set
  import re
  from spacy.tokens import Doc, Token, Span
  from spacy.util import filter_spans
  from thinc.api import get_array_module
  import catalogue
label_desc: Use image node_id 5 for calling a global function with example usage: get_noun_phrases(doc) and returns: spans