code: def vectorize(self, doc, vocab, char_vocab=None):
      words = np.asarray(
          [vocab[w.lower()] if w.lower() in vocab else 1 for w in doc]
      ).reshape(1, -1)
      if char_vocab is not None:
          sentence_chars = []
          for w in doc:
              word_chars = []
              for c in w:
                  if c in char_vocab:
                      _cid = char_vocab[c]
                  else:
                      _cid = 1
                  word_chars.append(_cid)
              sentence_chars.append(word_chars)
          sentence_chars = np.expand_dims(
              pad_sentences(sentence_chars, self.model.word_length),
              axis=0,
          )
          return [words, sentence_chars]
      return words
  
file_path: nlp-architect/nlp_architect/api/intent_extraction_api.py
imports: import numpy
  import pickle
  from os import makedirs, path, sys
  from nlp_architect.api.abstract_api import AbstractApi
  from nlp_architect.models.intent_extraction import MultiTaskIntentModel, Seq2SeqIntentModel
  from nlp_architect import LIBRARY_OUT
  from nlp_architect.utils.generic import pad_sentences
  from nlp_architect.utils.io import download_unlicensed_file
  from nlp_architect.utils.text import SpacyInstance, bio_to_spans
label_desc: Use image node_id 6 for calling the IntentExtractionApi obj's underlying member method code with example usage: obj.vectorize(doc, vocab, char_vocab) and returns: words, list