自然語言生成(NLG)在很多NLP領域或任務都有涉及,比如摘要生成、VQA(視覺問答) 、翻譯、寫詩詞、寫作文、寫新聞、NBA等賽事報道、對話系統等。不同任務下的NLG也不一樣,今天我們簡單來聊聊對話系統中的NLG。

1. 簡介

對話系統按功能來劃分的話,分為閑聊型、任務型、知識問答型和推薦型。在不同類型的聊天系統中,NLG也不盡相同。

1.1. 閑聊型對話中的NLG就是根據上下文進行意圖識別、情感分析等,然後生成開放性回復;

1.2.任務型對話中的NLG就是在NLU(領域分類和意圖識別、槽填充)、DST、DPL的基礎上,根據學習到的策略來生成對話回復,一般回復包括澄清需求、引導用戶、詢問、確認、對話結束語等。如果不太明白每個階段的具體流程,可以看看我之前發的文章「任務型對話系統公式建模&&實例說明」。

1.3.知識問答型對話中的NLG就是根據問句類型識別與分類、信息檢索或文本匹配而生成用戶需要的知識(知識、實體、片段等),這類回復相比單純的信息檢索一般用戶體驗會更好,因為一般信息檢索還需要用戶根據搜索結果自己找所需信息。

1.4.推薦型對話系統中的NLG就是根據用戶的愛好來進行興趣匹配以及候選推薦內容排序,然後生成給用戶推薦的內容。

2. 先來看看我匯總的聊天系統中的NLG技術。

下面分別介紹一下對話系統中的不同NLG技術。

2.1. 傳統方法:基於模版的NLG、基於樹的NLG。

需要定義一堆模板和規則,然後映射到自然語言。

2.2. Plan-Based NLG(Walker et al., 2002)

把NLG拆分為三部分:Sentence Plan Generator(Stent et al., 2009)、Sentence Plan Reranker和Surface Realizer(Cuayahuitl et al., 2014),同時做NLG時應用了句法樹。

Sentence Planning階段生成Sentence Planning Tree (SPT) ,每個node是對話的act。

Surface realizer階段把SPT轉換成最終要生成的句子,轉換過程是所有的子節點都安了句法樹合併成父節點。

2.3. Class-Based LM(Oh and Rudnicky, NAACL 2000

這是一種基於class的語言模型做NLG,需要確定一些class,然後分別算每個class的概率,最終取最大概率的class。

2.4. Phrase-Based(Mairesse et al, 2010)

這種方法其實也使用了語言模型,優點算更高效、準確率也更高,缺點是需要很多semantic alignment和semantic stack。

2.5. Corpus based(Mairesse and Young 2014

句子生成的過程為:unordered mandatory Stack set-> ordered mandatory Stack sets -> full stack sequence -> sentences。這種方法的優點是極大的減少了人的工作以及可能帶來的錯誤,缺點是需要預先定義一些特徵集合。

2.6. RNN-Based LM(Wen et al., SIGDIAL 2015

首先說一句題外話,可能很多人不了解sigdial這個會議,其實這個會議在dialogue領域真的是很不錯的一個會議,也有很多高質量paper。這種方法結合了神經網路和語言模型,減少了很多人工,也可以對任意長的句子句子建模。

2.7. Semantic Conditioned LSTM(Wen et al., EMNLP 2015

這篇paper在使用lstm時加入了semantic,整個網路包括原始的標準lstm和dialogue act cell。

2.8. Structural NLG(Du?ek and Jur?í?ek, ACL 2016

這種方法也用了句法樹+神經網路,encode trees as sequences,然後用seq2seq來做句子生成。

2.9. Contextual NLG(Du?ek and Jur?í?ek, 2016

這也是一篇sigdial的paper。這個方法其實也是seq2seq模型,好處是生成的回復會考慮上下文,比較適合多輪對話。

2.10. Controlled Text Generation(Hu et al., 2017

這個方法是基於GAN的NLG。

2.11.Transfer learning for NLG(Wen et al., 2013.,Shi et al., 2015,?Wen et al., NAACL 2016

用遷移學習做NLG,可以解決目標領域數據不足的問題,也可以跨語言、個性化等。主要有三種打法:基於模型的遷移學習,底層網路在不同領域都一樣,在上層根據不同領域做fine-tuning;基於參數的遷移學習,暫時這方面工作沒發現太多,有知道的歡迎告知;基於Instance的遷移學習,在源領域訓練一個sc-lstm 模型,然後在目標領域做fine-tune,通過將源領域實例與僅出現在目標領域中的新slot-values相適應來構建合成數據。

3.這幾種NLG技術的對比

以上簡單介紹了11種對話系統中的NLG技術,下面簡單總結下它們的優勢和劣勢。

4.NLG技術的評估

任何一項技術想要取得進步,那麼他的評測方法是至關重要的(就相當於目標函數之於機器學習演算法),所以我列出一些關於NLG的評估。遺憾的是,目前NLG的評估我感覺並不成熟,這也是制約NLG發展的一個重要原因,如果誰能想出更好的評估方法或整理出一個業內公認的高質量數據集,那麼一定會在NLG領域有一席之地,引用量也會蹭蹭的漲。

5.一些NLG的論文

以上是我關於對話中的NLG的一些總結,因為方法太多了,所以演算法都是簡單介紹一下,下面貼出了一些代表性的paper,大家可以深入學習。另外,如果看完論文還是不太懂的歡迎微信找我討論。

Traditional

Marilyn A Walker, Owen C Rambow, and Monica Rogati. Training a sentence planner for spoken dialogue using boosting. Computer Speech & Language, 16(3):409–433, 2002.

? Amanda Stent, Rashmi Prasad, and Marilyn Walker. Trainable sentence planning for complex information presentation in spoken dialog systems. In Proceedings of the 42nd annual meeting on association for computational linguistics, page 79. Association for Computational Linguistics, 2004.

Plan-Based NLG (Walker et al., 2002)

Class-Based LM NLG

Stochastic language generation for spoken dialogue systems, Oh and Rudnicky, NAACL 2000

Phrase-Based NLG

Phrase-based statistical language generation using graphical models and active learning, Mairesse et al, 2010

Corpus based

Alice H Oh and Alexander I Rudnicky. Stochastic language generation for spoken dialogue systems. In Proceedings of the 2000 ANLP/NAACL Workshop on Conversational systems-Volume 3, pages 27–32. Association for Computational Linguistics, 2000. Oh? et al. 2000

Fran?ois Mairesse and Steve Young. Stochastic language generation in dialogue using factored language models. Computational Linguistics, 2014. Mairesse and Young 2014

Gabor Angeli, Percy Liang, and Dan Klein. A simple domain-independent probabilistic approach to generation. In Proceedings of the 2010 Conference on Empirical Methods in Natural Language Processing, pages 502–512. Association for Computational Linguistics, 2010.

Corinna Cortes and Vladimir Vapnik. Support-vector networks. Machine learning, 20(3):273–297, 1995.

Ravi Kondadadi, Blake Howald, and Frank Schilder. A statistical nlg framework for aggregated planning and realization. In ACL (1), pages 1406–1415, 2013.

Neural Network NLG

Tomas Mikolov, Martin Karafiát, Lukas Burget, Jan Cernock`y, and Sanjeev Khudanpur. Recurrent neural network based language model. In Interspeech, volume 2, page 3, 2010.

Tomá? Mikolov, Stefan Kombrink, Luká? Burget, Jan ˇCernock`y, and Sanjeev Khudanpur. Extensions of recurrent neural network language model. In 2011 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pages 5528–5531. IEEE, 2011.

Tsung-Hsien Wen, Milica Gasic, Dongho Kim, Nikola Mrksic, Pei-Hao Su, David Vandyke, and Steve Young. Stochastic language generation in dialogue using recurrent neural networks with convolutional sentence reranking. arXiv preprint arXiv:1508.01755, 2015.

Tsung-Hsien Wen, Milica Gasic, Nikola Mrksic, Pei-Hao Su, David Vandyke, and Steve Young. Semantically conditioned lstm-based natural language generation for spoken dialogue systems. arXiv preprint arXiv:1508.01745, 2015.

RNN-Based LM NLG

Stochastic Language Generation in Dialogue using Recurrent Neural Networks with Convolutional Sentence Reranking, Wen et al., SIGDIAL 2015

Semantic Conditioned LSTM

Semantically Conditioned LSTM-based Natural Language Generation for Spoken Dialogue Systems, Wen et al., EMNLP 2015

Structural NLG

Sequence-to-Sequence Generation for Spoken Dialogue via Deep Syntax Trees and Strings, Du?ek and Jur?í?ek, ACL 2016

Contextual NLG

A Context-aware Natural Language Generator for Dialogue Systems, Du?ek and Jur?í?ek, 2016

Controlled Text Generation

Toward Controlled Generation of Text , Hu et al., 2017

Transfer learning for NLG

Tsung-Hsien Wen, Aaron Heidel, Hung-yi Lee, Yu Tsao, and Lin-Shan Lee. Recurrent neural network based languagemodel personalization by social network crowdsourcing. In INTERSPEECH, pages 2703–2707, 2013. Wen et al., 2013

Yangyang Shi, Martha Larson, and Catholijn M Jonker. Recurrent neural network language model adaptation with curriculum learning. Computer Speech & Language, 33(1):136–154, 2015. Shi et al., 2015

Tsung-Hsien Wen, Milica Gasic, Nikola Mrksic, Lina M Rojas-Barahona, Pei- Hao Su, David Vandyke, and Steve Young. Multi-domain neural network language generation for spoken dialogue systems. arXiv preprint arXiv:1603.01232, 2016. Wen et al., NAACL 2016


推薦閱讀:
相关文章