Coder Social home page Coder Social logo

tensorflow_rlre's People

Contributors

xuyanfu 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  avatar  avatar  avatar

tensorflow_rlre's Issues

what's the fb_mid_e1 in training file mean?

training file format (fb_mid_e1, fb_mid_e2, e1_name, e2_name, relation, sentence).
I see some examples of fb_mid_e1 and fb_mid_e2 in files like m.04t_bj m.01l443l, what's that mean?

get_action and deicde_action

您好,
请教一下rlmodel.py中的 get_action 和 deicde_action 有什么区别与联系呢,用这两个函数的作用分别是什么呢?谢谢!

test.py bug

你在计算num_total时 统计了所有拥有positive 实体对的个数,但在计算召回率的时候 可能会算上negative 的 导致后面的召回率大于1的

sampletimes = 3 的含义

你好 在rl模型部分 有sample_times=3的设置 请问是什么意思呢? 在原文的algorithm 2里似乎只sample一次吧?

关于自己测试与您给的模型结果差别较大的问题

作者您好:
对于您的代码,我完全按照流程,自己训练好模型,测试的联合模型结果为[0.52, 0.53, 0.44333333333333336],远低于您给的best_CNN_model的结果[0.8, 0.735,0.7066666666666667],同时原始CNN模型的效果也低于您文件中写的CNN模型效果。请问您在得到best模型使用了哪些效果提升的方法么?
不好意思打扰您了~

missing npy file in ./data

Where are all_sentence_ebd.npy, all_reward.npy, average_reward.npy? It can't be generated in initial.py.

selected_cnn_model.ckpt保存后似乎没有使用

Hi 在rlmodel.py的最后一行(448行)保存了一个selected_cnn_model.ckpt,但是在后面的代码中似乎没有用到这个ckpt,在cnnrlmodel.py里的171行interact = cnnmodel.interaction(sess1,save_path='model/origin_cnn_model.ckpt'),这里的origin_cnn_model.ckpt是否应该换成selected_cnn_model.ckpt呢?

pre-train时epoch设置问题

你好 请问一下 在pretrain阶段(pretrain cnn和rl的时候) 是需要把两个网络train到完全收敛吗?

test出错

您好,我在运行test.py出现:
FileNotFoundError: [Errno 2] No such file or directory: 'data/testall_word.npy'
在data文件夹下并没有这个npy文件,请问这个文件是和cnndata里面相同的吗?

About the sentence size

chosen sentence size: 364691
total_reward: -0.150552
best_reward -0.150552
Excuse me, the total sentence size is 280579, why the chosen size is 364691 which is lager than total sentence size?

About the chosen sentence

chosen sentence size: 224149
total_reward: -0.24561
best_reward -0.24561
Excuse me , how can I get the data set of the 224149(280579) chosen sentence ?

关系训练rl模型

您好我在运行rlmodel.py的时候,一直选择的都是整个训练集的所有句子,并没有进行句子筛选,请问是怎么回事呢?
chosen sentence size: 235962
total_reward: -1.0407107
best_reward -1.0406367
chosen sentence size: 235962
total_reward: -1.0407107
best_reward -1.0406367
chosen sentence size: 235962
total_reward: -1.0407109
best_reward -1.0406367
chosen sentence size: 235962
total_reward: -1.040711
best_reward -1.0406367
chosen sentence size: 235962
total_reward: -1.0407109
best_reward -1.0406367

PCNN关系抽取器

您好,我看这个代码只有CNN的,没有使用PCNN来跑实验吗?

initial.py with error

ub16c9@ub16c9-gpu:/ub16_prj/TensorFlow_RLRE$ python3.6 initial.py
reading train data...
Traceback (most recent call last):
File "initial.py", line 482, in
init_entityebd()
File "initial.py", line 393, in init_entityebd
en1 = content[2]
IndexError: list index out of range
ub16c9@ub16c9-gpu:
/ub16_prj/TensorFlow_RLRE$

Question about parameters updating

Hi,
Thanks for your code. I have a question about parameters updating.
In Algorithm 2 of the paper, after computing delayed reward for one bag, the original policy network will be updated (See: Update the parameter Theta of instance selector...).
But in rlmodel.py, my understanding is that both the original policy network and the target policy network are updated after the decision process of all bags (line 308 for the original one, and line 317 for the target one), and the gradient is the sum of all bags (+= of line 279).
So, do I understand your code wrongly? Or the implementation is different from Algorithm 2?
Thanks.

关于测试的一个问题

文中提到这个模型是sentence-level的relation extracion模型,把每一个句子看成一个包来训练。您的代码中好像是根据包(entity pair)来测试的。请问您这种测试方法是否可行。谢谢.

sampletimes = 3问题

在rlmodel 中定义sampletimes = 3 ,网络结构并没有改变,只是重复计算prob吗? list_state, list_action三次采样应该都是一样的值。

for j in range(sampletimes):
                      #reset environment
                      state = env.reset( batch_en1, batch_en2,batch_sentence_ebd,batch_reward)
                      list_action = []
                      list_state = []
                      old_prob = []


                      #get action
                      #start = time.time()
                      for i in range(batch_len):

                          state_in = np.append(state[0],state[1])
                          feed_dict = {}
                          feed_dict[myAgent.entity1] = [state[2]]
                          feed_dict[myAgent.entity2] = [state[3]]
                          feed_dict[myAgent.state_in] = [state_in]
                          prob = sess2.run(myAgent.prob,feed_dict = feed_dict)

                          old_prob.append(prob[0])
                          action = get_action(prob)
                          #add produce data for training cnn model
                          list_action.append(action)
                          list_state.append(state)
                          state = env.step(action)

对这个work有一个疑惑:

我在研究您的论文时,产生了一个疑惑:
你的模型/方法破坏了training set & testing set的原始分布。

其他的RL工作都是基于改变模型参数来适配拟合数据的,也就是不会改变training data & testing data。这样就保证了training set & testing set的原始分布。

但是这篇文章的工作核心是:用RL来对原始training数据的noise bag进行剔除,通过标签Y改变input data。这在training阶段是OK的,这样做确实可以减少noise data对我的分类模型的干扰。但是在test阶段还能这样吗?test set都没label了,如何反馈reward给policy module进行test set中的bag的剔除?那么我在test phrase还如何work呢?

我看了代码,发现in test phrase,确实是直接对test set用CNN做关系分类。

谢谢。

数据集问题

想问一下关于数据集的问题,这个数据集处理后得到的train有577088个句子,但论文里提到的是522611个句子,这是因为原本的数据集的train和test有部分的entity pair重复了。PCNN+ATT这篇论文过滤处理后得到是522611个句子的规模。但在Feng的源代码和您这个代码好像都是直接使用未过滤的。

实验结果召回率低

你好,很高心你复现了rlcnn的tensorflow版。
我再复现时遇到一个问题,就是结果的recall比较低:
numtotal: 1761
true_positive: 578
在1761个实体对中只识别出578个TP
P_R图如下:
捕获
捕获

vec.txt问题

请问vec.txt,有没有中文格式的,能共享一下吗,谢谢

Issue with the test code (poor performance)

Running the test code on the provided dataset using the best models gives very poor performance.
Here are the p@n scores I got-

best_cnn_P@100,200,300: [0.04, 0.03, 0.02]

I get quite similar scores even if I train the CNN model and then run tests.
Could it possibly be an issue with the test code?
I'm currently using Tensorflow version 1.6.0 on Python 3.5.

nyt10训练数据问题

我想问一下,origin_data目录下的train.txt文件中只有一个网址,训练数据怎么获得? 或者说能否提供一个nyt10训练数据的网址

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.