MIT自然语言处理第二讲:单词计数(第三、四部分)
MIT自然語言處理第二講:單詞計數(第三部分)
自然語言處理:單詞計數
Natural Language Processing: (Simple) Word Counting
作者:Regina Barzilay(MIT,EECS Department, November 15, 2004)
譯者:我愛自然語言處理(www.52nlp.cn ,2009年1月10日)
三、 語料庫相關
a) 數據稀疏問題(Sparsity)
i. “kick”在一百萬單詞中出現的次數(How often does “kick” occur in 1M words)?——58
ii. “kick a ball”在一百萬單詞中出現的次數(How often does kick “kick a ball” occur in 1M words)?——0
iii. “kick”在web中出現了多少(How often does “kick” occur in the web)?——6M
iv. “kick a ball”在web中出現了多少(How often does “kick a ball” occur in the web)?——8.000
v. 數據永遠不會嫌多(There is no data like more data)
b) 非常非常大的數據(Very Very Large Data)
i. Brill&Banko 2001:在混合集合消歧任務中通過增加數據規模的方法進行訓練所得到的結果比在標準訓練語料上訓練的最好系統的結果好很多(In the task of confusion set disambiguation increase of data size yield significant improvement over the best performing system trained on the standard training corpus size set)
1. 任務(Task):對“too,to”這樣的詞對進行歧義消除(disambiguate between pairs such as too, to)
2. 訓練規模(Training Size):從一百萬詞到10億詞不等(varies from one million to one billion)
3. 用于對比的學習算法(Learning methods used for comparison):winnow算法,感知器算法,決策樹算法( winnow, perceptron, decision-tree)
ii. Lapata&Keller 2002, 2003:web可用做非常非常大的語料庫(the web can be used as a very very large corpus)
1. 計數可能被噪音干擾,但是對于一些任務這不是什么大問題(The counts can be noisy, but for some tasks this is not an issue)
c) 布朗語料庫(The Brown Corpus)
i. 著名的早期語料庫(Famous early corpus) (Made by Nelson Francis and Henry Kucera at Brown University in the 1960s)
1. 一個關于美國書面語的平衡語料庫(A balanced corpus of written American English),包括報紙,小說,非小說,學術等體裁(Newspaper, novels, non-fiction, academic)
2. 一百萬單詞數,500份文本(1 million words, 500 written texts)
3. 你認為這是一個大型語料庫嗎(Do you think this is a large corpus)?
ii. 注,關于布朗語料庫更詳細的介紹:
1. 20世紀60年代,Francis和Kucera在美國Brown大學建立了世界上第一個根據系統性原則采集樣本的標準語料庫——布朗語料庫。
2. 主要目的是研究當代美國英語
3. 按共時原則采集文本的語料庫,只選錄1961年間由美國人撰寫出版的普通語體的文本。
4. 規模為100萬詞次,全部語料分成15種體裁,共500個樣本,每個樣本不少于2000詞次。
5. TAGGIT系統:詞類標記81種,正確率達77%
6. 語料分A-R共18種類型,A-J屬于資訊類語體,K-R屬于想象類語體
例:A 報刊:新聞報道;B 報刊:社論…
7. 樣本通過隨機采樣方法得到。首先從各類體裁目錄中按樣本數要求隨機選出進入語料庫的文本,然后從選出的文本中隨機截取不少于2000詞次的片斷作為樣本,采樣時要保證最后一個句子是完整的
8. 版本:A,B,C,卑爾根I,卑爾根II,布朗MARC
9. 布朗語料庫從語料庫的整體規模,語料的分布和語料的采樣上都經過了精心的設計,一致被公認為是一個能反映語言共性的平衡語料庫。
d) 近年來的語料庫(Recent Corpora)
語料庫(Corpus) 規模(Size) 領域(Domain) 語言(Language)
NA News Corpus 600 million newswire American English
British National Corpus 100 million balanced British English
EU proceedings 20 million legal 10 language pairs
Penn Treebank 2 million newswire American English
Broadcast News spoken 7 languages
SwitchBoard 2.4 million spoken American English
ii. 了解更多語料庫的信息,請查詢語言數據聯盟(For more corpora, check the Linguistic Data Consortium):
http://www.ldc.upenn.edu/
e) 語料庫內容(Corpus Content)
i. 類型(Genre):
– 新聞,小說,廣播,會話(newswires, novels, broadcast, spontaneous conversations)
ii. 媒介(Media):文本,音頻,視頻(text, audio, video)
iii. 標注(Annotations):tokenization, 句法樹(syntactic trees), 語義(semantic senses), 翻譯(translations)
f) 標注例子(Example of Annotations): 詞性標注(POS Tagging)
i. 詞性標注集對簡單的語法功能編碼(POS tags encode simple grammatical functions)
ii. 幾個詞性標注集(Several tag sets):
1. Penn tag set (45 tags)
2. Brown tag set (87 tags)
3. CLAWS2 tag set (132 tags)
iii. 舉例:
Category Example Claws c5 Brown Penn
Adverb often, badly AJ0 JJ JJ
Noun singular table, rose NN1 NN NN
Noun plural tables, roses NN2 NN NN
Noun proper singular Boston, Leslie NP0 NP NNP
g) 標注中的問題(Issues in Annotations)
i. 同樣的認為不同的標注方案很正常(Different annotation schemes for the same task are common)
ii. 在某些情況下,方案之間有直接的映射關系;在其他情況下,它們并沒有顯示出任何關系(In some cases, there is a direct mapping between schemes; in other cases, they do not exhibit any regular relation)
iii. 標注的選擇是由語言,計算和/或任務需要驅動的(Choice of annotation is motivated by the linguistic, the computational and/or the task requirements)
未完待續:第四部分
附:課程及課件pdf下載MIT英文網頁地址:
http://people.csail.mit.edu/regina/6881/
注:本文遵照麻省理工學院開放式課程創作共享規范翻譯發布,轉載請注明出處“我愛自然語言處理”:www.52nlp.cn
from:http://www.52nlp.cn/mit-nlp-second-lesson-word-counting-third-part/
MIT自然語言處理第二講:單詞計數(第四部分)
自然語言處理:單詞計數
Natural Language Processing: (Simple) Word Counting
作者:Regina Barzilay(MIT,EECS Department, November 15, 2004)
譯者:我愛自然語言處理(www.52nlp.cn ,2009年1月11日)
四、 分詞相關
a) Tokenization
i. 目標(Goal):將文本切分成單詞序列(divide text into a sequence of words)
ii. 單詞指的是一串連續的字母數字并且其兩端有空格;可能包含連字符和撇號但是沒有其它標點符號(Word is a string of contiguous alphanumeric characters with space on either side; may include hyphens and apostrophes but no other punctuation marks (Kucera and Francis))
iii. Tokenizatioan 容易嗎(Is tokenization easy)?
b) 什么是詞(What’s a word)?
i. English:
1. “Wash. vs wash”
2. “won’t”, “John’s”
3. “pro-Arab”, “the idea of a child-as-required-yuppie-possession must be motivating them”, “85-year-old grandmother”
ii. 東亞語言(East Asian languages):
1. 詞之間沒有空格(words are not separated by white spaces)
c) 分詞(Word Segmentation)
i. 基于規則的方法(Rule-based approach): 基于詞典和語法知識的形態分析(morphological analysis based on lexical and grammatical knowledge)
ii. 基于語料庫的方法(Corpus-based approach): 從語料中學習(learn from corpora(Ando&Lee, 2000))
iii. 需要考慮的問題(Issues to consider): 覆蓋面,歧義,準確性(coverage, ambiguity, accuracy)
d) 統計切分方法的動機(Motivation for Statistical Segmentation)
i. 未登錄詞問題(Unknown words problem):
——存在領域術語和專有名詞(presence of domain terms and proper names)
ii. 語法約束可能不充分(Grammatical constrains may not be sufficient)
——例子(Example): 名詞短語的交替切分(alternative segmentation of noun phrases)
iii. 舉例一
1. Segmentation:sha-choh/ken/gyoh-mu/bu-choh
2. Translation:“president/and/business/general/manager”
iv. 舉例二
1. Segmentation:sha-choh/ken-gyoh/mu/bu-choh
2. Translation:“president/subsidiary business/Tsutomi[a name]/general manag
e) 一個切分算法:
i. 核心思想(Key idea): 對于每一個候選邊界,比較這個邊界鄰接的n元序列的頻率和跨過這個邊界的n元序列的頻率(for each candidate boundary, compare the frequency of the n-grams adjacent to the proposed boundary with the frequency of the n-grams that straddle it)。
ii. 注:由于公式編輯問題,具體算法請自行參考lec02.pdf,此處略。
f) 實驗框架(Experimental Framework)
i. 語料庫(Corpus): 150兆1993年Nikkei新聞語料(150 megabytes of 1993 Nikkei newswire)
ii. 人工切分(Manual annotations): 用于開發集的50條序列(調節參數)和用于測試集的50條序列(50 sequences for development set (parameter tuning) and 50 sequences for test set)
iii. 基線算法(Baseline algorithms): Chasen和Juma的形態分析器(Chasen and Juman morphological analyzers (115,000 and 231,000 words))
g) 評測方法(Evaluation Measures)
i. tp — true positive (真正, TP)被模型預測為正的正樣本;
ii. fp — false positive (假正, FP)被模型預測為正的負樣本;
iii. tn — true negative (真負 , TN)被模型預測為負的負樣本 ;
iv. fn — false negative (假負 , FN)被模型預測為負的正樣本;
v. 準確率(Precision) — the measure of the proportion of selected items that the system got right:
P = tp / ( tp + fp)
vi. 召回率(Recall) — the measure of the target items that the system selected:
R = tp / ( tp + fn )
vii. F值(F-measure):
F = 2 ? PR / (R + P)
viii. Word precision (P) is the percentage of proposed brackets that match word-level brackets in the annotation;
ix. Word recall (R) is the percentage of word-level brackets that are proposed by the algorithm.
五、 結論(Conclusions)
a) 語料庫被廣泛用于文本處理中(Corpora widely used in text processing)
b) 使用的語料庫是熟語料或生語料(Corpora used either annotated or raw)
c) 齊夫定律及其與自然語言的聯系(Zipf’s law and its connection to natural language)
d) 數據稀疏問題是語料庫處理方法中的一個主要問題(Sparsity is a major problem for corpus processing methods)
下一講(Next time): 語言模型(Language modeling)
第二講結束!
第三講:語言模型
附:課程及課件pdf下載MIT英文網頁地址:
http://people.csail.mit.edu/regina/6881/
注:本文遵照麻省理工學院開放式課程創作共享規范翻譯發布,轉載請注明出處“我愛自然語言處理”:www.52nlp.cn
from:http://www.52nlp.cn/mit-nlp-second-lesson-word-counting-fourth-part/
總結
以上是生活随笔為你收集整理的MIT自然语言处理第二讲:单词计数(第三、四部分)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: MIT自然语言处理第二讲:单词计数(第一
- 下一篇: MIT自然语言处理第三讲:概率语言模型(