explosion / explosion/spaCy

AssertionError when using nlp.rehearse() with `en_core_web_trf`

Open
#13,724 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
33.9k
Forks
4.7k
Avg merge
3m
Merged PRs (30d)
1

Description

## How to reproduce the behaviour
I want to use rehearsal to correct some wrong dependency parsing tree produced by `en_core_web_trf`

I used the code directly from: https://github.com/explosion/spaCy/blob/be29216fe2451adead7f56ccd1db494fd8549dae/spacy/tests/training/test_rehearse.py

I modifed `test_rehearse` to be:
```python
def test_rehearse(component):
nlp = spacy.load("en_core_web_trf")
_optimize(nlp, component, REHEARSE_DATA, True)
```
and called it with `test_rehearse("parser")`

## Your Environment
- **spaCy version:** 3.8.2
- **Platform:** Linux-6.8.0-51-generic-x86_64-with-glibc2.39
- **Python version:** 3.12.7
- **Pipelines:** en_core_web_sm (3.8.0), en_core_web_lg (3.8.0), en_core_web_trf (3.8.0)

## Error Message

I received the following error message:
image

Contributor guide

Open the contributing guide

Research direction

Start with spacy/tests/training/test_rehearse.py and the modified test_rehearse("parser") reproduction, then run it with en_core_web_trf under the reported spaCy and Python versions. Use the full AssertionError traceback to identify the failing rehearsal path; done means the parser rehearsal runs without the assertion.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.