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:
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: