[
https://issues.apache.org/jira/browse/STANBOL-1132?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13800966#comment-13800966
]
Cristian Petroaca commented on STANBOL-1132:
--------------------------------------------
For the sentence "Obama visited China." we have the dependency tree :
nsubj(visited-2, Obama-1), root(ROOT-0, visited-2), dobj(visited-2, China-3)
Let's take the token "visited". We would have the following DependencyRelation
objects created and attached as annotations:
GrammaticalRelationTag nSubjTag = new GrammaticalRelationTag("nsubj",
GrammaticalRelation.NominalSubject);
DependencyRelation relation1 = new DependencyRelation(nSubjTag, false
/*isDependent */, ObamaToken);
GrammaticalRelationTag rootTag = new GrammaticalRelationTag("root",
GrammaticalRelation.Root);
DependencyRelation relation2 = new DependencyRelation(rootTag, true /*
isDependent */, null /* no token for root */)
GrammaticalRelationTag dObjTag = new GrammaticalRelationTag("dobj",
GrammaticalRelation.DirectObject)
DependencyRelation relation3 = new DependencyRelation(dObjTag, false /*
isDependent, ChinaToken);
The nSubjTag, rootTag and dObjTag are taken out of the TagSetRegistry in the
Stanford NLP API following the examples from PosTag, etc.. That is actually the
reason I created a GrammaticalRelationTag and I didn't put the 'tag' at
DependencyRelation level.
By the way, looking at this hierarchy I think it should also be reflected in
the json. So instead of the initial json :
{ "tag" : "nsubj", //type of relation - Stanford NLP notation
"relationType" : 12, // type of relation -
Stanbol NLP mapped value - ordinal number in enum Dependency
"isDependent" : "true",
"type" : "Token", // type of element with which
this token is in relation
"start" : 123, // start index of the relating
token
"end" : 130 // end index of the relating token
}
I would have :
{ "grammaticalRelation" : {
"tag" : "nsubj", //type of relation
- Stanford NLP notation
"relationType" : 12, // type of
relation - Stanbol NLP mapped value - ordinal number in enum Dependency
},
"isDependent" : "true",
"type" : "Token", // type of element with which
this token is in relation
"start" : 123, // start index of the relating
token
"end" : 130 // end index of the relating token
}
> Add co-reference resolution and dependency tree support in the Stanbol NLP
> processing API
> -----------------------------------------------------------------------------------------
>
> Key: STANBOL-1132
> URL: https://issues.apache.org/jira/browse/STANBOL-1132
> Project: Stanbol
> Issue Type: New Feature
> Components: Enhancement Engines
> Reporter: Cristian Petroaca
> Assignee: Rupert Westenthaler
> Labels: co-reference, dependency-tree, nlp
> Attachments: coref_dependency_tree_datamodel.patch
>
>
> Extend the Stanbol NLP Processing API with annotations for co-reference
> resolution and dependency trees.
> Also, add support for JSON Serialisation/Parsing for the co-reference and
> dependency tree annotations so that the RESTful NLP Analysis Service can
> provide co-reference information.
--
This message was sent by Atlassian JIRA
(v6.1#6144)