How to encode the shortest dependency path between words in sentence in neural network?

47 Views Asked by At

I am doing a first project on relation extraction between two entities in sentences in NLP. I use an LSTM model, and in addition to inputting the word embedding, I want to input the shortest dependency path between these 2 entities

for example: thousands of people are flocking towards the center, given the 2 entities are 'people' and 'center', the path is people -> of -> thousands -> flocking <- towards <- center.

So how can I encode this features to make the model can learn this knowledge

Specially thanks!

i have tried creating an array to store the index of words on that shortest path, words that appear will get a None value. For, example, in the above example, ”people”, ”of”, ”thousands”, ”flocking”, ”towards”, ”center” will hold respectively -3, -2, -1, 0, 1, 2. Using negative numbers and positive numbers to indicate 2 directions in the path. I feel this approach is not goog enough, and the model performance does not increase much

1

There are 1 best solutions below

0
lalalla_schnee On

Convert the sentence into its dependency graph with the corresponding adjacency matrix, then introduce the multi-layers GCN layers to capture the dependencies features.

For more detailed information you can refer to GCN and AGCN.