mirror of https://github.com/explosion/spaCy.git
Implement Example.copy
This commit is contained in:
parent
c2fff89b1d
commit
0d2492c97a
|
@ -55,6 +55,12 @@ cdef class Example:
|
||||||
def __set__(self, doc):
|
def __set__(self, doc):
|
||||||
self.y = doc
|
self.y = doc
|
||||||
|
|
||||||
|
def copy(self):
|
||||||
|
return Example(
|
||||||
|
self.x.copy(),
|
||||||
|
self.y.copy()
|
||||||
|
)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_dict(cls, Doc predicted, dict example_dict):
|
def from_dict(cls, Doc predicted, dict example_dict):
|
||||||
if example_dict is None:
|
if example_dict is None:
|
||||||
|
|
Loading…
Reference in New Issue