code: def vectorize(doc, w_vocab, c_vocab):
      words = np.asarray(
          [
              w_vocab[w.lower()] if w.lower() in w_vocab else 1
              for w in doc
          ]
      ).reshape(1, -1)
      sentence_chars = []
      for w in doc:
          word_chars = []
          for c in w:
              if c in c_vocab:
                  _cid = c_vocab[c]
              else:
                  _cid = 1
              word_chars.append(_cid)
          sentence_chars.append(word_chars)
      sentence_chars = np.expand_dims(
          pad_sentences(sentence_chars, model.word_length), axis=0
      )
      return words, sentence_chars
  
file_path: nlp-architect/examples/ner/interactive.py
imports: from __future__ import division, print_function, unicode_literals, absolute_import
  import argparse
  import pickle
  import numpy
  from nlp_architect.models.ner_crf import NERCRF
  from nlp_architect.utils.generic import pad_sentences
  from nlp_architect.utils.io import validate_existing_filepath
  from nlp_architect.utils.text import SpacyInstance
label_desc: Use image node_id 4 for calling a global function with example usage: vectorize(doc, w_vocab, c_vocab) and returns: words,  sentence_chars