code: def main(corpus_t, corpus_r, single_thread, no_train, url):
      try:
          if not path.exists(data_dir):
              makedirs(data_dir)
          if not path.exists(path.join(data_dir, "W2V_Models")):
              os.makedirs(path.join(data_dir, "W2V_Models"))
      except Exception:
          logger.error("failed to create output folder.")
          sys.exit()
      if url:
          if not path.isfile(corpus_t) or not path.isfile(corpus_r):
              logger.error("Please provide a valid csv file with urls")
              sys.exit()
          else:
              text_t = load_url_content(get_urls_from_file(corpus_t))
              text_r = load_url_content(get_urls_from_file(corpus_r))
      else:
          if not path.isdir(corpus_t) or not path.isdir(corpus_r):
              logger.error(
                  "Please provide valid directories for target_corpus and"
                  " for ref_corpus"
              )
              sys.exit()
  
          else:
              text_t = load_text_from_folder(corpus_t)
              text_r = load_text_from_folder(corpus_r)
  
      # extract noun phrases
      nlp_parser_t = initiate_parser()
      nlp_parser_r = initiate_parser()
      if single_thread:
          result_t = noun_phrase_extraction(text_t, nlp_parser_t)
          result_r = noun_phrase_extraction(text_r, nlp_parser_r)
      else:
          with Pool(processes=2) as pool:
              run_np_t = pool.apply_async(
                  noun_phrase_extraction, [text_t, nlp_parser_t]
              )
              run_np_r = pool.apply_async(
                  noun_phrase_extraction, [text_r, nlp_parser_r]
              )
              result_t = run_np_t.get()
              result_r = run_np_r.get()
  
      # save results to csv
  
      # save_scores(result_t, os.path.splitext(os.path.basename(corpus_t))[0] + '.csv')
      # save_scores(result_r, os.path.splitext(os.path.basename(corpus_r))[0] + '.csv')
      save_scores(
          result_t,
          str(path.join(data_dir, os.path.basename(corpus_t))) + ".csv",
      )
      save_scores(
          result_r,
          str(path.join(data_dir, os.path.basename(corpus_r))) + ".csv",
      )
  
      # create w2v model
      if not no_train:
          create_w2v_model(text_t, text_r)
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import argparse
  import csv
  import logging
  import os
  import sys
  from multiprocessing import Pool
  from os import makedirs, path
  from nlp_architect import LIBRARY_OUT
  from nlp_architect.utils.embedding import FasttextEmbeddingsModel
  from nlp_architect.utils.io import validate_existing_directory
  from nlp_architect.utils.text import SpacyInstance
  from .np_scorer import NPScorer
label_desc: Use image node_id 13 for calling a global function with example usage: main(corpus_t, corpus_r, single_thread, no_train, url) without return types