java - How to get the finalized text after resolving co-references using StandfordNLP -


hi started learning nlp , chose stanford api required tasks. able pos , ner tasks stuck co-reference resolution. able 'corefchaingraph' , able print representative mention , corresponding mentions console. but, know how finalized text after resolving co-references. can 1 me regarding this?

example: input sentence: john smith talks eu. likes family of nations.

expected ouput: john smith talks eu. john smith likes family of nations.

it depends lot on approach take. try , solve looking @ role word plays in sentence , context carried forward. based on pos tags, try , map subject-verb-object model. once have subject , objects identified can build simple context carry forward rule system achieve want.

e.g.

based on tags below:

[('john', 'nnp'), ('smith', 'nnp'), ('talks', 'vbz'), ('about', 'in'), ('the', 'dt'), ('eu.', 'nnp'), ('he', 'nnp'), ('likes', 'vbz'), ('the', 'dt'), ('family', 'nn'), ('of', 'in'), ('nations', 'nns'), ('.', '.')] 

you can create chunks:

[['noun_type', 'john', 'smith'], ['verb_type', 'talks'], ['in_type', 'about'], ['noun_type', 'the', 'eu']]  [['noun_type', 'he'], ['verb_type', 'likes'], ['noun_type', 'the', 'family'], ['in_type', 'of'], ['noun_type', 'nations']] 

once have these chunks, parse them left right putting them in subject-verb-object form.

now based on this, know context carry forward.

e.g.: "he" means subject getting carry forward. "it" means object (this basic example. can build robust rule based systems patterns.) have tried many approaches in past , 1 gave me best results.

i hope helped.


Comments

Popular posts from this blog

php - get table cell data from and place a copy in another table -

javascript - Mootools wait with Fx.Morph start -

php - Navigate throught databse rows -