應用記憶增強條件隨機場域與之深度學習及自動化詞彙特徵於中文命名實體辨識之研究 (Leveraging Memory Enhanced Conditional Random Fields with Gated CNN and Automatic BAPS Features for Chinese Named Entity Recognition)
7474Authors
nan
Abstract
Named Entity Recognition (NER) is an essential task in Natural Language Processing. Memory Enhanced CRF (MECRF) integrates external memory to extend Conditional Random Field (CRF) to capture long-range dependencies with attention mechanism. However, the performance of pure MECRF for Chinese NER is not good. In this paper, we enhance MECRF with Stacked CNNs and gated mechanism to capture better word and sentence representation for Chinese NER. Meanwhile, we combine both character and word information to improve the performance. We further improve the performance by importing common before and common after vocabularies of named entities as well as entity prefix and suffix via feature mining. The BAPS features are then combined with character embedding features to automatically adjust the weight. The model proposed in this research achieve 91.67% tagging accuracy on the online social media data for Chinese person name recognition, and reach the highest F1-score 92.45% for location name recognition and 90.95% overall recall rate in SIGHAN-MSRA dataset. Keyword: Machine Learning, Named Entity Recognition, Memory Network, Feature Mining 1. 緒論 (
Keywords
Full Content
Computational Linguistics and Chinese Language Processing Vol. 24, No. 1, June 2019, pp. 1-14 1 The Association for Computational Linguistics and Chinese Language Processing 應用記憶增強條件隨機場域與之深度學習及 自動化詞彙特徵於中文命名實體辨識之研究 Leveraging Memory Enhanced Conditional Random Fields with Gated CNN and Automatic BAPS Features for Chinese Named Entity Recognition 簡國峻、張嘉惠 Kuo-Chun Chien and Chia-Hui Chang 摘要 命名實體辨識是在自然語言處理當中一個重要的任務。現今基礎深度學習模型 應用於資料品質較為優良的命名實體擷取,雖有不錯的效果,但在社群媒體資 料集中卻未能達到傳統條件隨機場域之基準值。由於一個命名實體有能可多次 在文中提及,因此藉由上下文資訊來改進命名實體的擷取也是近年來的研究方 向。在本研究中,我們延伸記憶增強條件隨機場域 MECRF 於中文的命名實體 擷取,利用門控卷積網路及雙向 GRU 網路來增強記憶條件隨機場域,以利模 型抓取長距離的文章資訊。此外,也藉由特徵探勘擷取命名實體前後詞彙以及 前綴後綴詞彙特徵(簡稱為 BAPS),並使用模型可自動訓練的參數,自動調 整詞向量及 BAPS 詞彙特徵。最後我們同時採用字元及詞彙向量來增進模型的 效能。本研究所提出之模型,在網路社群媒體的人名辨識資料中可以達到的 91.67%準確率,在 SIGHAN-MSRA 中也得到最高的 92.45%地名實體辨識效 果及 90.95%整體召回率。 關鍵詞:機器學習、命名實體辨識、神經網路、特徵探勘 國立中央大學資訊工程學系 Department of Computer Science & Information Engineering, National Central University E-mail: qk0614@gmail.com; chia@csie.ncu.edu.tw 2 簡國峻與張嘉惠 Abstract Named Entity Recognition (NER) is an essential task in Natural Language Processing. Memory Enhanced CRF (MECRF) integrates external memory to extend Conditional Random Field (CRF) to capture long-range dependencies with attention mechanism. However, the performance of pure MECRF for Chinese NER is not good. In this paper, we enhance MECRF with Stacked CNNs and gated mechanism to capture better word and sentence representation for Chinese NER. Meanwhile, we combine both character and word information to improve the performance. We further improve the performance by importing common before and common after vocabularies of named entities as well as entity prefix and suffix via feature mining. The BAPS features are then combined with character embedding features to automatically adjust the weight. The model proposed in this research achieve 91.67% tagging accuracy on the online social media data for Chinese person name recognition, and reach the highest F1-score 92.45% for location name recognition and 90.95% overall recall rate in SIGHAN-MSRA dataset. Keyword: Machine Learning, Named Entity Recognition, Memory Network, Feature Mining 1. 緒論 (Introduction) 命名實體辨識(Named Entity Recognition, NER)是自然語言處理中訊息理解的第一步,其 目標是提取當中的命名實體並歸類到預先定義的分類當中,如:人名、地名、組織等。 傳統的機器學習於命名實體的辨識任務中,大多使用統計式條件隨機場域進行序列標記, 因此受限於小範圍的特徵擷取。如何在中文的資料集當中擷取參考長距離上下文資訊, 判斷當前字詞正確的語意,進而正確的辨識命名實體,是機器理解訊息根本的任務。 近年來深度學習被運用在序列標記的模型建立,得到不錯的進展。例如 Huang 在序 列標記的任務上使用長短期記憶(Huang, Xu & Yu, 2015),應用於英文的資料集當中獲得 了非常好的效能。Liu 等人於 IJCNLP 2017 將記憶網路的概念加入條件隨機場域當中(Liu, Baldwin & Cohn, 2017),提出 MECRF 架構,透過整合上下文額外的記憶,使模型能夠獲 取較長範圍以外的文章特徵,同樣在英文資料集上獲得了出色的表現。然而這些基礎深 度學習模型應用於資料品質較為優良的資料集上,雖均有不錯的效果,但在社群媒體資 料集中卻未能達到傳統機器學習方式之基準值,因此如何有效地擷取文字中所隱含的資 訊,使模型有較好的濾除雜訊之能力,也是在應用上非常重要的一環。 為改善上述的限制,本研究延伸記憶增強條件隨機場域 MECRF 於中文命名實體辨 識任務;MECRF 的概念是基於上下文可能不只一次提及實體名稱,以及 Attention 機制 的應用,藉以更正確找出命名實體。我們首先透過訓練詞向量模型,將字元轉換為數值 應用記憶增強條件隨機場域與之深度學習及 3 自動化詞彙特徵於中文命名實體辨識之研究 化之資料;再藉由卷積層、雙向 GRU 層提供模型更多的特徵,及整合長距離文章資訊 的記憶層,使命名實體任務不同於往常僅能夠擷取小範圍的資訊,能夠獲取豐富完整的 文章訊息。此外,也藉由特徵的探勘(Chou & Chang, 2017),並使用深度學習模型可自動 訓練的參數,自動調整詞向量及詞彙特徵,除長距離的文章資訊外,更能充分獲得文章 所隱藏的訊息。 本研究所使用的資料為 Chou 及 Chang 所使用的 PerNews 測試資料集,但其資料集 是以句子為單位進行標記,並無上下文,因此我們自製爬蟲程式,蒐集原始資料的網路 新聞及社群媒體做為訓練及測試資料。經實驗結果比較,在網路社群媒體的資料中可以 達到的 91.67%的標記準確率,與尚未加入記憶的模型相比大幅提升 2.9%,再加入詞向 量及詞彙特徵,與基礎的記憶模型相比更是提升了 6.04%。本研究所提出之模型也在 SIGHAN-MSRA 中得到最高的 92.45%地名實體辨識效果及 90.95%召回率。 2. 相關文獻回顧 (Related Work) 序列標記已經發展許久,常見的模型有隱藏式馬可夫模型(Hidden Markov Model, HMM)、 最大化熵馬可夫模型(Maximum Entropy Markov Model, MEMM)以及條件隨機場域 (Conditional Random Field, CRF)。Lafferty 等人(2001)所提出的條件隨機場域在自然語言 處理序列標記(Sequence Labeling)的任務中,是多數人的選擇且被廣泛的應用,但是條件 隨機場域僅能夠抓取小範圍的文章資訊(Finkel, Grenager & Manning, 2005),對於獲取整 篇文章中的資訊則是條件隨機場域關鍵的限制。 2.1 卷積神經網路(Convolutional Neural Networks) 卷積神經網路是一種前饋神經網路,通常由卷積層(Convolutional)、池化層(Pooling)、全 連接層(Fully-Connected)組成,相較於其他的網路,卷積神經網路所需要使用的參數較少, 因而成為一種頗具吸引力的深度學習模型。卷積神經網路擁有能夠自動抓取相鄰特徵的 優點,Collobert 等人(2011)首先將卷積神經網路自動抓取相鄰特徵的優點應用在自然語 言處理的序列標記任務中,讓自然語言處理不再相依於專業知識特製而成的特徵模板。 近期,Wang 等人(2017)透過堆疊式的卷積神經網路更有結構、多階層地萃取中文語意特 徵,同時結合 Dauphin 等人(2016)提出的閘門線性單元(Gated linear unit, GLU),應用於 中文斷詞任務中。 2.2 遞歸神經網路(Recurrent Neural Networks) RNN 則是另一種處理序列型輸入的神經架構,但是單純的 RNN 模型無法擷取長距離的 文章資訊,為了不受局部限制的影響,因此有常短期記憶(Long Short Term Memory)的提 出。Huang 等人(2015)在序列標記的任務上使用長短期記憶,導入雙向(Bidirectional)的概 念來擷取正向及反向的資訊,應用於英文的資料集當中獲得了非常好的效能。 但是遞歸神經網路隨著輸入句子的長度增加(Cho, van Merrienboer, Bahdanau & 4 簡國峻與張嘉惠 Bengio, 2014),會帶來效能的惡化。在相關的研究(Lai, Xu, Liu & Zhao, 2015; Linzen, Dupoux & Goldberg, 2016)更顯示,遞歸神經網路包括其變化之類型,儘管已經加入時間 序列的標記,但仍偏向於相鄰的字元資訊,在涉及遠程上下文依賴性的判斷中表現不佳。 2.3 記憶網路(Memory Networks) 傳統的條件隨機場域沒有能力去抓取較長範圍以外的文章特徵,而遞歸神經網路在長距 離的文章資訊擷取上效能也並不出色,因此,Weston 等人提出記憶網路(Memory Network) 來增強擷取長範圍文章特徵的表現,並應用於問答(QA)的任務當中(Weston, Chopra & Bordes, 2014),證明記憶的增加對於執行需要常距離文章資訊的推理至關重要。 近期,Liu 將記憶網路的概念加入條件隨機場域當中(Liu et al., 2017),透過整合額外 的記憶(Memory),使模型能夠獲取較長範圍以外的文章特徵,並且在英文資料集上獲得 了出色的表現。 3. 模型架構及方法(Model Architecture and Method) 在命名實體辨識標記任務中,每一個句子 S 是由 T 字元(character)組合而成的序列 � � ����, ⋯ , ���,其對應的標籤序列可表示為� � ����, ⋯ , ���。不同於傳統的條件隨機場 域僅需要輸入句子,MECRF 的特點是另有上下文資訊或稱之為記憶體��。假設每篇文 章是由|D|句子組成� � ����, ⋯ , �|�|�,與其對應的序列標籤集合� � ���, �� … , �|�|�。為避免 輸入整篇文章造成記憶體消耗過大,我們僅抓取當前句子��的前後 B 句共抓取 2B+1 個 句子���=�����, ⋯ , ��, ⋯ , �����做為短期記憶(short context),其長度可記為 N=∑ �� ��� ����� (其中��表句子��的長度)。每個輸入字元w�可以透過 word2vec 或 GloVe 對文字進行 編碼, 以EMB�w��來表示。假設 D 為 Embedding 的維度,則短期記憶增強隨機場域的輸 入序列為大小 TxD 的句子E�、和 …
Content truncated to 500 words
Labeled Text
Named Entity Recognition (NER) is an essential task in Natural Language Processing. Memory Enhanced CRF (MECRF) integrates external memory to extend Conditional Random Field (CRF) to capture long-range dependencies with attention mechanism. However, the performance of pure MECRF for Chinese NER is not good. In this paper, we enhance MECRF with Stacked CNNs and gated mechanism to capture better word and sentence representation for Chinese NER. Meanwhile, we combine both character and word information to improve the performance. We further improve the performance by importing common before and common after vocabularies of named entities as well as entity prefix and suffix via feature mining. The BAPS features are then combined with character embedding features to automatically adjust the weight. The model proposed in this research achieve 91.67% tagging accuracy on the online social media data for Chinese person name recognition, and reach the highest F1-score 92.45% for location name recognition and 90.95% overall recall rate in SIGHAN-MSRA dataset. Keyword: Machine Learning, Named Entity Recognition, Memory Network, Feature Mining 1. 緒論 (
Publication Details
- Paper ID:
- 7474
- Year:
- 2019
- Publication:
- TIPSTER
- Publication Type:
- conf
- DOI:
- nan