李寬宇 袁健 沈?qū)庫(kù)o
摘 ?要: 在知識(shí)庫(kù)問答系統(tǒng)任務(wù)中,由于自然語(yǔ)言表達(dá)方式的多樣性與復(fù)雜性,語(yǔ)義相同表達(dá)方式不同的問句得到的答案可能不同,生成問句釋義可以緩解這一問題。其次,關(guān)系檢測(cè)是知識(shí)庫(kù)問答系統(tǒng)中至關(guān)重要的一步,問答系統(tǒng)回答問題的準(zhǔn)確性主要受這一步驟的影響,傳統(tǒng)的基于注意力機(jī)制的關(guān)系檢測(cè)模型沒有考慮到答案路徑不同抽象級(jí)別的不同重要程度。因此,本文提出了基于問句釋義和詞級(jí)別注意力機(jī)制的關(guān)系檢測(cè)模型,用于知識(shí)庫(kù)問答系統(tǒng)任務(wù)中,實(shí)驗(yàn)表明本文模型回答問題準(zhǔn)確率較高。
關(guān)鍵詞: 問句釋義;詞級(jí)別注意力;關(guān)系檢測(cè);知識(shí)庫(kù)問答系統(tǒng)
中圖分類號(hào): TP391.1 ? ?文獻(xiàn)標(biāo)識(shí)碼: A ? ?DOI:10.3969/j.issn.1003-6970.2019.05.013
本文著錄格式:李寬宇,袁健,沈?qū)庫(kù)o. 融合了問句釋義和詞級(jí)別注意力的關(guān)系檢測(cè)模型[J]. 軟件,2019,40(5):7176
【Abstract】: In the knowledge base question answer system, due to the diversity and complexity of natural language expression, the question with the same semantic but different expressions may yield different answer. The generation of paraphrase can alleviate this problem. Secondly, relation detection is a crucial step in the knowledge base question answer system. The accuracy of the question answering system to answer questions is mainly affected by this step. The traditional attention-based relation detection model does not take into account the importance of different part of the different abstract levels of the answer path expression. Therefore, this paper proposes a relation detection model based on paraphrase and word-level attention mechanism, which is used in the knowledge base question answer system end task. Experiments show that the model has higher accuracy in answering questions.
【Key words】: Paraphrase; Word-level attention; Relation detection; KB-QA
0 ?引言
知識(shí)庫(kù)問答系統(tǒng)以自然語(yǔ)言為基本輸入方式,給用戶返回一個(gè)精準(zhǔn)的答案。隨著越來越多的大規(guī)模知識(shí)庫(kù)的發(fā)展,比如像Freebase[1]、yago[2]、DBpedia[3],基于知識(shí)庫(kù)的問答系統(tǒng)使得傳統(tǒng)的搜索引擎處于深度變革的尖端。不同于現(xiàn)有的基于關(guān)鍵字匹配的搜索方式,基于知識(shí)庫(kù)的問答系統(tǒng)需要從語(yǔ)義角度對(duì)自然語(yǔ)言進(jìn)行理解,然后從知識(shí)庫(kù)中進(jìn)行推理查詢找出問題答案。常見的基于知識(shí)庫(kù)的問答系統(tǒng)大致遵循兩個(gè)步驟:(1)實(shí)體鏈接,將問句中的主題詞對(duì)應(yīng)到知識(shí)庫(kù)中的節(jié)點(diǎn)實(shí)體,找出包含問題答案的候選知識(shí)庫(kù)子圖。(2)關(guān)系檢測(cè),檢查知識(shí)庫(kù)中某個(gè)節(jié)點(diǎn)到主題詞節(jié)點(diǎn)之間的路徑是否與問句中的謂詞相匹配。
在自然語(yǔ)言表達(dá)中,相同的意思可以有多種不同的表達(dá)方式,例如“阿里巴巴的創(chuàng)始人是誰(shuí)?”和“誰(shuí)創(chuàng)建了阿里巴巴?”。這種情況在問答系統(tǒng)中普遍存在,對(duì)于語(yǔ)義相同但表達(dá)方式不同的句子,問答系統(tǒng)給出的答案可能會(huì)不同。在關(guān)系檢測(cè)這一子任務(wù)中,需要依據(jù)某些規(guī)則對(duì)問句和知識(shí)庫(kù)子圖中候選答案到主題詞節(jié)點(diǎn)之間的路徑進(jìn)行信息抽取,利用深度學(xué)習(xí)方式進(jìn)行自動(dòng)特征提取是近幾年主流的研究方向,首先需要對(duì)自然語(yǔ)言問句和候選答案進(jìn)行向量化建模,考慮到問句不同部分具備不同的重要程度,因此在深度學(xué)習(xí)模型中引入注意力機(jī)制。對(duì)于答案路徑的向量化表示中,有兩種不同抽象級(jí)別的表示方法,一種是關(guān)系級(jí)別表示法,另一種是詞級(jí)別表示法,前者更考慮的是與問句全局語(yǔ)義信息進(jìn)行匹配,而后者考慮的局部信息的匹配,目前很多文章結(jié)合這兩種不同抽象級(jí)別的表達(dá)方式。傳統(tǒng)注意力機(jī)制只考慮了問句各部分的注意力程度,沒有考慮到不同表達(dá)方式問句適合用不同抽象級(jí)別答案路徑表示來與它進(jìn)行匹配。
為解決以上問題,本文為知識(shí)庫(kù)問答系統(tǒng)提出了一種基于融入了問句釋義(paraphrase)和詞級(jí)別注意力的關(guān)系檢測(cè)模型,用問題-答案對(duì)進(jìn)行端到端的訓(xùn)練,將整個(gè)模型分成釋義預(yù)測(cè)和關(guān)系檢測(cè)模型兩個(gè)部分,實(shí)驗(yàn)表明本文模型能提高問答系統(tǒng)回答問題的準(zhǔn)確率。
1 ?相關(guān)研究
現(xiàn)有的知識(shí)庫(kù)問答系統(tǒng)主要有兩大分支:(1)基于語(yǔ)義分析的方式,例如有文獻(xiàn)[4]文獻(xiàn)[5]。(2)基于信息檢索的方式,例如有文獻(xiàn)[6]文獻(xiàn)[7]?;谡Z(yǔ)義分析方式為了將自然語(yǔ)言翻譯成包含語(yǔ)義信息的邏輯形式,需要大量帶注解的邏輯形式作為訓(xùn)練數(shù)據(jù),嚴(yán)重消耗人工成本。
語(yǔ)義分析方式最主要的缺點(diǎn)沒有利用到知識(shí)庫(kù)提供的背景知識(shí),為此,Yao和Van Durme等人[6]提出信息檢索的方法,通過實(shí)體鏈接縮小了查找范圍。針對(duì)關(guān)系檢測(cè)這一步驟,最開始Yao和Van Durme通過手工構(gòu)建問題與候選答案路徑的特征,構(gòu)造分類器對(duì)問句中的關(guān)系謂詞進(jìn)行識(shí)別,再與候選答案路徑進(jìn)行相似度匹配。為減少人工成本bordes等人[8]將問題和答案路徑都映射到低維空間,通過模型的訓(xùn)練,學(xué)習(xí)到它們的向量化表示,向量相似度最高的那條答案路徑對(duì)應(yīng)的節(jié)點(diǎn)作為問題的答案。
用深度學(xué)習(xí)模型在知識(shí)庫(kù)問答系統(tǒng)當(dāng)中進(jìn)行關(guān)系檢測(cè)是目前主流的方法,Zeng等人[9]用CNN-RNN(卷積神經(jīng)網(wǎng)絡(luò)-循環(huán)神經(jīng)網(wǎng)絡(luò))網(wǎng)絡(luò)提取問句特征,依據(jù)候選關(guān)系對(duì)問句關(guān)系類型進(jìn)行分類,Bordes等人[15]將自然語(yǔ)言問句與候選答案路徑用神經(jīng)網(wǎng)絡(luò)映射到相同維度的向量空間,然后比較他們的相似度,Wang等人[10]在此基礎(chǔ)上加入注意力機(jī)制對(duì)反應(yīng)實(shí)體關(guān)系更重要的詞基于更大的權(quán)重,從而提高關(guān)系檢測(cè)的精度,Dong等人[9]用卷積神經(jīng)網(wǎng)絡(luò)(CNN)對(duì)自然語(yǔ)言進(jìn)行建模,依據(jù)候選答案的三個(gè)方面分別求得相同問句不同部分不同的注意力權(quán)重,簡(jiǎn)單的將答案路徑表示為固定的向量。
大多數(shù)深度學(xué)習(xí)方法都需要對(duì)自然語(yǔ)言和候選答案的答案路徑進(jìn)行相似度評(píng)估,在這之前需要對(duì)問句和路徑信息進(jìn)行向量化建模,以上這些方法重點(diǎn)在于對(duì)問句的向量化建模,對(duì)于答案路徑的向量化表示,主要有兩類,第一類將關(guān)系表示為一種語(yǔ)義單元,用提前訓(xùn)練好的神經(jīng)網(wǎng)絡(luò)模型例如TransE[12]生成它的向量化表示,另一類將關(guān)系表示為一系列的單詞或者是一系列符號(hào)[13],與自然語(yǔ)言共享詞嵌入,Yu等人[14]結(jié)合了兩種不同的表示方法,但不能求得答案路徑不同抽象級(jí)別的部分的注意力權(quán)重。
為了解決語(yǔ)義相同表達(dá)方式不同的問句獲得的答案不同這一問題,很多深度學(xué)習(xí)模型將問句和它的釋義都輸入到問答系統(tǒng)模型當(dāng)中進(jìn)行訓(xùn)練,以求得問句與它的釋義相似的向量化表示,如文獻(xiàn)[9]文獻(xiàn)[15]。現(xiàn)有的問句釋義生成模型有很多,但將生成所有的釋義同等看待并不合理,為此Chen等人[17]構(gòu)建語(yǔ)法特征來評(píng)估其與原問句之間的相似性,Narayan等人[18]提出了一種基于深度學(xué)習(xí)的相似性評(píng)估模型,將與問句相似度高的釋義作為最終的釋義。然而這些模型沒有充分利用問題答案對(duì)這種監(jiān)督數(shù)據(jù),生成的釋義不能放到問答系統(tǒng)任務(wù)中檢驗(yàn)其有效性。
本文提出了一種融合問句釋義和答案路徑詞級(jí)別注意力模型,將模型分成兩個(gè)模塊:(1)首先生成問句的釋義,基于神經(jīng)網(wǎng)絡(luò)的評(píng)估模型評(píng)估其與原問句之間的語(yǔ)義相似度,將問句與它的釋義作為問答系統(tǒng)的輸入,來預(yù)測(cè)候選答案子圖中的答案概率分布,整個(gè)系統(tǒng)用問題-答案作為訓(xùn)練數(shù)據(jù)進(jìn)行端到端的訓(xùn)練。(2)用已有的實(shí)體鏈接系統(tǒng)得到候選答案子圖,然后用Bi-LSTM為自然語(yǔ)言和候選答案路徑進(jìn)行向量化建模,用交叉注意力模型求得他們之間的詞級(jí)別注意力得分,最終求得他們之間帶權(quán)重的向量化表示,用點(diǎn)乘積求它們之間的相似性得分,得分最高的作為最終答案。
2 ?模型概述
自然語(yǔ)言問句表示為q,答案表示為a。模型先通過實(shí)體鏈接找到對(duì)應(yīng)的候選答案知識(shí)庫(kù)子圖,然后對(duì)這些候選答案求概率分布,即求 ,概率最高的即為問題的答案。本文將整個(gè)問答系統(tǒng)分解成問句與釋義語(yǔ)義相似度評(píng)估模塊和問答系統(tǒng)模塊,將 分解為公式1。
Yih等人[13]提出的AMPCNN模型用CNN(卷積神經(jīng)網(wǎng)絡(luò))最大池化操作對(duì)問句進(jìn)行編碼,在當(dāng)時(shí)的基于答案路徑注意力的一系列關(guān)系檢測(cè)模型中取得了最高的準(zhǔn)確度。Yu等人[14]利用了不同抽象級(jí)別的答案路徑表示,為匹配不同抽象級(jí)別的答案路徑表示,用HR-Bi-LSTM網(wǎng)絡(luò)為問句進(jìn)行建模。Zhang等人[20]提出的ABWIM模型,讓比較操作在問句和答案路徑的詞級(jí)交互信息上進(jìn)行。本文模型同樣利用了問句與答案路徑的詞級(jí)交互信息,并且受益于融入問句釋義這種端到端訓(xùn)練方式,增加了問句與謂詞之間重疊的可能性,即使原問句不能生成正確答案,但它的某個(gè)釋義卻能生成正確答案,因此模型的精確度會(huì)提高。
(2)模型消融分析
為分析模型不同部分所起的作用,將對(duì)應(yīng)部分替換為普通方法,并進(jìn)行對(duì)比實(shí)驗(yàn),結(jié)果如表3所示。
無注意力的模型將注意力矩陣中注意力權(quán)重都置為1,基于路徑的注意力的模型只求問句不同部分的注意力權(quán)重,沒有求答案路徑方面的注意力得分,實(shí)驗(yàn)結(jié)果說明注意力機(jī)制在對(duì)于提高關(guān)系檢測(cè)模型的準(zhǔn)確度具有相當(dāng)?shù)淖饔茫⑶以~級(jí)別注意力機(jī)制不僅求得更精確的問句向量表示,而且能更加精確地求得答案路徑向量。本文的這種問句釋義模型使得準(zhǔn)確度提高了0.5%,說明本文這種融入問句釋義的端到端訓(xùn)練模型具有一定作用。
5 ?結(jié)論
關(guān)系檢測(cè)模型是知識(shí)庫(kù)問答系統(tǒng)中最重要的一步,這一步的準(zhǔn)確率直接影響知識(shí)庫(kù)問答系統(tǒng)回答問題的準(zhǔn)確度。從實(shí)驗(yàn)結(jié)果來看,可以得出如下結(jié)論:(1)同時(shí)使用詞級(jí)別和關(guān)系級(jí)別的答案路徑表示法,能充分匹配不同表達(dá)形式的問句。(2)若模型能充分利用問句與答案路徑的詞級(jí)別交互信息,并且求得帶權(quán)重的細(xì)粒度的問句和答案路徑向量表示法,對(duì)于提高關(guān)系檢測(cè)的準(zhǔn)確度起到非常大的作用。(3)本文融入的問句釋義模型,并利用端到端的訓(xùn)練,生成了新的訓(xùn)練數(shù)據(jù),提高了模型的準(zhǔn)確度。
參考文獻(xiàn)
[1] Bollacker, Kurt, Evans, Colin, Paritosh. Freebase: a colla-boratively created graph database for structuring human kno?w?ledge[C]// Sigmod Conference. 2008.
[2] Fabian M. Suchanek, Gjergji Kasneci, Gerhard Weikum. Yago: a core of semantic knowledge[C]// International Confere?nce on World Wide Web. 2007, pp. 697-706.
[3] Sren Auer, Christian Bizer, Georgi Kobilarov, Jens Lehmann, Richard Cyganiak, Zachary . DBpedia: A Nucleus for a Web of Open Data[C]// Semantic Web, International Semantic Web Conference, Asian Semantic Web Conference, Iswc + Aswc, Busan, Korea, November. 2007.
[4] Jonathan Berant, Andrew Chou, Roy Frostig, and Percy Liang. 2013. Semantic parsing on freebase from question- answer pairs[C]//Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing. 2013: 1533-1544.
[5] Wen-tau Yih, Xiaodong He, and Christopher Meek. Semantic parsing for single-relation question answering[C]//Proc?eedings of the 52nd Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers). 2014, 2: 643-648.
[6] Xuchen Yao and Benjamin Van Durme. Information extrac-tion over structured data: Question answering with freebase[C]//Proceedings of the 52nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers). 2014, 1: 956-966.
[7] Kun Xu, Yansong Feng, Songfang Huang, and Dongyan Zhao. Hybrid question answering over knowledge base and free text[C]//Proceedings of COLING 2016, the 26th International Conference on Computational Linguistics: Technical Papers. 2016: 2397-2407.
[8] Antoine Bordes, Sumit Chopra, and Jason Weston. 2014a. Question answering with sub-graph embeddings[C]//Proc-eedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP). Association for Computational Linguistics, pages 615-620.
[9] Daojian Zeng, Kang Liu, Siwei Lai, Guangyou Zhou, and Jun Zhao. 2014. Relation classification via convolutional deep neural network[J]. In Proceedings of COLING 2014, the 25th International Conference on Computational Linguistics: Tec?hni?cal Papers. Dublin City University and Association for Computational Linguistics, Dublin, Ireland, pages 2335- 2344.
[10] Li Dong, Furu Wei, Ming Zhou, and Ke Xu. Question answering over freebase with multi-column convolutional neural networks[C]//Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing (Volume 1: Long Papers). 2015, 1: 260-269.
[11] Linlin Wang, Zhu Cao, Gerard de Melo, and Zhiyuan Liu. Relation classification via multi-level attention cnns[J]//Pro-ce?edings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers). Asso-ciation for Computational Linguistics, Berlin, Germany. 2016, pages 1298-1307.
[12] Antoine Bordes, Nicolas Usunier, Alberto Garcia-Duran. Translating embeddings for modeling multi-relational data[C]//Advances in neural information processing systems. 2013: 2787-2795.
[13] Wenpeng Yin, Mo Yu, Bing Xiang, Bowen Zhou, Hinrich Schütze, Simple question answering by attentive convolu-tional neural network[J]. arXiv preprint arXiv: 1606.03391, 2016.
[14] Mo Yu, Wenpeng Yin, Kazi Saidul Hasan, Cicero dos Santos, Bing Xiang, Bowen Zhou. Improved Neural Relation Detec?tion for Knowledge Base Question Answering[J]. In Procee?dings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), Associa?tion for Computational Linguistics, Vancouver, Canada, 2017, pp. 571-581.
[15] Antoine Bordes, Jason Weston, Nicolas Usunier. Open Question Answering with Weakly Supervised Embedding Models[C]//Joint European Conference on Machine Learning and Knowledge Discovery in Databases. Springer-Verlag New York, Inc. 2014.
[16] Shashi Narayan, Siva Reddy, and Shay B Cohen. Paraphrase generation from Latent-Variable PCFGs for semantic parsing[J]. arXiv preprint arXiv: 1601.06068, 2016.
[17] Bo Chen, Le Sun, Xianpei Han, and Bo An. Sentence rewriting for semantic parsing [C]//Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), 2016, pages 766-777.
[18] Ellie Pavlick, Pushpendre Rastogi, Juri Ganitkevitch, Benjamin Van Durme, and Chris Callison-Burch. PPDB 2.0: Better paraphrase ranking, fine-grained entailment relations, word embeddings, and style classification[C]//Proceedings of the 53rd Annual Meeting of the Association for Computa?tional Linguistics and the 7th International Joint Conference on Natural Language Processing (Volume 2: Short Papers). 2015, 2: 425-430.
[19] Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate[J]. arXiv preprint arXiv: 1409.0473, 2014.
[20] Zhang Hongzhi, Xu Guangdong, Liang Xiao, et al. An Attention-Based Word-Level Interaction Model: Relation Detection for Knowledge Base Question Answering[J]. arXiv preprint arXiv: 1801. 09893, 2018.