mirror of
https://github.com/explosion/spaCy.git
synced 2025-12-08 02:34:17 +03:00
* Add `TrainablePipe.{distill,get_teacher_student_loss}`
This change adds two methods:
- `TrainablePipe::distill` which performs a training step of a
student pipe on a teacher pipe, giving a batch of `Doc`s.
- `TrainablePipe::get_teacher_student_loss` computes the loss
of a student relative to the teacher.
The `distill` or `get_teacher_student_loss` methods are also implemented
in the tagger, edit tree lemmatizer, and parser pipes, to enable
distillation in those pipes and as an example for other pipes.
* Fix stray `Beam` import
* Fix incorrect import
* Apply suggestions from code review
Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>
* Apply suggestions from code review
Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>
* TrainablePipe.distill: use `Iterable[Example]`
* Add Pipe.is_distillable method
* Add `validate_distillation_examples`
This first calls `validate_examples` and then checks that the
student/teacher tokens are the same.
* Update distill documentation
* Add distill documentation for all pipes that support distillation
* Fix incorrect identifier
* Apply suggestions from code review
Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>
* Add comment to explain `is_distillable`
Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>
|
||
|---|---|---|
| .. | ||
| _edit_tree_internals | ||
| _parser_internals | ||
| legacy | ||
| __init__.py | ||
| attribute_ruler.py | ||
| dep_parser.pyx | ||
| edit_tree_lemmatizer.py | ||
| entity_linker.py | ||
| entityruler.py | ||
| functions.py | ||
| lemmatizer.py | ||
| morphologizer.pyx | ||
| ner.pyx | ||
| pipe.pxd | ||
| pipe.pyi | ||
| pipe.pyx | ||
| sentencizer.pyx | ||
| senter.pyx | ||
| span_ruler.py | ||
| spancat.py | ||
| tagger.pyx | ||
| textcat_multilabel.py | ||
| textcat.py | ||
| tok2vec.py | ||
| trainable_pipe.pxd | ||
| trainable_pipe.pyx | ||
| transition_parser.pxd | ||
| transition_parser.pyx | ||