DeepKE
DeepKE copied to clipboard
RE中使用GCN模型时邻接矩阵adj的处理
Describe the question
A clear and concise description of what the question is.
- 在数据处理完之后,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.
-
run.py

-
train.py

Additional context
Add any other context about the problem here.
上述GCN的模型是模仿早期一篇 GCN for RE 的 文章:Graph Convolution over Pruned Dependency Trees Improves Relation Extraction 源码构建的GCN架构,adj可根据公开语法解析器生成,如原文使用的,在deepke中adj为随机生成的
您也可以通过一些现成的parsing工具生成adj。
好的谢谢