DeepKE icon indicating copy to clipboard operation
DeepKE copied to clipboard

RE中使用GCN模型时邻接矩阵adj的处理

Open NEUtangyu opened this issue 3 years ago • 3 comments

Describe the question

A clear and concise description of what the question is.

  1. 在数据处理完之后,train_dataloader中有'word'、'lens'、'head_pos'、'tail_pos',还没有adj的值,为什么在train.py中 for batch_idx, (x, y) in enumerate(dataloader, 1):这句代码中,x中有adj的值。这个adj的值从哪里来,好像也没有代码进行处理呀。

Environment (please complete the following information):

  • OS: [e.g. mac / window]
  • Python Version [e.g. 3.6]

Screenshots

If applicable, add screenshots to help explain your problem.

  1. run.py image

  2. train.py image

Additional context

Add any other context about the problem here.

NEUtangyu avatar Mar 08 '23 06:03 NEUtangyu

上述GCN的模型是模仿早期一篇 GCN for RE 的 文章:Graph Convolution over Pruned Dependency Trees Improves Relation Extraction 源码构建的GCN架构,adj可根据公开语法解析器生成,如原文使用的,在deepke中adj为随机生成的

tlk1997 avatar Mar 08 '23 06:03 tlk1997

您也可以通过一些现成的parsing工具生成adj。

zxlzr avatar Mar 09 '23 10:03 zxlzr

好的谢谢

NEUtangyu avatar Mar 09 '23 12:03 NEUtangyu