5 Star 13 Fork 7

liuyaox / roadmap_nlp

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
15-Pairwise_Input.md 3.18 KB
一键复制 编辑 原始数据 按行查看 历史
liuyaox 提交于 2019-09-10 20:04 . simplified papers

15. Pairwise Input

15.1 Overview

NLP领域的任务的输入输出有以下几种:

输入 输出 示例 备注
Seq label
Seq1 Seq2 所有Seq2Seq问题,如翻译、Chatbox、序列生成等
Seq1 + Seq2 label Pairwise类问题,比如判断2个Seq的关系或相似度、Chatbox等

除7.2外,其他模型结构都是或类似于双胞胎网络(Siamese Network),2个网络的结构是完全一致的,但其参数,有时共享,有时不同?

Paper

Practice

  • https://github.com/brightmart/nlu_sim (Tensorflow)

    all kinds of baseline models for modeling tasks with pair of sentences: semantic text similarity(STS), natural language inference(NLI), paraphrase identification(PI), question answering(QA)

    模型有:DualTextCNN, DualBiLSTM, DualBiLSTMCNN, ESIM, SSE, BiLSTM with Attention

15.2 BiLSTMTextRelation

Structure: Input(Seq EOS Seq) -> Embeddding -> BiLSTM -> Average -> Softmax

Same with TextRNN, but input is special designed.

e.g. input: "How much is the computer ? EOS Price of laptop", where 'EOS' is a special token splitted input1 and input2

Code

15.3 twoCNNTextRelation - OK

Structure: (Input1 -> Embedding -> TextCNN) * 2 -> Concatenate -> Softmax

产品词关系项目中使用的模型与此类似,在此基础上增加了第3个Input(结构化输入)。

Code

15.4 BiLSTMTextRelationTwoRNN

又叫 Dual Encoder LSTM Network ?

The Ubuntu Dialogue Corpus: A Large Dataset for Research in Unstructured Multi-Turn Dialogue Systems-2016

Structure: Seq1(Input1 -> Embedding -> BiLSTM) + Seq2(Input2 -> Embedding -> BiLSTM) -> Dot Product -> Softmax

Dot Product作用:To measure the similarity of the predicted response r' and the actual response r by taking the dot product of these two vectors. A large dot product means the vectors are similar and that the response should receive a high score. We then apply a sigmoid function to convert this score into a probability. Similarity --> Probability

bilstm_textrelation_twornn_structure

Article

15.5 Others

Paper

Python
1
https://gitee.com/liuyaox/roadmap_nlp.git
git@gitee.com:liuyaox/roadmap_nlp.git
liuyaox
roadmap_nlp
roadmap_nlp
master

搜索帮助