Code Monkey home page Code Monkey logo

pytorch-acnn-model's Introduction

NRE ACNN Model

an implementation of Relation Classification via Multi-Level Attention CNNs

Some of data handling codes are copied from ACNN

You need an environment: pytorch 1.0.0 keras & tensorflow (I only used one function which name is to_categorical) Git this project to your pycharm or other IDE, then edit the acnn_train.py to satisfied your data

18.12.17 The Renewed Version

These days, I reviewed the paper again and update my code. But the acc is still low.

Could somebody give me some advice?

Network Structure

pytorch-acnn-model's People

Contributors

dgai91 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

pytorch-acnn-model's Issues

文件找不到

embed_file = 'embeddings.txt'
vac_file = 'words.lst'
这两个文件怎么找啊,分别 是什么文件啊?

Calculating Relative Distance of Words

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

对计算相关性矩阵G的一些疑问?

原论文中在计算矩阵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就可以了,

TypeError: __init__() got an unexpected keyword argument 'data_tensor'

mldl@ub1604:/ub16_prj/relation-classification-via-attention-model$ python3.6 acnn_train.py
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:
/ub16_prj/relation-classification-via-attention-model$

缺少代码

attention模块的代码为什么没有提交呢? 另求此模型当前的f1值。

数据集

有没有同学解释一下数据集是具体怎么是这种格式,每条样例的前面五个参数是什么,还有,是在哪里标注的

Cannot run

After I clone the repo and also copy some code from the acnn repo, I still couldn't run the code actually.

found two bugs that could cause your inferior performance than original paper

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!

Files

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.