code: def extract_noun_phrases(docs, nlp_parser, chunker):
      logger.info("extract nps from: %s", docs)
      spans = []
      for doc in nlp_parser.pipe(docs, n_threads=-1):
          if "nlp_arch" in chunker:
              spans.extend(get_noun_phrases(doc))
          else:
              nps = list(doc.noun_chunks)
              spans.extend(nps)
      logger.info("nps= %s", str(spans))
      return spans
  
file_path: nlp-architect/solutions/set_expansion/prepare_data.py
imports: import gzip
  import json
  import logging
  from argparse import ArgumentParser
  from os import path, makedirs
  from tqdm import tqdm
  from nlp_architect import LIBRARY_OUT
  from nlp_architect.pipelines.spacy_np_annotator import NPAnnotator, get_noun_phrases
  from nlp_architect.utils.io import check_size, download_unlicensed_file, validate_parent_exists
  from nlp_architect.utils.text import spacy_normalizer, SpacyInstance
label_desc: Use image node_id 3 for calling a global function with example usage: extract_noun_phrases(docs, nlp_parser, chunker) and returns: spans