title: How to initialize tok2vec Transformer with a custom spacy ner model
body: <p>I have some trouble with the initialization of a tok2vec Transformer with a custom spacy ner model. How do I use tok2vec properly before the ner step starts in the pipeline?</p>
  <p>Init:</p>
  <pre><code>    nlp = spacy.load(&quot;./output_training_11.11&quot;)
      ner = nlp.get_pipe(&quot;ner&quot;)
      config = {&quot;model&quot;: DEFAULT_TOK2VEC_MODEL}
      nlp.add_pipe(&quot;tok2vec&quot;,  before='ner')
  </code></pre>
  <p>Training:</p>
  <pre><code>with nlp.disable_pipes(*other_pipes):
  
    optimizer = nlp.begin_training()
  
    for i in range(100):
      random.shuffle(TRAIN_DATA)
      for text, annotation in TRAIN_DATA:
          doc = nlp.make_doc(text)
          #print(annotation)
          try:
              example = Example.from_dict(doc, annotation)
              #print(example)
          except ValueError as e:
              print(e)
              print(&quot;Text: &quot; , doc[0:50])
              print(&quot;------&quot;)
          nlp.update([example], 
                     sgd=optimizer, drop=dropout)```
  
  
  nlp(&quot;random text&quot;)
  
  
  ValueError: [E109] Component 'tok2vec' could not be run. Did you forget to call `initialize()`?
  </code></pre>