# Buggy code
def __init__(self, vocab=True, make_doc=True, meta={}, **kwargs):
    """Initialise a Language object.

    vocab (Vocab): A `Vocab` object. If `True`, a vocab is created via
        `Language.Defaults.create_vocab`.
    make_doc (callable): A function that takes text and returns a `Doc`
        object. Usually a `Tokenizer`.
    pipeline (list): A list of annotation processes or IDs of annotation,
        processes, e.g. a `Tagger` object, or `'tagger'`. IDs are looked
        up in `Language.Defaults.factories`.
    disable (list): A list of component names to exclude from the pipeline.
        The disable list has priority over the pipeline list -- if the same
        string occurs in both, the component is not loaded.
    meta (dict): Custom meta data for the Language class. Is written to by
        models to add model meta data.
    RETURNS (Language): The newly constructed object.
    """
    self._meta = dict(meta)
    self._path = None
    if vocab is True:
        factory = self.Defaults.create_vocab
        vocab = factory(self, **meta.get("vocab", {}))
    self.vocab = vocab
    if make_doc is True:
        factory = self.Defaults.create_tokenizer
        make_doc = factory(self, **meta.get("tokenizer", {}))
    self.tokenizer = make_doc
    self.pipeline = []
    self._optimizer = None


# Traceback (ValueError)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Projects/foobar/.env/lib/python3.6/site-packages/spacy/language.py", line 333, in __call__
doc = proc(doc)
File "pipeline.pyx", line 390, in spacy.pipeline.Tagger.__call__
File "pipeline.pyx", line 402, in spacy.pipeline.Tagger.predict
File "/Projects/foobar/.env/lib/python3.6/site-packages/thinc/neural/_classes/model.py", line 161, in __call__
return self.predict(x)
File "/Projects/foobar/.env/lib/python3.6/site-packages/thinc/api.py", line 55, in predict
X = layer(X)
File "/Projects/foobar/.env/lib/python3.6/site-packages/thinc/neural/_classes/model.py", line 161, in __call__
return self.predict(x)
File "/Projects/foobar/.env/lib/python3.6/site-packages/thinc/api.py", line 293, in predict
X = layer(layer.ops.flatten(seqs_in, pad=pad))
File "/Projects/foobar/.env/lib/python3.6/site-packages/thinc/neural/_classes/model.py", line 161, in __call__
return self.predict(x)
File "/Projects/foobar/.env/lib/python3.6/site-packages/thinc/api.py", line 55, in predict
X = layer(X)
File "/Projects/foobar/.env/lib/python3.6/site-packages/thinc/neural/_classes/model.py", line 161, in __call__
return self.predict(x)
File "/Projects/foobar/.env/lib/python3.6/site-packages/thinc/neural/_classes/model.py", line 125, in predict
y, _ = self.begin_update(X)
File "/Projects/foobar/.env/lib/python3.6/site-packages/thinc/api.py", line 372, in uniqued_fwd
Y_uniq, bp_Y_uniq = layer.begin_update(X[ind], drop=drop)
File "/Projects/foobar/.env/lib/python3.6/site-packages/thinc/api.py", line 61, in begin_update
X, inc_layer_grad = layer.begin_update(X, drop=drop)
File "/Projects/foobar/.env/lib/python3.6/site-packages/thinc/api.py", line 176, in begin_update
values = [fwd(X, *a, **k) for fwd in forward]
File "/Projects/foobar/.env/lib/python3.6/site-packages/thinc/api.py", line 176, in <listcomp>
values = [fwd(X, *a, **k) for fwd in forward]
File "/Projects/foobar/.env/lib/python3.6/site-packages/thinc/api.py", line 258, in wrap
output = func(*args, **kwargs)
File "/Projects/foobar/.env/lib/python3.6/site-packages/thinc/api.py", line 176, in begin_update
values = [fwd(X, *a, **k) for fwd in forward]
File "/Projects/foobar/.env/lib/python3.6/site-packages/thinc/api.py", line 176, in <listcomp>
values = [fwd(X, *a, **k) for fwd in forward]
File "/Projects/foobar/.env/lib/python3.6/site-packages/thinc/api.py", line 258, in wrap
output = func(*args, **kwargs)
File "/Projects/foobar/.env/lib/python3.6/site-packages/thinc/api.py", line 176, in begin_update
values = [fwd(X, *a, **k) for fwd in forward]
File "/Projects/foobar/.env/lib/python3.6/site-packages/thinc/api.py", line 176, in <listcomp>
values = [fwd(X, *a, **k) for fwd in forward]
File "/Projects/foobar/.env/lib/python3.6/site-packages/thinc/api.py", line 258, in wrap
output = func(*args, **kwargs)
File "/Projects/foobar/.env/lib/python3.6/site-packages/thinc/api.py", line 176, in begin_update
values = [fwd(X, *a, **k) for fwd in forward]
File "/Projects/foobar/.env/lib/python3.6/site-packages/thinc/api.py", line 176, in <listcomp>
values = [fwd(X, *a, **k) for fwd in forward]
File "/Projects/foobar/.env/lib/python3.6/site-packages/thinc/api.py", line 258, in wrap
output = func(*args, **kwargs)
File "/Projects/foobar/.env/lib/python3.6/site-packages/thinc/neural/_classes/static_vectors.py", line 67, in begin_update
dotted = self.ops.batch_dot(vectors, self.W)
File "ops.pyx", line 299, in thinc.neural.ops.NumpyOps.batch_dot
ValueError: shapes (4,0) and (300,128) not aligned: 0 (dim 1) != 300 (dim 0)

# Fixed code
def __init__(self, vocab=True, make_doc=True, meta={}, **kwargs):
    """Initialise a Language object.

    vocab (Vocab): A `Vocab` object. If `True`, a vocab is created via
        `Language.Defaults.create_vocab`.
    make_doc (callable): A function that takes text and returns a `Doc`
        object. Usually a `Tokenizer`.
    pipeline (list): A list of annotation processes or IDs of annotation,
        processes, e.g. a `Tagger` object, or `'tagger'`. IDs are looked
        up in `Language.Defaults.factories`.
    disable (list): A list of component names to exclude from the pipeline.
        The disable list has priority over the pipeline list -- if the same
        string occurs in both, the component is not loaded.
    meta (dict): Custom meta data for the Language class. Is written to by
        models to add model meta data.
    RETURNS (Language): The newly constructed object.
    """
    self._meta = dict(meta)
    self._path = None
    if vocab is True:
        factory = self.Defaults.create_vocab
        vocab = factory(self, **meta.get("vocab", {}))
        if vocab.vectors.name is None:
            vocab.vectors.name = meta.get("vectors", {}).get("name")
    self.vocab = vocab
    if make_doc is True:
        factory = self.Defaults.create_tokenizer
        make_doc = factory(self, **meta.get("tokenizer", {}))
    self.tokenizer = make_doc
    self.pipeline = []
    self._optimizer = None