mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 17:36:30 +03:00
* Support 'punct' dep label in conll.pyx
This commit is contained in:
parent
021c972137
commit
a60a366b2c
|
@ -107,12 +107,12 @@ cdef class GoldParse:
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def n_non_punct(self):
|
def n_non_punct(self):
|
||||||
return len([l for l in self.labels if l != 'P'])
|
return len([l for l in self.labels if l not in ('P', 'punct')])
|
||||||
|
|
||||||
cdef int heads_correct(self, TokenC* tokens, bint score_punct=False) except -1:
|
cdef int heads_correct(self, TokenC* tokens, bint score_punct=False) except -1:
|
||||||
n = 0
|
n = 0
|
||||||
for i in range(self.length):
|
for i in range(self.length):
|
||||||
if not score_punct and self.labels_[i] == 'P':
|
if not score_punct and self.labels_[i] not in ('P', 'punct'):
|
||||||
continue
|
continue
|
||||||
if self.heads[i] == -1:
|
if self.heads[i] == -1:
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Reference in New Issue
Block a user