From 0d2492c97a297a8ceffed1d23edabcad1a121af6 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Thu, 25 Jun 2020 21:18:52 +0200 Subject: [PATCH] Implement Example.copy --- spacy/gold/example.pyx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spacy/gold/example.pyx b/spacy/gold/example.pyx index 10b537f22..76247100d 100644 --- a/spacy/gold/example.pyx +++ b/spacy/gold/example.pyx @@ -54,6 +54,12 @@ cdef class Example: def __set__(self, doc): self.y = doc + + def copy(self): + return Example( + self.x.copy(), + self.y.copy() + ) @classmethod def from_dict(cls, Doc predicted, dict example_dict):