4. 7.1 文書分類:言語同定
!4
- 文字バイグラムのバッグ(bag of letter-bigrams)が強力
@btsmith #nlp
▪ Character n-gram frequencies for English
Language Identification
28
e 12.6%
t 9.1%
a 8.0%
o 7.6%
i 6.9%
n 6.9%
s 6.3%
h 6.2%
…
th 3.9%
he 3.7%
in 2.3%
er 2.2%
an 2.1%
re 1.7%
nd 1.6%
on 1.4%
…
the 3.5%
and 1.6%
ing 1.1%
her 0.8%
hat 0.7%
his 0.6%
tha 0.6%
ere 0.6%
…
From Cryptograms.org, derived from English documents at Project Gutenberg
https://www.slideshare.net/LithiumTech/lightweight-natural-language-processing-nlp
5. 7.1 文書分類:言語同定
!5
- 文字符号化方式同定(encoding detection)にはバイトバイグラムのバッグが有効
Figure 2: Byte-based method vs. character-based method
– ISO-2022-{JP,KR} [ja,ko]
– UTF-8 [universal]
or characters (unigram
models can use two or
ters (bigrams, trigram
parameter space is exp
between the accuracy
ing, computation and s
tant as the size of the
Asian charsets with ch
3.3 Algorithm
Our first choice was N
http://cs229.stanford.edu/proj2007/KimPark-AutomaticDetectionOfCharacterEncodingAndLanguages.pdf
11. 7.5 文脈に埋め込まれた単語:固有表現認識
!11
- 系列ラベリング問題 (sequence labeling task) として定式化
‣ ラベル付けのスキーマ: BIOタグ (Begin/Inside/Outside encoded tag)
Tag Meaning
O Not part of a named entity
B-PER
I-PER
First word of a person name
Continuation of a person name
B-LOC First word of a location name
期待出力
BIOタグ付け
•IOB (or IOB1): CoNLL 2003 データセットで使われている
• 接頭辞 I を付与; NEが連続する場合,2番目以降 NE 開始単語に
I-PER E-PER S-PER O S-LOC OB-PER
I-PER I-PER B-PER O I-LOC OB-PER
I-PER I-PER B-PER O I-LOC OI-PERIOB
BIO
BIOES
系列タグスキーマ
https://speakerdeck.com/himkt/neural-named-entity-recognition
B-LOC
12. 7.6 文脈に埋め込まれた単語と言語学的素性:前置詞意味曖昧性解消
!12
- 前置詞意味曖昧性解消 (preposition-sense disambiguation)
‣ [a] 目的 (PURPOSE) [b] 受益者 (BENEFICIARY) [c] 期間 (DURATION) [d] 場所 (LOCATION)
‣ 前置詞周りの窓を素性として用いるのは理想的ではない
‣ むしろヒューリスティック(左側の最初の動詞&右側の最初の名詞)が有効
• 前置詞の支配要素 (governor) と目的語 (object)を獲得できる
h i
h i
13. 7.6 文脈に埋め込まれた単語と言語学的素性:前置詞意味曖昧性解消
!13
- 前置詞意味曖昧性解消 (preposition-sense disambiguation)
‣ [a] 目的 (PURPOSE) [b] 受益者 (BENEFICIARY) [c] 期間 (DURATION) [d] 場所 (LOCATION)
‣ 前置詞周りの窓を素性として用いるのは理想的ではない
‣ むしろヒューリスティック(左側の最初の動詞&右側の最初の名詞)が有効
• 前置詞の支配要素 (governor) と目的語 (object)を獲得できる
• 依存構造パーザ(後述)の結果も用いてロバストにする h i
h i
h
h i
he liked the round object from the very first time he saw it
nsubj nsubj dobj
det
amod amod amod
det rcmod
dobj
prep pobj
root
14. 7.7 文脈に埋め込まれた単語の間の関係:アークを単位としたパージング
!14
- 依存構造パージング (dependency parsing)
‣ 統語的依存構造木 (syntactic dependency tree) を返す
‣ n2個の単語と単語の関係(アーク)にスコア ARC-SCORE(h, m, sent) を割り当てる
• 文sent、主辞単語候補のインデックスh、修飾語単語候補のインデックスm
the boy with the black shirt opened the door with a key
det prep
prep
amod
det
pobj
nsubj
root
dobj pobj
det det
n2
.h; m; sent/
h m h
m
15. 7.7 文脈に埋め込まれた単語の間の関係:アークを単位としたパージング
!15
- よく使われる素性
‣ 主辞単語の語形と品詞タグ
• cake -> ate
‣ 修飾語の語形と品詞タグ(the, a)
‣ 主辞単語の両側2語の窓
‣ 修飾語の両側2語の窓
‣ 単語クラスタ・単語埋め込みなどの分布論的情報
• 一般に依存構造木の訓練コーパスはあまり大きくない
‣ 単語と単語の距離 dist=¦h-m¦
‣ 単語間の方向
• wm=the, wh=boy のとき、m < h だとアークが貼られる可能性高いが、m > h だとほぼない
‣ 単語間に現れる単語の語形
• the … a … boy のように (the, boy) の間に限定詞がある場合、the が boy にかかる可能性は低い