K-NRM icon indicating copy to clipboard operation
K-NRM copied to clipboard

关于怎么处理文档

Open Chandler-Bing opened this issue 5 years ago • 5 comments

您好,对于训练数据来说: 1,2,3 \t 4,5,6 \t 7,8,9 代表一个样本的话那么1,2,3分别是种子词的对应的id, 那么4,5,6,是3篇文档的编号吗?这个编号是怎么来的,随机分配的吗? 怎么处理文档这里不太了解,是先要分词吗?就是map成id这部不太明白,如果有时间的话 解答一下吧,谢谢您!

Chandler-Bing avatar Apr 19 '19 11:04 Chandler-Bing

您好! 步骤是:分词,再把每个词分配一个ID。可以随机分配。

输入样本是query的词的id \t relevant document的词的id \t Irrelevant document 的词的id

比如 Query: Baidu Relevant Doc: baidu.com Irrelevant Doc: yahoo.com

词和id的map: Baidu 1 Yahoo 2 Com 3

那么我的样本是 1 \t 1,3 \t 2,3

On Fri, Apr 19, 2019 at 7:09 AM Chandler-Bing [email protected] wrote:

您好,对于训练数据来说: 1,2,3 \t 4,5,6 \t 7,8,9 代表一个样本的话那么1,2,3分别是种子词的对应的id, 那么4,5,6,是3篇文档的编号吗?这个编号是怎么来的,随机分配的吗? 怎么处理文档这里不太了解,是先要分词吗?就是map成id这部不太明白,如果有时间的话 解答一下吧,谢谢您!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/AdeDZY/K-NRM/issues/14, or mute the thread https://github.com/notifications/unsubscribe-auth/ABHQHGAGIXTDVFWKKWYP3Z3PRGR67ANCNFSM4HHDQNLQ .

AdeDZY avatar Apr 20 '19 00:04 AdeDZY

谢谢师姐!(真的谢谢谢谢谢!)

Chandler-Bing avatar Apr 20 '19 02:04 Chandler-Bing

不客气~欢迎提问和讨论!

On Fri, Apr 19, 2019 at 10:11 PM Chandler-Bing [email protected] wrote:

谢谢师姐!(真的谢谢谢谢谢!)

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/AdeDZY/K-NRM/issues/14#issuecomment-485050665, or mute the thread https://github.com/notifications/unsubscribe-auth/ABHQHGBO7LCOUUVKF6MELWLPRJ3UHANCNFSM4HHDQNLQ .

-- Zhuyun Dai Language Technologies Institute School of Computer Science 5000 Forbes Avenue Pittsburgh, PA 15213

AdeDZY avatar Apr 20 '19 02:04 AdeDZY

师姐您好,项目中有个小问题,假设我的用的20ng的数据集,一共20个类,每个类500篇文档的话,不到40M的原数据,如果每个类有5个种子词,每篇文档中有300个不同的词的话。那训练集的格式就是20 * 500 * (19500) ,种子词有20中选择,每个种子词类别对应500篇pos文档,对应19500篇neg文档,那这样的话再乘以每篇文档300个词的编号,训练集会非常大,感觉40M文本的数据集处理成10几个g的训练集,冗余的信息是不是太多了?感觉像是无意义的扩充。。。(PS,我这样处理的过程是正确的吗?感谢师姐解答(^_^))

Chandler-Bing avatar Apr 22 '19 12:04 Chandler-Bing

negative samples在训练的时候可以sub-sampling,不用把所有的文章都用上

On Mon, Apr 22, 2019 at 8:51 AM Chandler-Bing [email protected] wrote:

师姐您好,项目中有个小问题,假设我的用的20ng的数据集,一共20个类,每个类500篇文档的话,不到40M的原数据,如果每个类有5个种子词,每篇文档中有300个不同的词的话。那训练集的格式就是20

  • 500 * (19500) ,种子词有20中选择,每个种子词类别对应500篇pos文档,对应19 500篇neg文档,那这样的话再乘以每篇文档300个词的编号,训练集会非常大,感觉40M文本的数据集处理成10几个g的训练集,冗余的信息是不是太多了?感觉像是无意义的扩充。。。(PS,我这样处理的过程是正确的吗?感谢师姐解答( ^_^))

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/AdeDZY/K-NRM/issues/14#issuecomment-485410564, or mute the thread https://github.com/notifications/unsubscribe-auth/ABHQHGHZ37CGG6EM67G2HL3PRWYGLANCNFSM4HHDQNLQ .

-- Zhuyun Dai Language Technologies Institute School of Computer Science 5000 Forbes Avenue Pittsburgh, PA 15213

AdeDZY avatar Apr 22 '19 14:04 AdeDZY