eGitty

Discover The Most Popular Algorithms

Steps to Rebuild a Target-Oriented Dependency Tree From a Dependency Tree

Generally, a dependency tree is not target-oriented, we can build a dependency tree for a sentence by some python libraries. However, this tree that is not target-oriented may not meet the scenario of some nlp problems.

For example, we can view this sentence in the aspect-based sentiment analysis.

great food but the service was dreadful

The aspect terms are food and service, we should build a dependency tree around the food and service.

How to create a target-oriented dependency tree?

Paper Relational Graph Attention Network for Aspect-based Sentiment Analysis proposed a method.

This method will reshape an original dependency tree to root it at a target aspect, then a target-oriented dependency tree is created.

Here is the algorithm:

How to create a target-oriented dependency tree

We should notice n = distance(i,j). It will compute this distance between ordinary word and aspect word.

From this paper, we can find n = ∞ if the distance is longer than 4.

Finally, we will see an original dependency tree as follows:

an original dependency tree

Leave a Reply

Your email address will not be published. Required fields are marked *