liveBook · Manning

En_core_web_trf

As explained in Natural Language Processing in Action, Second Edition

en_core_web_trf is spaCy's English transformer language model pipeline.

en_core_web_trf is spaCy’s English transformer pipeline: a large RoBERTa-based model used here to support high-accuracy coreference resolution with Coreferee. The trf suffix marks transformer integration; its size and pinned dependencies make an isolated environment practical. section 11.5.1

Load the pipeline for coreference resolution

Install the English model and Coreferee, then load the transformer pipeline and attach the resolver: `nlptrf = spacy.load('en_core_web_trf')`; `nlptrf.add_pipe('coreferee')`. Processing text exposes `doc._.coref_chains`, which can link mentions such as “Gebru” with repeated “she” references and “advice” with “it”. section 11.5.1

$ python -m spacy download en_core_web_lg        #1
$ python -m spacy download en_core_web_trf     #2
$ python -m coreferee install en

The installation commands show the required English transformer model, larger language model, and Coreferee language resources. section 11.5.1

How Natural Language Processing in Action, Second Edition covers it

How deep it goes
Explains the transformer role, installation constraints, pipeline loading, and inspected coreference chains, but not transformer internals.
Examples
Demonstrates Wikipedia text about Gebru, pronoun-linked entity chains, and Python inspection of `doc._.coref_chains`.
What it assumes
Assumes Python package installation and virtual environments while supplying model-download and pipeline-loading steps.
What you can do after
Operate a spaCy transformer pipeline with Coreferee and inspect extracted English coreference chains.
How it connects
Connects spaCy, RoBERTa, Coreferee, named entity recognition, coreference chains, NumPy, and PyTorch.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Natural Language Processing in Action, Second Edition. The section links point to the parts of the book it draws on.