GoldParse

Collection for training annotations.

Attributes

NameTypeDescription
tagslistThe part-of-speech tag annotations.
headslistThe syntactic head annotations.
labelslistThe syntactic relation-type annotations.
entslistThe named entity annotations.
cand_to_goldlistThe alignment from candidate tokenization to gold tokenization.
gold_to_candlistThe alignment from gold tokenization to candidate tokenization.

GoldParse.__init__

Create a GoldParse.

NameTypeDescription
docDocThe document the annotations refer to.
words-A sequence of unicode word strings.
tags-A sequence of strings, representing tag annotations.
heads-A sequence of integers, representing syntactic head offsets.
deps-A sequence of strings, representing the syntactic relation types.
entities-A sequence of named entity annotations, either as BILUO tag strings, or as (start_char, end_char, label) tuples, representing the entity positions.
returnGoldParseThe newly constructed object.

GoldParse.__len__

Get the number of gold-standard tokens.

NameTypeDescription
returnintThe number of gold-standard tokens.

GoldParse.is_projective

Whether the provided syntactic annotations form a projective dependency tree.

NameTypeDescription
returnboolWhether annotations form projective tree.