# Error using XLNet for text classification: No component 'trf\_tok2vec' found in pipeline

**URL:** <https://support.prodi.gy/t/error-using-xlnet-for-text-classification-no-component-trf-tok2vec-found-in-pipeline/2416>\
**Category:** Uncategorized\
**Tags:** textcat, transformers\
**Created:** [January 12, 2020, 1:13pm UTC](https://support.prodi.gy/t/error-using-xlnet-for-text-classification-no-component-trf-tok2vec-found-in-pipeline/2416 "2020-01-12T13:13:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![edward](https://avatars.discourse-cdn.com/v4/letter/e/90db22/32.png) [@edward](https://support.prodi.gy/u/edward)\
**Post date:** [January 12, 2020, 1:13pm UTC](https://support.prodi.gy/t/error-using-xlnet-for-text-classification-no-component-trf-tok2vec-found-in-pipeline/2416/1 "2020-01-12T13:13:23Z")

</div>

Hi.

I'm using `train textcat` to train my classifiers. This works fine using a standard spaCy base model. But when I try with `en_trf_xlnetbasecased_lg` I get an error:

```python
  File "/mnt/c/repo/prodigy/recipes/dacs.py", line 407, in train
    result = train(**args)
  File "/usr/local/lib/python3.7/site-packages/prodigy/recipes/train.py", line 154, in train
    nlp.update(docs, annots, drop=dropout, losses=losses)
  File "/usr/local/lib/python3.7/site-packages/spacy_transformers/language.py", line 81, in update
    tok2vec = self.get_pipe(PIPES.tok2vec)
  File "/usr/local/lib/python3.7/site-packages/spacy/language.py", line 281, in get_pipe
    raise KeyError(Errors.E001.format(name=name, opts=self.pipe_names))
KeyError: "[E001] No component 'trf_tok2vec' found in pipeline. Available names: ['textcat']"

```

I think this use case is supposed to work, right?

Prodigy 1.9.4

---

<div class="post-metadata">

**Author:** ![ines](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/ines/32/3_2.png) [@ines](https://support.prodi.gy/u/ines)\
**Post date:** [January 12, 2020, 1:59pm UTC](https://support.prodi.gy/t/error-using-xlnet-for-text-classification-no-component-trf-tok2vec-found-in-pipeline/2416/2 "2020-01-12T13:59:55Z")

</div>

This is currently expected – the transformers classifier is a different text classifier implementation with its own component and component dependencies (token-vector-encoding, tokenization alignment etc.). The underlying problem here is that the `train` recipe disables all components except for the one you train (which makes sense, because that's the only one you want to update). But that doesn't work for this component, since it has other component dependencies.

You can probably work around it by editing the recipe and the call to `nlp.disable_pipes`. However, you're probably still better off using the standalone training script we provide in the `spacy-transformers` repo. To get good results with the transformer models, you typically want to tune the hyperparameters and you probably also want to run it on GPU. Both of this is much easier if you have a standalone script.
