dgai91 / pytorch-acnn-model Goto Github PK
View Code? Open in Web Editor NEWcode of Relation Classification via Multi-Level Attention CNNs
code of Relation Classification via Multi-Level Attention CNNs
Hi, I have carefully read your code and found two bugs that could potentially cause your inferior performance compared with the original paper. 1. in the new_convolution function, there is missing use of self.tanh() as the activation after the convolution layer; 2. in the original paper, the convolution kernel is 1 since the input is already trigram, so there is no need to use kernel size of 3 in the new_convolution function. If you have doubt on my comments, welcome to discuss with me, thanks!
After I clone the repo and also copy some code from the acnn repo, I still couldn't run the code actually.
原论文中在计算矩阵G的时候未写明三个矩阵的size,但是根据原论文中此处引用的2个文献里的计算方式:
1 ABCNN: attention-based convolutional neural network for modeling sentence pairs.
2 Attentive pooling networks
我觉得原文中G的size应该是 n * nr,对应的,R_star * AP的size是(dc,nr) 每行取max后缩小为向量(dc,1)
而你的代码里G的size是 n * dc ,在这个地方,我觉得与我的理解不太一样,欢迎交流,
第二个是,我觉得得到R_star的那个卷积,过滤器宽度设置为1就可以了,
embed_file = 'embeddings.txt'
vac_file = 'words.lst'
这两个文件怎么找啊,分别 是什么文件啊?
mldl@ub1604:/ub16_prj/relation-classification-via-attention-model$ python3.6 acnn_train.py/ub16_prj/relation-classification-via-attention-model$
Traceback (most recent call last):
File "acnn_train.py", line 74, in
train_datasets = D.TensorDataset(data_tensor=train, target_tensor=y_tensor)
TypeError: init() got an unexpected keyword argument 'data_tensor'
mldl@ub1604:
DP = 25
DC = 500
N = 123
NP = 123
NR = 19
KP = 0.6
K = 3
请问一下这些参数分别是?
Hi,
In function pos
in file data_pro.py
, relative distance of words is mapped to [0,123)
. Why is 123
chosen? Is it related to the maximum sentence length of the data?
Thanks,
Nigel
attention模块的代码为什么没有提交呢? 另求此模型当前的f1值。
Hi,
I was trying to run the code, but the words.lst file and embedding file is not there and I see words.lst was deleted. I am new to this, could you please tell me how to get these files. Do I have to generate it?
请问这个函数是什么意思?是不是漏写了
有没有同学解释一下数据集是具体怎么是这种格式,每条样例的前面五个参数是什么,还有,是在哪里标注的
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.