Skip to content

V4.0.0 - add support for entities

Latest
Compare
Choose a tag to compare
@amir-zeldes amir-zeldes released this 16 Dec 22:55
c4eff69

CoNLL-U Entity annotations can now be read and accessed in the API like this:

from depedit import DepEdit

d = DepEdit()

conllu = open("GUM_academic_art.conllu").read()

d.run_depedit(conllu, parse_entities=True)

print(d.entities)  			# Unique entities by cluster
print(d.mentions)  			# All mentions of all entities
print(d.mentions[0].head.pos)  		# Head POS tag of first mention
print(d.mentions[0].annos["etype"]) 	# Entity type of first mention