code: def train_w2v_model(data):
      """
      Train a w2v (skipgram) model using fasttext package
  
      Args:
          data: A path to the training data (String)
      """
      with open(data, encoding="utf-8") as fp:
          texts = [line.split() for line in fp.readlines()]
      logger.info("Fasttext embeddings training...")
      try:
          model = FasttextEmbeddingsModel(
              size=100, min_count=1, skipgram=True
          )
          model.train(texts, epochs=100)
          model.save(str(path.join(data_dir, "W2V_Models/model.bin")))
      except Exception as e:
          logger.error("Error: %s", str(e))
  
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 9 for calling a global function with example usage: train_w2v_model(data) without return types