code: def set_noun_phrases(doc: Doc, nps: [Span]) -> None:
      """
      Set noun phrase tags
  
      Args:
          doc (Doc): a spacy type document
          nps ([Span]): a list of Spans
      """
      assert hasattr(
          doc._, "noun_phrases"
      ), "no noun_phrase attributes in document"
      doc._.set("noun_phrases", nps)
  
imports: import pickle
  from os import path
  import numpy
  import spacy
  from spacy.tokens import Doc
  from spacy.tokens import Span
  from nlp_architect.models.chunker import SequenceChunker
  from nlp_architect.utils.generic import pad_sentences
  from nlp_architect.utils.io import validate_existing_filepath
  from nlp_architect.utils.text import extract_nps, Stopwords
label_desc: Use image node_id 2 for calling a global function with example usage: set_noun_phrases(doc, nps) without return types