class_docstr: Spacy based NP annotator - uses models.SequenceChunker model for annotation
  
  Args:
      model (SequenceChunker): a chunker model
      word_vocab (Vocabulary): word-id vocabulary of the model
      char_vocab (Vocabulary): char id vocabulary of words of the model
      chunk_vocab (Vocabulary): chunk tag vocabulary of the model
      batch_size (int, optional): inference batch size
docstr: Annotate the document with noun phrase spans
code: def __call__(self, doc: Doc) -> Doc:
      """
      Annotate the document with noun phrase spans
      """
      spans = []
      doc_vecs = []
      doc_chars = []
      doc_lens = []
      if len(doc) < 1:
          return doc
      for sentence in doc.sents:
          features = self._feature_extractor([t.text for t in sentence])
          if isinstance(features, tuple):
              doc_vec = features[0]
              doc_chars.append(features[1])
          else:
              doc_vec = features
          doc_vecs.append(doc_vec)
          doc_lens.append(len(doc_vec))
      doc_vectors = pad_sentences(np.asarray(doc_vecs))
      inputs = doc_vectors
      if self.char_vocab:
          max_len = doc_vectors.shape[1]
          padded_chars = np.zeros(
              (len(doc_chars), max_len, self.model.max_word_len)
          )
          for idx, d in enumerate(doc_chars):
              d = d[:max_len]
              padded_chars[idx, -d.shape[0] :] = d
          inputs = [inputs, padded_chars]
      np_indexes = self._infer_chunks(inputs, doc_lens)
      for s, e in np_indexes:
          np_span = Span(doc, s, e)
          spans.append(np_span)
      spans = _NPPostprocessor.process(spans)
      set_noun_phrases(doc, spans)
      return doc
  
imports: import pickle
  from os import path
  import numpy
  import spacy
  from spacy.tokens import Doc
  from spacy.tokens import Span
  from nlp_architect.models.chunker import SequenceChunker
  from nlp_architect.utils.generic import pad_sentences
  from nlp_architect.utils.io import validate_existing_filepath
  from nlp_architect.utils.text import extract_nps, Stopwords
label_desc: Use image node_id 5 for calling the NPAnnotator obj's underlying member method code with example usage: obj.__call__(doc) and returns: doc, doc