演習問題 2015.7.7 系列データモデリング Sequential Data Modeling

演習問題 2015.7.7 系列データモデリング Sequential Data Modeling
演習問題 2014.7.22 系列モデリング Sequential data modeling
名前
Name
ID No.
No.
n1 n2 n3 n4 nn35 nn62 n7n1
n0
名前
Name
以下のように品詞の異なる系列を設定します。
以下のように品詞の異なる系列を設定する。
Weset
setthe
thedifferent
differenttag
tag
sequences
follows.
We
sequences
as as
follows.
タグ系列
(tag sequence)
Time
flies
like
an
arrow
1
N
V
P
D
N
2
A
N
V
D
N
3
V
N
P
D
N
※ 系列の意味はそれぞれ:N=名詞 ・V=動詞 ・P=前置詞 ・D=冠詞 ・A=形容詞
The meaning of each tag is: N=Noun, V=Verb, P=Preposition, D=Definite A= Adjective
<意味>
タグ列1: 光陰矢のごとし
タグ列2: 矢が好きな時蝿
タグ列3: 矢のような蝿の時間を計れ
<mean>
tag1: Time flies like an arrow
tag2: The time flies which likes an arrow
tag3: Measure time of flies such as a arrow
Submit to : B7F, Augmented Human Communication Lab, Submit Box
Submit to: 7/14
: B7F,AM9:00,
Augmented
Human Communication
Lab, Submit Box
Deadline
Questions
to TA (e-mail: [email protected])
1
演習問題
2014.7.22
系列モデリング
Sequential
data modeling
演習問題
2015.7.7
Sequential
Data Modeling
Q1. タグ列1の遷移
生成
T ・系列データモデリング
E ・ 大文字
CAPS それぞれの素性関数を求めよ。全12個あり。
Find the transition, emission and caps features of the tag sequence 1. There are 12 features in total.
Q1. タグ列1の遷移 T ・ 生成 E ・ 大文字
CAPS それぞれの素性関数を求めよ。全12個あり。
Find the transition, emission and caps features of the tag sequence 1. There are 12 features in total.
Answer
Answer
2
2
2
演習問題
2014.7.22
系列モデリング
Sequential
data
modeling
演習問題
2014.7.22
系列モデリング
Sequential
data
modeling
演習問題
2014.7.22
系列モデリング
Sequential
data
modeling
演習問題 2015.7.7 系列データモデリング Sequential Data Modeling
それぞれの重みを以下のように設定する。
それぞれの重みを以下のように設定する。
それぞれの重みを以下のように設定する。
We
We set
set the
the weight
weight vectors
vectors as
as follows.
follows.
We
set
the
weight
vectors
as
follows.
w
=2
w
= n1
w
=1
wT,<S>,N
wT,N,V
wT,V,P
T,<S>,N = 2
T,N,V = n1
T ,V,P =1
wT,<S>,N==nw2
wT,N,V w= n1 = n
w
=1
T ,V,P
w
w
= 3
=
w
=
w
=
n
2
T ,<S>,A
6 0
T,N,V
T,V,P = 3
wT,D,N
w
wT,N,</S>
=
n
T,D,N = n2 T,<S>,N
T
,<S>,A
T,N,</S>
wT,D,N = nw2
3
wT,N,</S>
= n66= - n wT w
,<S>,A ==
=
n
w
w
=
2
w
=
2
w
=
n
T,D,N
1
T,N,</S>
0
T,<S>,A
7
wT,V,D
wT,<S>,V
wT,V,N
T,V,D = 2
T,<S>,V = 2
T,V,N = n7
wT,V,D
= 2wT,V,D =
wT,<S>,V
=
2
w
=
n
wT,<S>,V =
wT,V,N = T,V,N
7 + n1
w
w
=1
w
=
22
E,V," flies" =1
E,P,"like"
w
=1
w
=1
wE,N,"Time"
=
E,V," flies"
E,P,"like"
E,N,"Time" w
= wE,V,"
wE,V,"flies"
wE,P,"like"=1
= =1 = wE,P,"like"
wE,N,"Time"
=E,N,"Time"
2
flies"
w
=
nn4
w
=1
w
=1
flies"
wE,N,"arrow"
wE,A,"Time"
=1 = wE,N,"
E,N,"
flies" =
E,N,"arrow"w=1
E,A,"Time"
=
w
w
=
n4
wE,N,"
wE,N,"arrow" =1
wE,A,"Time"
=1
E,N,"arrow"
E,A,"Time"
E,N,"flies"
flies" = n43
w
=
n
wE,V,"Time"
n7
wE,V,"Time"
E,V,"Time" =
wE,V,"Time" = n77 = n2 + n3
w
w
= nw 55
= 3 - nw
w =1
wCAPS,V
=1
wCAPS
1 ,,V
wCAPS,N
w3 CAPS,A
=1 = 1
CAPS
V
CAPS,N = n CAPS,N
CAPS,A CAPS,A
wCAPS ,V
1
wCAPS,N = n 5
wCAPS,A =1
タグ列1のスコアを求めよ。
タグ列1のスコアを求めよ。
タグ列1のスコアを求めよ。
Find
Find score
score of
of tag
tag sequence
sequence 1.
1.
Find score of tag sequence 1.
Q2.
Q2.
Q2.
w
=1
wTT,P,D
,P,D =1
wT ,P,D= =1
w
4
w
T,A,N =
wT,P,D
=
4
T,A,N
w
=
4
w T,A,N== n
w
T,N,P = n3
wT,A,N
T,N,P
3
w
wT,N,P
T,N,P==n2n3
w
E,D,"an" =1
w
=1
E,D,"an"
wE,D,"an"
==1
w
E,D,"an"
w
=1
E,V,"like"
w
=1
E,V,"like"
w
=
wE,V,"like"
=1
E,V,"like"
Score of tag sequence 1 :
Score of tag sequence 1 :
3
3
3
演習問題 2014.7.22 系列モデリング Sequential data modeling
演習問題
2015.7.7
Sequential
Data Modeling
演習問題
2014.7.22系列データモデリング
系列モデリング Sequential
data modeling
Q3. タグ列2とタグ列3のスコアを求めよ。 また,どちらが最大になるか。
Find the score of tag sequence 2 and tag
sequence 3. And which tag sequence is maximum?
Q3. タグ列2とタグ列3のスコアを求めよ。
また,どちらが最大になるか。
Find the score of tag sequence 2 and tag sequence 3. And which tag sequence is maximum?
Score of tag sequence 2 :
Score of tag sequence 23 :
Score of tag sequence 3 :
Maximum tag sequence:
Maximum tag sequence:
4
4
4
演習問題
2014.7.22
系列モデリング
data
演習問題2015.7.7
2014.7.22系列データモデリング
系列モデリング Sequential
Sequential
data modeling
modeling
演習問題
Sequential
Data Modeling
Q4.
Q4. 正解の素性ベクトルとスコア最大の素性ベクトルを利用し、重みの更新を行え。
正解の素性ベクトルとスコア最大の素性ベクトルを利用し、重みの更新を行え。
Update
Updatethe
theweights
weightsvector
vector using
usingcorrect
correct features
featuresand
andfeatures
featureswhich
whichisismaximum
maximum score.
score.
ただし、タグ1列を正解の素性ベクトルとする。
ただし、タグ1列を正解の素性ベクトルとする。
We
Weassume
assumethat
thattag
tagsequence
sequence 11isiscorrect
correctfeatures.
features.
Answer
Answer
wwT,<S>,N
T,<S>,N
wwTT,N,V
,N,V
wwE,N,"Time"
E,N,"Time"
w
wE,V,"
E,V,"flies"
flies"
wwCAPS,N
CAPS,N
w
wCAPS,A
CAPS,A
w
wTT,V,P
,V,P
w
wTT,P,D
,P,D
wwTT,D,N
,D,N
wwTT,N,</S>
,N,</S>
wwTT,<S>,A
,<S>,A
wwTT,A,N
,A,N
wwTT,V,V, D, D
wwE,P,"like"
E,P,"like"
wwE,D,"an"
E,D,"an"
w
wCAPS,V
CAPS,V
wwTT,<S>,V
,<S>,V
wwTT,V,N
,V,N
wwTT,N,P
,N,P
wwE,N,"arrow"
E,N,"arrow"
wwE,A,"Time"
E,A,"Time"
w
wE,N,"
E,N,"flies"
flies"
wwE,V,"like"
E,V,"like"
wwE,V,"Time"
E,V,"Time"
5
55
演習問題 2015.7.7 系列データモデリング Sequential Data Modeling
<おまけ課題 (Extra question)>
第3回,第4回の演習問題では、学生の居場所の系列が観測された際のやる気の状態を推定するようなHMM
を扱った。このように、観測されるデータから学生のやる気の高低を予測するのに構造化パーセプトロンを用
いたい場合、どのような素性を用いるのがよいか考察せよ。(居場所以外の追加の素性を3つ以上提案せよ)
In 3rd and 4th assignment, we used HMM to estimate student’s motivation from observed sequence of his
location. Similarly, we want to predict whether student’s motivation is High or Low with CRF from any
observed data. Give your opinion what features would be effective.
(Propose at least 3 features other than location)
6