Commit 4bb6bc3 1 parent 44589fb commit 4bb6bc3 Copy full SHA for 4bb6bc3
File tree 2 files changed +6
-0
lines changed
2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ cdef struct GoldParseC:
9
9
int * tags
10
10
int * heads
11
11
int * has_dep
12
+ int * sent_start
12
13
attr_t* labels
13
14
int ** brackets
14
15
Transition* ner
Original file line number Diff line number Diff line change @@ -426,6 +426,7 @@ cdef class GoldParse:
426
426
self .c.heads = < int * > self .mem.alloc(len (doc), sizeof(int ))
427
427
self .c.labels = < attr_t* > self .mem.alloc(len (doc), sizeof(attr_t))
428
428
self .c.has_dep = < int * > self .mem.alloc(len (doc), sizeof(int ))
429
+ self .c.sent_start = < int * > self .mem.alloc(len (doc), sizeof(int ))
429
430
self .c.ner = < Transition* > self .mem.alloc(len (doc), sizeof(Transition))
430
431
431
432
self .cats = list (cats)
@@ -482,6 +483,10 @@ cdef class GoldParse:
482
483
"""
483
484
return not nonproj.is_nonproj_tree(self .heads)
484
485
486
+ @property
487
+ def sent_starts (self ):
488
+ return [self .c.sent_start[i] for i in range (self .length)]
489
+
485
490
486
491
def biluo_tags_from_offsets (doc , entities , missing = ' O' ):
487
492
""" Encode labelled spans into per-token tags, using the Begin/In/Last/Unit/Out
You can’t perform that action at this time.
0 commit comments