Abstract
處於領先水平的命名實體識別系統嚴重依賴於人工設計的特征與特定領域的知識,從而更高效地學習小型、帶標記的語料庫 。在這篇論文里我們介紹了兩種神經結構——一種結構是基於雙向LSTM與條件隨機場,另一種結構是通過一種基於轉換、Shift-Reduce解析的算法構造並標記了單詞。我們的模型依賴於單詞信息的兩個來源:一是從帶監督語料庫中學習的基於單字的詞表示,二是從無注釋語料庫中學習的非監督詞表示。對於NER(命名實體識別),在使用四種語言且沒有任何術語資源(比如Gazetteers,斯坦福開源的地名數據庫)的前提下,我們的模型表現出了較好的性能。
1 Introduction
NER 是一個具有挑戰性的學習問題。一方面,在大多數的語言和領域中可獲取的監督訓練數據都是很少的。另一方面,對於可以命名的單詞種類限制很少,所以很難從這么小的數據集中泛化出好的模型。因此精心構造的詞素特征和術語資源,比如Gazetteers(地名數據庫),被廣泛用於解決本次任務。不幸地是,在新語言與新領域的發展過程中術語資源與特征是很昂貴的,這給新語言與新領域的發展帶來了挑戰。利用無注釋語料庫進行的無監督學習提供了一個可替代策略,以便於即使學習的是小規模的監督數據集,也有較好的泛化能力。然而,甚至那些廣泛依賴於無監督特征的系統(Collobert et al., 2011; Turian et al., 2010;Lin and Wu, 2009; Ando and Zhang, 2005b, in-ter alia) 已經使用這些去擴充,而不是代替人工設計的特征(例如關於特定語言的大寫模式和特征類別的知識)和專業知識的資源(例如地名錄)。
在這個文章中,對於NER,我們提出了一種的神經結構,它不依賴術語資源或者特征,而僅僅依賴小規模的監督訓練數據與未注釋的語料庫。我們設計的模型直觀解釋有兩個。第一,由於一個名稱通常由多個詞條組成,因此對任意一個標記的詞性標注決策進行聯合推理是很重要的。在這里我們對比了兩種模型,一種是具有序列條件隨機層的雙向LSTM(LSTM-CRF,詳見2),另一種是新模型,利用Stack LSTM表示狀態並進行Shift-Reduce解析的基於轉換的算法,構造和標記大量輸入句子(S-LSTM,詳見3)。第二,被作為一個名稱的含詞條等級的詞包括了詞的構成形式(被詞性標記為一個名稱的詞通暢是什么樣子的?)和詞的語料庫中的上下文信息(在語料庫中,被標記的詞通常位於哪里?)。為了得到詞素的敏感性,我們使用基於單字的單詞代表模型(LIng et al.,2015b)從而得到詞素在語料庫中分布的敏感性,我們將前者與在語料庫中分布的敏感性結合起來看(Mikolov et al., 2013b)。我們的單詞代表模型將這兩者結合起來,而dropout正則化訓練學習被用來改進該模型從而考慮到兩者來源對模型的貢獻(詳見4)。
英語,荷蘭語,德語和西班牙語的實驗表明,在沒有任何人工處理的特征或地名錄的前提下(詳見5),我們能夠在荷蘭語,德語和西班牙語中的LSTM-CRF模型獲得了優異的NER性能,並且在英語中也獲得了較好的NER性能。基於轉換的算法同樣以幾種語言超過了以前公布的最好結果,盡管它的表現不如LSTM-CRF模型好。
2 LSTM-CRF Model
在簡介中我們提到了LSTM與CRF,並提出了一種混合的詞性標注結構。這個結構與之前Col-lobert et al. (2011) 和 Huang et al. (2015)提出的一種結構是相似的。
2.1 LSTM
遞歸神經網絡是神經網絡的一種,它用於處理序列化的數據。設輸入的向量序列為,將輸出另一個序列
,它代表輸入序列每一步的某些信息。雖然理論上RNN也可以學習序列的長期依賴關系,但實際上它們並不能這么做而是傾向於學習最新輸入的序列(Bengio et al.,1994)。長短時記憶網絡被設計成增加緩存單元以解決該問題,並已經被證明可以學習到序列的長期依賴關系。它利用一些“門”來控制輸入到緩存單元的比例,以及遺忘先前狀態的比例。(Hochreiter and Schmidhuber, 1997)。我們使用以下實現:
這里的指的是sigmoid函數,
指的是向量元素積,即Hadamard積。
對於一個給定包含n個詞的句子,每一個都被表示為為一個d維向量,LSTM計算了句子下文每t個詞的一個輸出值
。當然,也有特指上文的輸出值
,這可以利用LSTM讀句子的反向序列實現。我們將前者稱為正向LSTM,后者稱為反向LSTM。他們是兩個截然不同的具有不同參數的網絡。正向LSTM與反向LSTM統稱為雙向LSTM(Gravesand Schmidhuber, 2005)。使用該模型時的詞表示是通過該單詞的上下文得到的,即
。這些表征有效包括了上下文中的單詞表征,這對於許多詞性標注應用都很有用。
2.2 CRF Tagging Models
一個相當簡單但是極其有效的詞性標記系統是使用 作為特征為每一個輸出
做出獨立的詞性標記決策(Ling et al.,2015b)。盡管這個模型成功解決了類似 POS tagging 這樣簡單的問題,但是當需要輸出標簽之間存在有很強的依賴關系時,它的獨立分類決策仍會受到限制。而NER就是這樣的一個任務,因為對帶多標簽的序列進行表征的語法施加了許多強約束(比如,I-PER不能遵循B-LOC;詳見2.4),這樣的話,模型一開始的獨立性假設就不滿足了。
因此,我們的模型不是獨立地詞性標記決策,而是使用條件隨機場對它們進行聯合建模(Lafferty et al., 2001)。對於這么一個輸入句子
我們認為是雙向LSTM輸出的評分矩陣。
的規模是
,這里的 k 是不同標簽的數量,而
對應句子中第 i 個詞的第 j 各標簽的評分。對於一個預測的序列
我們定義它的評分為
這里的 是一個轉換分數的矩陣,使得
表示為從標簽 i 到標簽 j 轉換的分數。
和
是一個句子的起始標簽與尾標簽,我們將它們添加到一個可能標簽的集合里。因此
是一個規模為
的方陣。
對於所有可能的標簽序列,一個 softmax 產生序列 的概率是:
在訓練過程中,我們將預測正確的標簽序列的對數概率最大化:
注意,這里的 logadd 十分突兀,譯者覺得應該是 python 中 numpy 類的 logaddexp 方法。
關於 numpy.logaddexp 鏈接如下:
https://docs.scipy.org/doc/numpy/reference/generated/numpy.logaddexp.html
回到原文。這里的 指的是對於一個句子
所有可能的標簽序列(甚至有些還沒有驗證為 IOB 格式)。對於上面的數學公式,很明顯我們鼓勵我們的網絡輸出一個有效的標簽序列。當解碼時,我們利用下面的式子:
獲得最大評分從而預測出輸出序列。
因為我們只根據各輸出之間的二元關系進行建模,所以可以用動態規划思想解決等式(1)中求和與等式(2)中的最大化y*。
2.3 Parameterization and Training
與每個詞條(即 )的每個詞性標注決策相關的評分是由雙向LSTM計算的輸出(每個詞的向量)和二元語法的轉移評分(即
)一起計算出來的。結構示意圖如 Figure 1 。圓圈代表觀測變量,菱形代表其父母的確定性函數,雙圓圈代表隨機變量。
Figure 1:網絡的主要結構。詞向量輸入到BILSTM,li 代表單詞 i 與它的上文,ri 代表單詞 i 與它的下文,把這兩者聯系起來,用 ci 代表單詞i與它的上下文。
因此,該模型的參數是二元語法模型的轉移分數矩陣,而產生評分矩陣
的參數即雙向LSTM的參數——線性的特征權重與詞向量。如 2.2 部分所述,令
為句子中每個單詞的詞向量序列,
為它們相關聯的標簽。我們將在第4部分分析如何對
進行建模。詞向量序列作為雙向LSTM的輸入,而后雙向LSTM模型返回每個單詞的上下文表示,如2.1。
這些表示可以在 ci 中被聯系起來並被線性投影到一個尺寸等於獨立標簽數量的層上。我們不使用 softmax 作為該層的輸出,而是使用之前說過的CRF以考慮到相鄰標簽的相關性,從而產生每一個詞的最終預測 。另外,我們觀察到在 ci 和CRF層之間添加一個隱含層可以稍稍改進我們的結果。所以本論文所有模型的實驗也都加入了隱含層。給出觀察的詞,對於一個已注釋語料庫中的NER標簽觀測序列,這些參數通過訓練將其對應的等式(1)最大化。
2.4 Tagging Schemes
命名實體識別的任務是給句子中的每一個詞都分配一個命名實體標簽。一個命名實體可以標記句子中的多個詞條。句子通常以 IOB 格式(Inside, Outside, Beginning)表示,如果詞條是一個命名實體的開始那么就標記其為 B 標簽,同理 I 標簽指詞條在一個命名實體的內部,而 O 標簽指詞條在一個命名實體的外部。然而在這里我們使用的是命名實體識別更常用的 IOBES 詞性標注方案,它是 IOB 的一種變體,用 S 標簽標記詞條是一個命名實體的開始,E 標簽標記詞條是一個命名實體的結束。使用這種辦法能夠以高置信度將標注為 I 標簽的詞的后續單詞的詞性選項縮小為 I 標簽或者是 E 標簽,而 IOB 方案僅僅能夠確定后續單詞是不是在命名實體內部。 Ratinov 、 Roth(2009)與 Dai et al.(2015)提出使用 IOBES 方案可以改善模型的性能。
3 Transition-Based Chunking Model
...
3.1 Chunking Algorithm
...
3.2 Represening Labeled Chunks
...
4 Input Word Embeddings
...
4.1 Character-based models of words
...
4.2 Pretrained embeddings
...
4.3 Dropout training
...
5 Experiments
...
5.1 Training
...
5.2 Data Sets
...
5.3 Results
...
5.4 Network Architectures
...
6 Related Work
...
7 Conclusion
...
Acknowledgments
...
References
Rie Kubota Ando and Tong Zhang. 2005a. A framework
for learning predictive structures from multiple tasks
and unlabeled data. The Journal of Machine Learning
Research, 6:1817–1853.
Rie Kubota Ando and Tong Zhang. 2005b. Learning
predictive structures. JMLR, 6:1817–1853.
Miguel Ballesteros, Chris Dyer, and Noah A. Smith.
2015. Improved transition-based dependency parsing
by modeling characters instead of words with LSTMs.
In Proceedings of EMNLP.
Miguel Ballesteros, Yoav Golderg, Chris Dyer, and
Noah A. Smith.2016.Training with Explo-
ration Improves a Greedy Stack-LSTM Parser. In
arXiv:1603.03793.
Yoshua Bengio, Patrice Simard, and Paolo Frasconi.
1994. Learning long-term dependencies with gradient
descent is difficult. Neural Networks, IEEE Transac-
tions on, 5(2):157–166.
Chris Biemann, Gerhard Heyer, Uwe Quasthoff, and
Matthias Richter.2007.The leipzig corporacollection-monolingual
corpora of standard size. Pro-
ceedings of Corpus Linguistic.
Chris Callison-Burch, Philipp Koehn, Christof Monz,
Kay Peterson, Mark Przybocki, and Omar F Zaidan.
2010. Findings of the 2010 joint workshop on sta-
tistical machine translation and metrics for machine
translation. In Proceedings of the Joint Fifth Workshop
on Statistical Machine Translation and MetricsMATR,
pages 17–53. Association for Computational Linguis-
tics.
Xavier Carreras, Lluı́s Màrquez, and Lluı́s Padró. 2002.
Named entity extraction using adaboost, proceedings
of the 6th conference on natural language learning.
August, 31:1–4.
Jason PC Chiu and Eric Nichols. 2015. Named en-
tity recognition with bidirectional lstm-cnns. arXiv
preprint arXiv:1511.08308.
Ronan Collobert, Jason Weston, Léon Bottou, Michael
Karlen, Koray Kavukcuoglu, and Pavel Kuksa. 2011.
Natural language processing (almost) from scratch.
The Journal of Machine Learning Research, 12:2493–
2537.
Silviu Cucerzan and David Yarowsky. 1999. Language
independent named entity recognition combining mor-
phological and contextual evidence. In Proceedings of
the 1999 Joint SIGDAT Conference on EMNLP and
VLC, pages 90–99.
Silviu Cucerzan and David Yarowsky. 2002. Language
independent ner using a unified model of internal and
contextual evidence. In proceedings of the 6th confer-
ence on Natural language learning-Volume 20, pages
1–4. Association for Computational Linguistics.
Hong-Jie Dai, Po-Ting Lai, Yung-Chun Chang, and
Richard Tzong-Han Tsai. 2015. Enhancing of chem-
ical compound and drug name recognition using rep-
resentative tag scheme and fine-grained tokenization.
Journal of cheminformatics, 7(Suppl 1):S14.
Chris Dyer, Miguel Ballesteros, Wang Ling, Austin
Matthews, and Noah A. Smith. 2015. Transition-
based dependency parsing with stack long short-term
memory. In Proc. ACL.
Jacob Eisenstein, Tae Yano, William W Cohen, Noah A
Smith, and Eric P Xing. 2011. Structured databases
of named entities from bayesian nonparametrics. In
Proceedings of the First Workshop on Unsupervised
Learning in NLP, pages 2–12. Association for Com-
putational Linguistics.
Radu Florian, Abe Ittycheriah, Hongyan Jing, and Tong
Zhang. 2003. Named entity recognition through clas-
sifier combination. In Proceedings of the seventh con-
ference on Natural language learning at HLT-NAACL
2003-Volume 4, pages 168–171. Association for Com-
putational Linguistics.
Dan Gillick, Cliff Brunk, Oriol Vinyals, and Amarnag
Subramanya. 2015. Multilingual language processing
from bytes. arXiv preprint arXiv:1512.00103.
David Graff. 2011. Spanish gigaword third edition
(ldc2011t12). Linguistic Data Consortium, Univer-
sity of Pennsylvania, Philadelphia, PA.
Alex Graves and Jürgen Schmidhuber. 2005. Framewise
phoneme classification with bidirectional LSTM net-
works. In Proc. IJCNN.
Geoffrey E Hinton, Nitish Srivastava, Alex Krizhevsky,
Ilya Sutskever, and Ruslan R Salakhutdinov. 2012.
Improving neural networks by preventing co-
adaptation of feature detectors.
arXiv preprint
arXiv:1207.0580.
Sepp Hochreiter and Jürgen Schmidhuber. 1997. Long
short-term memory. Neural Computation, 9(8):1735–
1780.
Johannes Hoffart, Mohamed Amir Yosef, Ilaria Bordino,
Hagen Fürstenau, Manfred Pinkal, Marc Spaniol,
Bilyana Taneva, Stefan Thater, and Gerhard Weikum.
2011. Robust disambiguation of named entities in text.
In Proceedings of the Conference on Empirical Meth-
ods in Natural Language Processing, pages 782–792.
Association for Computational Linguistics.
Zhiheng Huang, Wei Xu, and Kai Yu. 2015. Bidi-
rectional LSTM-CRF models for sequence tagging.
CoRR, abs/1508.01991.
Yoon Kim, Yacine Jernite, David Sontag, and Alexan-
der M. Rush. 2015. Character-aware neural language
models. CoRR, abs/1508.06615.
Diederik Kingma and Jimmy Ba. 2014. Adam: A
method for stochastic optimization. arXiv preprint
arXiv:1412.6980.
John Lafferty, Andrew McCallum, and Fernando CN
Pereira. 2001. Conditional random fields: Probabilis-
tic models for segmenting and labeling sequence data.
In Proc. ICML.
Dekang Lin and Xiaoyun Wu. 2009. Phrase clustering
for discriminative learning. In Proceedings of the Joint
Conference of the 47th Annual Meeting of the ACL and
the 4th International Joint Conference on Natural Lan-
guage Processing of the AFNLP: Volume 2-Volume 2,
pages 1030–1038. Association for Computational Lin-
guistics.
Wang Ling, Lin Chu-Cheng, Yulia Tsvetkov, Silvio Amir,
Rámon Fernandez Astudillo, Chris Dyer, Alan W
Black, and Isabel Trancoso. 2015a. Not all contexts
are created equal: Better word representations with
variable attention. In Proc. EMNLP.
Wang Ling, Tiago Luı́s, Luı́s Marujo, Ramón Fernandez
Astudillo, Silvio Amir, Chris Dyer, Alan W Black, and
Isabel Trancoso. 2015b. Finding function in form:
Compositional character models for open vocabulary
word representation. In Proceedings of the Conference
on Empirical Methods in Natural Language Process-
ing (EMNLP).
Gang Luo, Xiaojiang Huang, Chin-Yew Lin, and Zaiqing
Nie. 2015. Joint named entity recognition and disam-
biguation. In Proc. EMNLP.
Tomas Mikolov, Kai Chen, Greg Corrado, and Jeffrey
Dean. 2013a. Efficient estimation of word representa-
tions in vector space. arXiv preprint arXiv:1301.3781.
Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Cor-
rado, and Jeff Dean. 2013b. Distributed representa-
tions of words and phrases and their compositionality.
In Proc. NIPS.
Joakim Nivre. 2004. Incrementality in deterministic de-
pendency parsing. In Proceedings of the Workshop on
Incremental Parsing: Bringing Engineering and Cog-
nition Together.
Joel Nothman, Nicky Ringland, Will Radford, Tara Mur-
phy, and James R Curran. 2013. Learning multilin-
gual named entity recognition from wikipedia. Artifi-
cial Intelligence, 194:151–175.
Robert Parker, David Graff, Junbo Kong, Ke Chen, and
Kazuaki Maeda. 2009. English gigaword fourth
edition (ldc2009t13). Linguistic Data Consortium,
Univer-sity of Pennsylvania, Philadelphia, PA.
Alexandre Passos, Vineet Kumar, and Andrew Mc-
Callum. 2014. Lexicon infused phrase embed-
dings for named entity resolution. arXiv preprint
arXiv:1404.5367.
Yanjun Qi, Ronan Collobert, Pavel Kuksa, Koray
Kavukcuoglu, and Jason Weston. 2009. Combining
labeled and unlabeled data with word-class distribu-
tion learning. In Proceedings of the 18th ACM con-
ference on Information and knowledge management,
pages 1737–1740. ACM.
Lev Ratinov and Dan Roth. 2009. Design challenges
and misconceptions in named entity recognition. In
Proceedings of the Thirteenth Conference on Compu-
tational Natural Language Learning, pages 147–155.
Association for Computational Linguistics.
Cicero Nogueira dos Santos and Victor Guimarães. 2015.
Boosting named entity recognition with neural charac-
ter embeddings. arXiv preprint arXiv:1505.05008.
Erik F. Tjong Kim Sang and Fien De Meulder. 2003. In-
troduction to the conll-2003 shared task: Language-
independent named entity recognition.
In Proc.
CoNLL.
Erik F. Tjong Kim Sang. 2002. Introduction to the conll-
2002 shared task: Language-independent named entity
recognition. In Proc. CoNLL.
Joseph Turian, Lev Ratinov, and Yoshua Bengio. 2010.
Word representations: A simple and general method
for semi-supervised learning. In Proc. ACL.
Matthew D Zeiler. 2012. Adadelta: An adaptive learning
rate method. arXiv preprint arXiv:1212.5701.
Yue Zhang and Stephen Clark. 2011. Syntactic process-
ing using the generalized perceptron and beam search.
Computational Linguistics, 37(1).
Xiang Zhang, Junbo Zhao, and Yann LeCun. 2015.
Character-level convolutional networks for text classi-
fication. In Advances in Neural Information Process-
ing Systems, pages 649–657.
Jie Zhou and Wei Xu. 2015. End-to-end learning of se-
mantic role labeling using recurrent neural networks.
In Proceedings of the Annual Meeting of the Associa-
tion for Computational Linguistics.