๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
1๏ธโƒฃ AI•DS/๐Ÿ“— NLP

[cs224n] 18๊ฐ• ๋‚ด์šฉ์ •๋ฆฌ

by isdawell 2022. 7. 18.
728x90

 

๐Ÿ’ก ์ฃผ์ œ : Tree Recursive Neural Networks, Constituency Parsing, and Sentiment


๐Ÿ“Œ ํ•ต์‹ฌ 

  • Task  : TreeRNN ์„ ํ™œ์šฉํ•œ ๋ฌธ์žฅ ๊ตฌ์กฐ ๋ถ„์„ 
  • ๊ตฌ์กฐ์ ์œผ๋กœ ๋ฌธ์žฅ์„ ๋‚˜๋ˆ„๊ณ  ๊ฐ ๋‹จ์–ด์˜ ์กฐํ•ฉ์ด ๋‚˜ํƒ€๋‚ด๋Š” ์˜๋ฏธ๋ฅผ ์ฐพ์•„ ๋ฌธ์žฅ ์ „์ฒด์˜ ์˜๋ฏธ ํŒŒ์•…ํ•˜๊ธฐ 
  • Simple Tree RNN, SU-RNN, MV-RNN , RNTN 
  • TreeRNN ์€ ํ˜„์‹ค์ ์œผ๋กœ ์‚ฌ์šฉํ•˜๊ธฐ ํž˜๋“ค๋‹ค๊ณ  ํ•จ → GPU ์—ฐ์‚ฐ์ด ์–ด๋ ค์›€ + ๋ฐ์ดํ„ฐ ๊ตฌ์ถ•์˜ ์–ด๋ ค์›€ 
  • ์š”์ฆ˜ NLP ์—์„  TreeRNN ์ด ์•„๋‹Œ LSTM, CNN, Transformer ๋“ฑ contextual language model ์˜ ์„ฑ๋Šฅ์ด ๋” ์ข‹์Œ 
  • ๋ฌผ๋ฆฌํ•™, ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์–ธ์–ด ๋ฒˆ์—ญ ๋“ฑ ๋‹ค๋ฅธ ์˜์—ญ์—์„œ ์ ์šฉ์ด ์‹œ๋„๋˜๊ณ  ์žˆ๋Š” ์ƒํ™ฉ์ด๋‹ค. 

 

 

 

 

 

 

1๏ธโƒฃ  Compositionality and Recursion 


โ‘   Sentence representation

 

โœ” Sentence representation 

 

 

โ—ฝ BoW, RNN/CNN ๊ธฐ๋ฐ˜ ํ‘œํ˜„, Tf-idf โ—ฆโ—ฆโ—ฆโ—ฆ

โ—ฝ Language structure : ์–ธ์–ด์˜ ๋ฌธ๋ฒ• ๊ตฌ์กฐ 

 

๐Ÿ‘‰ ๋ฌธ์žฅ ๊ตฌ์ ˆ์˜ ์˜๋ฏธ๋ฅผ ์–ด๋–ป๊ฒŒ ํ•˜๋ฉด ๋” ์ž˜ ํŒŒ์•…ํ•  ์ˆ˜ ์žˆ์„๊นŒ 

 

 

 

โœ” Compositionality 

 

 

โ—ฝ ๊ธฐ๊ณ„์—์„œ์˜ Compositionality : ๊ธฐ๊ณ„ ๋ถ€ํ’ˆ๋งˆ๋‹ค ๊ณ ์œ ํ•œ ์˜๋ฏธ๋ฅผ ๊ฐ€์ง€๊ณ  ์žˆ์œผ๋ฉฐ ์ด๋ฅผ ์–ด๋–ป๊ฒŒ ๊ตฌ์กฐ์ ์œผ๋กœ ๊ฒฐํ•ฉํ•˜๋ƒ์— ๋”ฐ๋ผ ์ „ํ˜€ ๋‹ค๋ฅธ ๊ธฐ๊ณ„๊ฐ€ ํƒ„์ƒํ•  ์ˆ˜ ์žˆ๋‹ค. 

 

 

โ—ฝ ์–ธ์–ด์—์„œ Compositionality : ๊ฐ„๋‹จํ•œ ๋ถ€๋ถ„์œผ๋กœ๋ถ€ํ„ฐ ์˜๋ฏธ๋ฅผ ์ถ”์ถœํ•˜๊ณ , ๊ทธ ์˜๋ฏธ๋“ค์ด semantic ํ•œ ๊ตฌ์กฐ๋กœ ํ•ฉ์ณ์ง€์–ด ์ƒˆ๋กœ์šด ์˜๋ฏธ๋ฅผ ๋งŒ๋“ ๋‹ค. ๊ฐ€๋ น ์—ฌ๋Ÿฌ๊ฐœ์˜ ๋‹จ์–ด๋ฅผ ํ†ตํ•ด ํ•œ ๋ฌธ์žฅ์ด ๋งŒ๋“ค์–ด์ง€๋ฉด ๊ฐ ๋‹จ์–ด์˜ ์กฐํ•ฉ์œผ๋กœ ์ƒˆ๋กœ์šด ์˜๋ฏธ๋ฅผ ๋‚˜ํƒ€๋‚ผ ์ˆ˜ ์žˆ๋‹ค. 

 

๐Ÿ‘‰ ๋‹จ์–ด์˜ ์กฐํ•ฉ์œผ๋กœ ๋ฌธ์žฅ์˜ ์˜๋ฏธ๋ฅผ ํŒŒ์•…ํ•  ์ˆ˜ ์žˆ๋‹ค. 

 

 

 

โœ” Semantic interpretation of language 

 

 

๐Ÿ’จ A person on a snowboard = snowboard 

 

 

โ—ฝ ์ธ๊ฐ„์˜ ์–ธ์–ด๋Š” ํฐ ํ…์ŠคํŠธ ๋‹จ์œ„์˜ ์˜๋ฏธ๋ฅผ ์ž‘์€ ์š”์†Œ์˜ ์กฐํ•ฉ์„ ํ†ตํ•ด ์˜๋ฏธ๋ฅผ ํ‘œํ˜„ํ•˜๋Š” ๊ฒฝ์šฐ๊ฐ€ ๋งŽ๋‹ค. 

โ—ฝ ๊ทธ๋Ÿฌ๋‚˜ word vector ์—์„œ๋Š”, ํฐ text unit ์˜ semantic ํ•œ composition ์„ ํ†ตํ•ด ์˜๋ฏธ๋ฅผ ํ•ด์„ํ•˜๊ธฐ๊ฐ€ ์–ด๋ ต๋‹ค. 

โ—ฝ ์—ฐ์†์ ์ธ chunk ๋ง๋ญ‰์น˜๋กœ ์ด๋ฃจ์–ด์ง„ ๋ฌธ๋งฅ์  ์˜๋ฏธ๋ฅผ ์–ด๋–ป๊ฒŒ ๊ธฐ๊ณ„๊ฐ€ ์ดํ•ดํ•˜๋„๋ก ํ‘œํ˜„ํ•  ์ˆ˜ ์žˆ์„๊นŒ ๐Ÿ‘‰ Tree ๊ธฐ๋ฐ˜์˜ Neural Network 

 

 

 

Tree Structure

 

โ—ฝ ์ž‘์€ ๋ถ€๋ถ„๋“ค์„ ํฐ ๋‹จ์œ„๋กœ ๊ตฌ์„ฑํ•ด ์˜๋ฏธ๋ฅผ ํ‘œํ˜„ 

 

 

 

 

โ‘ก  Recursion 

 

โ—ฝ ์œ ๋ช… ์–ธ์–ดํ•™์ž Noam Chomsky ๊ฐ€ ์ œ์•ˆํ•œ ๋…ผ๋ฌธ์—์„œ ๋“ฑ์žฅํ•œ ๊ฐœ๋… 

 

๐Ÿ’ญ ์ธ๊ฐ„์€ ์žฌ๊ท€์ ์ธ ๊ณผ์ • (Recursive process) ์„ ํ†ตํ•ด ์ƒˆ๋กœ์šด ์ •์˜๋ฅผ ๊ฐ€๋Šฅํ•˜๊ฒŒ ํ•œ๋‹ค. 

๐Ÿ’ญ Smaller parts → resurvice process → Bigger things 

 

 

 

 

โ—ฝ ๊ทธ๋Ÿฌ๋‚˜ ๋ฐ์ดํ„ฐ๋ฅผ ํ†ตํ•ด ํ•™์Šต์„ ์ง„ํ–‰ํ•˜๋Š” ๋จธ์‹ ๋Ÿฌ๋‹ ๋ถ„์•ผ์˜ Computational ์–ธ์–ดํ•™์ž๋“ค์€ ํšŒ์˜์ ์ธ ๋ฐ˜์‘์„ ๋ณด์˜€์Œ 

 

→ ์–ธ์–ด๊ฐ€ recursive ํ•œ์ง€๋Š” ์•„์ง๋„ ์–‘์ธก์—์„œ ๋…ผ์˜์ค‘ 

→ ๊ทธ๋Ÿฌ๋‚˜ ์ธ๊ฐ„์˜ ์–ธ์–ด ๋ฌธ์žฅ์ด ์—ฌ๋Ÿฌ ์กฐ๊ฐ๋“ค๋กœ ์ด๋ฃจ์–ด์ ธ ์žˆ๋‹ค๋Š” ๊ฒƒ์— ๋Œ€ํ•ด์„œ๋Š” ์–‘์ธก ๋ชจ๋‘ ๋™์˜ 

    →  ๋ง๋ญ‰์น˜๋Š” ์—ฌ๋Ÿฌ ๋‹จ์–ด ์กฐ๊ฐ์œผ๋กœ๋ถ€ํ„ฐ ๊ตฌ์กฐ์ ์œผ๋กœ, ์žฌ๊ท€์ ์œผ๋กœ ํ˜•์„ฑ๋œ๋‹ค. 

 

 

 

 

 

 

 

 

 

 

 

 

 

2๏ธโƒฃ Tree RNN 


โ‘   Parsing 

 

โœ” Dependency VS Constituency 

 

โ—ฝ Dependency Parsing : ๋‹จ์–ด์˜ ๊ด€๊ณ„๋ฅผ ํŒŒ์•… ๐Ÿ‘‰ 5์žฅ

โ—ฝ Constituency Parsing : ๋ฌธ์žฅ์˜ ๊ตฌ์กฐ๋ฅผ ํŒŒ์•… 

 

 

(์™ผ) Dependency , (์˜ค) Constituency

 

 

 

โ‘ก Constituency parsing 

 

โœ”  Constituency parsing ๊ณผ ๊ฐ™์€ ์˜๋ฏธ๋กœ ์‚ฌ์šฉ๋˜๋Š” ์šฉ์–ด ์ •๋ฆฌ 

 

 

 

โœ”  word vector space 

 

 

โ—ฝ  semantic ์„ ๋ณด์กดํ•œ ํ˜•ํƒœ๋กœ word vector ๊ณต๊ฐ„์— ๋น„์Šทํ•œ ์˜๋ฏธ๋ฅผ ๊ฐ€์ง„ ๋‹จ์–ด๋“ค์€ ๊ฐ€๊นŒ์ด ์œ„์น˜ํ•˜๊ฒŒ ๋œ๋‹ค. 

 

 

 

โ—ฝ  ๋‹จ์–ด๋“ค์˜ ๊ฒฐํ•ฉ์ธ ๊ธด ๊ตฌ๋ฌธ ํ˜น์€ ๋ฌธ์žฅ ๊ฐ™์€ ๊ฒฝ์šฐ๋Š” ๋ฌธ๋งฅ์  ์œ ์‚ฌ์„ฑ์„ ์–ด๋–ป๊ฒŒ ํ‘œํ˜„ํ• ๊นŒ ๐Ÿ‘‰ Tree RNN 

 

 

 

 

โ‘ข Tree RNN 

 

 

โœ”  Tree RNN 

 

์ผ์ •ํ•œ ๊ทœ์น™์„ ์ •ํ•˜์—ฌ ๋‹จ์–ด๊ฐ„ ์กฐํ•ฉ์„ ํ•˜๊ณ  ์˜๋ฏธ๋ฒกํ„ฐ๋ฅผ ์ƒ์„ฑ 

 

 

 

โ—ฝ  Tree RNN ์„ ์‚ฌ์šฉํ•˜๋ฉด ๋ฌธ์žฅ/๊ตฌ๋ฌธ์˜ ์œ ์‚ฌ์„ฑ์„ ํฌํ•จํ•œ ๋ฌธ์žฅ ํ‘œํ˜„์‹์„ ์ƒ์„ฑํ•  ์ˆ˜ ์žˆ๊ฒŒ ๋œ๋‹ค. 

 

 

โ—ฝ  RNN ์„ ํ†ตํ•ด ๋ฌธ์žฅ์„ ๋ถ„์„ํ•˜๊ฒŒ ๋˜๋ฉด, ์ธ์ ‘ ๋‹จ์–ด๋ฅผ ํ•ฉ์นœ ๋‹จ์–ด์˜ ์˜๋ฏธ๋ฅผ ์ถฉ๋ถ„ํžˆ ๋ฐ˜์˜ํ•˜์ง€ ๋ชปํ•˜๋ฉฐ, ๋งˆ์ง€๋ง‰ ๋‹จ์–ด ๋ฒกํ„ฐ๋ฅผ ์ฃผ๋ชฉํ•˜๋Š” ๊ฒฝํ–ฅ์ด ์žˆ์–ด ๋ฌธ์žฅ์˜ ์˜๋ฏธ๋ฅผ ํŒŒ์•…ํ•˜๋Š”๋ฐ ์ ์ ˆํ•˜์ง€ ์•Š๋‹ค. 

 

 

 

 

๐Ÿ’ญ Tree RNN ์„ ์ƒ์„ฑํ•˜๊ธฐ ์œ„ํ•ด ์•Œ์•„์•ผ ํ•˜๋Š” 2๊ฐ€์ง€ 

 

(1) word vector : The meaning of its words 

(2) ๋‹จ์–ด๊ฐ€ ๊ฒฐํ•ฉ๋˜๋Š” ๊ทœ์น™

 

 

 

โœ”  Learn Structure and Representation 

 

1. Parsing - Sentence Structure 

 

๐Ÿ’จ ๋‹จ์–ด ์กฐ๊ฐ๋“ค์ด ๋ชจ์—ฌ ๋ฌธ์žฅ์œผ๋กœ ์ด๋ฃจ์–ด์ง€๋Š” ๊ตฌ์กฐ 

 

 

 

 

2. Meaning Computation - sentence representation 

 

๐Ÿ’จ ๋ฌธ์žฅ์„ ์ด๋ฃฐ๋•Œ ๊ฐ chunck ์— ๋Œ€ํ•œ ๋…ธ๋“œ์— ๋Œ€ํ•ด ์˜๋ฏธ (๋ฒกํ„ฐ) ๋ฅผ ๋ถ€์—ฌํ•  ์ˆ˜ ์žˆ๊ฒŒ ๋จ 

 

→ ์ตœ์ข…์ ์œผ๋กœ ๋ฌธ์žฅ S ์— ๋Œ€ํ•ด์„œ๋„ ๋ฒกํ„ฐ๋กœ ํ‘œํ˜„ํ•  ์ˆ˜ ์žˆ๊ฒŒ ๋จ 

 

 

 

 

 

 

 

โœ”  RNN 

 

๐Ÿ’ญ Recursive Neural network 

 

โ—ฝ  ๋ฌธ์žฅ ํ˜น์€ ๊ตฌ๋ฌธ์ด ํ•„์š”ํ•  ๋•Œ ์ฃผ๋กœ ์‚ฌ์šฉํ•˜๋Š” ๋„คํŠธ์›Œํฌ 

โ—ฝ  ๋ฌธ์žฅ์ด๋‚˜ ๊ตฌ๋ฌธ์ด ์–ด๋–ป๊ฒŒ ์˜๋ฏธ๋ฅผ ๋ฐ˜์˜ํ•˜๋Š”์ง€ ํ•ด๋‹น ๋„คํŠธ์›Œํฌ๋ฅผ ํ†ตํ•ด ํ•™์Šตํ•  ์ˆ˜ ์žˆ๋‹ค. 

โ—ฝ  ์ฆ‰, constituent chunk (์˜๋ฏธ ๋ง๋ญ‰์น˜) ๋ฅผ ์•Œ ์ˆ˜ ์žˆ๋‹ค.

 

 

 

 

๐Ÿ’ญ Recurrent Neural network 

 

โ—ฝ  ๋งˆ์ง€๋ง‰ hidden state ๋ฅผ ํ†ตํ•ด ๋ฌธ์žฅ ํ‘œํ˜„์‹ ๊ฒฐ๊ณผ๋ฅผ ๋„์ถœ → ๋ฌธ์žฅ์˜ ์˜๋ฏธ๋ฅผ ์žƒ์–ด๋ฒ„๋ฆฌ๊ธฐ ์‰ฌ์šด ๊ตฌ์กฐ์˜ ๋„คํŠธ์›Œํฌ

โ—ฝ  ์•ž๋‹จ์— ์žˆ๋Š” hidden state ์— ํฌํ•จ๋œ ์ •๋ณด๋“ค์ด ๋’ท๋‹จ์—๊นŒ์ง€ ์ „๋‹ฌ๋˜๊ธฐ ์–ด๋ ค์›Œ ํ™•์‹คํ•œ ๋ฌธ์žฅ ํ‘œํ˜„์ด ์–ด๋ ต๋‹ค. 

โ—ฝ  Recursive NN ์€ ์ค‘๊ฐ„ ๊ณผ์ •์—์„œ Phrase ์— ๋Œ€ํ•œ ํ‘œํ˜„์‹๋„ ์–ป์„ ์ˆ˜ ์žˆ๋Š”๋ฐ Recurrent NN ์€ ๋‹จ ํ•˜๋‚˜์˜ ๋ฌธ์žฅ ๋ฒกํ„ฐ๋งŒ ํ‘œํ˜„ํ•  ์ˆ˜ ์žˆ์–ด ๊ตฌ๋ฌธ์— ๋Œ€ํ•œ ํ‘œํ˜„์€ ๋ถˆ๊ฐ€๋Šฅํ•˜๋‹ค. 

 

 

 

 

 

 

โœ”  Recursive NN for Structure prediction 

 

 

โ—ฝ  Score : ๊ฐ ๋‹จ์–ด๊ฐ€ ๊ฒฐํ•ฉ๋  ๋•Œ, ๊ฒฐํ•ฉ ํ•˜๋Š” ๊ฒƒ์ด ์ ์ ˆํ•œ์ง€ (ํ•ด๋‹น ๋‹จ์–ด๊ฐ€ ์–ผ๋งˆ๋‚˜ ๊ทธ๋Ÿด๋“ฏ ํ•œ์ง€๋ฅผ ์˜๋ฏธ) ์— ๋Œ€ํ•œ ์ ์ˆ˜ → EX. 1.3 

โ—ฝ  The semantic representation  :  ๊ฒฐํ•ฉํ•˜๊ฒŒ ๋œ๋‹ค๋ฉด ๊ฒฐํ•ฉํ•œ ๊ฒƒ์˜ ์ƒˆ๋กœ์šด ์˜๋ฏธ๋ฅผ ํ‘œํ˜„ํ•˜๋Š” ๋ฒกํ„ฐ → EX. [8 3]

 

 

on + (the mat) ๊ฒฐํ•ฉ ๊ณผ์ •

 

 

 

 

โœ”  Recursive NN Definition 

 

W ํ–‰๋ ฌ์€ ๋ชจ๋“  TreeRNN ์—์„œ ๋™์ผํ•˜๋‹ค.

 

 

โ—ฝ  Pharase representation ๋ฐฉ๋ฒ• 

 

(1)  ์„œ๋กœ ๋‹ค๋ฅธ ๋‹จ์–ด ํ˜น์€ ๊ตฌ๋ฌธ ๋…ธ๋“œ์ธ C1,C2 ๋ฅผ concat ํ•œ ํ›„ weight matrix ๋ฅผ ๊ณฑํ•˜๊ณ  bias ๋ฅผ ๋”ํ•œ ํ›„ ๋น„์„ ํ˜• ํ•จ์ˆ˜ tanh ๋ฅผ ํ†ต๊ณผ์‹œํ‚จ๋‹ค = p 
(2)  p ์— ์„ ํ˜• matrix ์—ฐ์‚ฐ์„ ์ทจํ•˜๋ฉด score ๊ฐ’์ด ๋‚˜์˜จ๋‹ค. 
(3) Score ๊ฐ’์ด ํฌ๋ฉด ํ•ด๋‹นํ•˜๋Š” ๋‘ ๋…ธ๋“œ C1,C2 ๊ฐ€ ๊ฒฐํ•ฉํ•œ๋‹ค. 

 

 

 

 

 

 

โœ”  Parsing sentence with an RNN 

 

 

๐Ÿ’จ Greedy ํƒ์ƒ‰ ๋ฐฉ๋ฒ• : ์ธ์ ‘ํ•œ ๋‹จ์–ด์˜ Score ๊ฐ€ ๋†’์€ ์กฐํ•ฉ์œผ๋กœ ๋‹ค์Œ ๋ถ€๋ชจ ๋‹จ์–ด์˜ ๋ฒกํ„ฐ์™€ Score ๋ฅผ ๊ณ„์‚ฐ 

 

 

โ—ฝ  EX. The ์™€ Cat node vector ๊ฐ€ NN ์„ ๊ฑฐ์ณ Score ๋ฅผ ์‚ฐ์ถœํ•œ๋‹ค. 

 

 

โ—ฝ  EX. Score ๊ฐ€ ๋†’์€ The ์™€ cat ์€ ๊ตฌ๋ฌธ์œผ๋กœ ํ•ฉ์ณ์ง„๋‹ค. 

โ—ฝ  EX. Score ๊ฐ€ ๋†’์€ ๊ฒฐํ•ฉ๋ผ๋ฆฌ ๊ตฌ๋ฌธ์„ ์ด๋ฃจ๋Š” ๊ณผ์ •์„ ๊ณ„์†ํ•จ → greedy 

 

์ตœ์ข… ๊ฒฐ๊ณผ

 

 

 

 

โœ”  Score ์‚ฐ์ถœ ๋ฐฉ๋ฒ• 

 

 

 

โ—ฝ  ๊ฒฐํ•ฉํ•œ ํ•ด๋‹น ๋…ธ๋“œ์— ๋Œ€ํ•ด score ๊ฐ’์„ ๋ชจ๋‘ ๋”ํ•˜๋Š” ๋ฐฉ์‹์œผ๋กœ ์‚ฐ์ •ํ•˜์—ฌ Max-Margin objective ํ•จ์ˆ˜์— ๋”ฐ๋ผ ์—ฐ์‚ฐ์„ ์ˆ˜ํ–‰ํ•œ๋‹ค. 

 

 

โ—ฝ  greedy ๋ฐฉ์‹ ์™ธ์— beam search ๋ฐฉ์‹์„ ์‚ฌ์šฉํ•ด๋„ ๋ฌด๋ฐฉํ•จ 

 

 

 

 

โœ”  Simple Tree RNN 

 

โ—ฝ  Simple Tree RNN ์€ weight matrix ๋ฅผ ๋ชจ๋“  ๋…ธ๋“œ์— ๋Œ€ํ•ด ๋™์ผํ•˜๊ฒŒ ์ ์šฉํ•˜๊ธฐ ๋•Œ๋ฌธ์— ๋ฌธ์žฅ์ด ๊ธธ๊ณ  ๋ณต์žกํ•  ์ˆ˜๋ก ์ž˜ ํ‘œํ˜„ํ•˜๊ธฐ๊ฐ€ ์–ด๋ ค์›€

โ—ฝ  ๋‹จ์–ด ์‚ฌ์ด์˜ interaction ์„ (EX. Hit the ball, Uh ball, Blue ball) ์ž˜ ๋ชป์žก์•„ ๋‚ด๋Š” ๊ฒฝ์šฐ๊ฐ€ ์กด์žฌํ•จ 

 

 

 

โ‘ฃ Simple TreeRNN ์˜ ํ•œ๊ณ„์  

 

โ—ฝ  W๊ฐ€ ๋ชจ๋“  ๋…ธ๋“œ์—์„œ ๋™์ผํ•˜๊ฒŒ ์ ์šฉ๋˜๋ฏ€๋กœ ์ผ๋ถ€ ํ˜„์ƒ์—์„œ๋Š” ์ ํ•ฉํ•  ์ˆ˜ ์žˆ์œผ๋‚˜ ๋” ๋ณต์žกํ•˜๊ณ  ๊ณ ์ฐจ ๊ตฌ์„ฑ ๋ฐ ๊ธด ๋ฌธ์žฅ์—์„œ๋Š” ์ ์ ˆํ•˜์ง€ ๋ชปํ•˜๋‹ค. 

โ—ฝ  input ๋‹จ์–ด๊ฐ„ ์‹ค์ œ ์ƒํ˜ธ์ž‘์šฉ์ด ์—†๋‹ค. 

โ—ฝ  ์กฐํ•ฉ ํ•จ์ˆ˜๊ฐ€ ๋ชจ๋“  ๊ฒฝ์šฐ์— ๋Œ€ํ•ด ๋™์ผํ•˜๊ฒŒ ์ž‘์šฉํ•œ๋‹ค. 

 

 

 

 

 

 

 

 

 

 

3๏ธโƒฃ  Syntatically-United RNN , Matrix-Vector RNN 


 

 

โ‘   SU-RNN (2013) 

 

์กฐํ•ฉ๋  ๋‹จ์–ด์˜ ํ™•๋ฅ ์„ ๊ณ„์‚ฐํ•˜๊ณ  TreeRNN ์— ์ ์šฉํ•œ ๋ชจ๋ธ
ํ–‰๋ ฌ W ๋ฅผ ๊ฐ๊ธฐ ๋‹ค๋ฅธ ํ–‰๋ ฌ๋กœ ์„ค์ •ํ•œ๋‹ค.

 

โœ”  PCFG + Tree RNN 

 

 

 

โ—ป PCFG ๋‹ค์ด๋‚˜๋ฏน ์•Œ๊ณ ๋ฆฌ์ฆ˜์„ ์‚ฌ์šฉํ•ด ๋ฌธ์žฅ ๊ตฌ์กฐ๋ฅผ ๋งŒ๋“  ๋‹ค์Œ Tree RNN ์„ ์ ์šฉํ•˜๋Š” ๋ฐฉ๋ฒ• 

โ—ป Weight matrix ๋ฅผ ๋™์ผํ•˜๊ฒŒ ์ ์šฉํ•˜์ง€ ์•Š๊ณ  ์ƒํ™ฉ์— ๋”ฐ๋ผ ๋‹ค๋ฅธ ๊ฐ’์„ ์ ์šฉํ•จ 

 

 

 

โœ”  PCFG 

 

 

โ—ป Probabilistic Context Free Grammar 

 

 

  • ์กฐํ•ฉ๋  ๋‹จ์–ด์˜ ํ™•๋ฅ ์„ ๊ณ„์‚ฐํ•˜๊ณ  TreeRNN ์— ์ ์šฉํ•œ ๋ชจ๋ธ์ด SU-RNN 

 

 

 

 

 

โ—ป ๋Œ€์นญ๋˜๋Š” ๋ถ€๋ถ„์˜ ์˜์—ญ์„ ๊ฐ•์กฐํ•˜๊ธฐ ์œ„ํ•ด Identity matrix ๋ฅผ ๊ณฑํ•˜์—ฌ ๊ฐ€์ค‘์น˜๋ฅผ ์ดˆ๊ธฐํ™” ํ•จ 

 

 

 

 

โ‘ก MV-RNN (2012) 

 

๋‹จ์–ด๋“ค์ด ๋ฒกํ„ฐ ์ •๋ณด ๋ฟ ์•„๋‹ˆ๋ผ ํ–‰๋ ฌ ์ •๋ณด๋„ ๊ฐ™์ด ํฌํ•จํ•˜๋Š” ๋ชจ๋ธ 

 

โœ”  Node Interaction 

 

 

 

โ—ป ๋‹จ์–ด๊ฐ€ ์ง€๋‹ˆ๋Š” ์ •๋ณด๋ฅผ ํ•˜๋‚˜ ๋” ๊ฐ€์ง€๊ฒŒ (ํ–‰๋ ฌ ์ •๋ณด) ํ•จ์œผ๋กœ์จ ๋ฌธ์žฅ์˜ ์˜๋ฏธ๋ฅผ ๋” ์ž˜ ํŒŒ์•…ํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ•œ๋‹ค. 

โ—ป EX. very ์˜ ๋‹จ์–ด๋ฒกํ„ฐ์™€ good ์˜ ํ–‰๋ ฌ์ด ๊ณฑํ•ด์ง€๊ณ , good ์˜ ๋‹จ์–ด๋ฒกํ„ฐ์™€ very ์˜ ํ–‰๋ ฌ์ด ๊ณฑํ•ด์ ธ ๋ถ€๋ชจ ๋…ธ๋“œ๋กœ ์ „๋‹ฌ๋˜๋Š” ํ˜•ํƒœ 

 

 

 

โœ” Ex

 

 

not annoying, not sad ๋ถ€๋ถ„์—์„œ MV-RNN ์ด ๋” ์ž˜ ๋งž์ถค

 

 

 

 

 

 

 

โ‘ข  Recursive Neural Tensor Network 

 

โœ” ๊ฐ์ •๋ถ„์„ 

 

โ—ป ๋‹จ์–ด์˜ ๊ฐ์ •์„ ๋ถ„์„ํ•˜๋Š” ํƒœ์Šคํฌ ์—ฐ๊ตฌ๋Š” ๊พธ์ค€ํžˆ ์ง€์†๋˜์–ด ์˜ด 

โ—ป TreeRNN ์„ ํ†ตํ•ด ๋‹จ์–ด๋‚˜ ๋ฌธ์žฅ์„ ๋ถ„์„ํ•˜์ง€ ์•Š๊ณ  BoW ๋ฅผ ํ†ตํ•ด ์ž„๋ฒ ๋”ฉํ•˜์—ฌ ๋ฌธ์ •์„ ๋ถ„์„ํ•ด๋„ 90% ์„ฑ๋Šฅ์„ ๋ณด์ž„ 

 

 

 

๐Ÿ‘‰ BoW ๋กœ ํ•˜๋ฉด ๊ธ์ •์œผ๋กœ ํŒ๋‹จํ•˜์ง€๋งŒ, ๋ฌธ์žฅ์„ ๋ฌธ๋ฒ•์ ์œผ๋กœ ํ•ด์„ํ•˜๋ฉด ๋ถ€์ •์˜๋ฏธ๋กœ ํ•ด์„๋จ

๐Ÿ‘‰ shoud have pp ๋ผ๋Š” ์˜๋ฏธ ๊ตฌ์กฐ๋ฅผ BoW ๋Š” ๋ฐ˜์˜ํ•  ์ˆ˜ ์—†์Œ

 

 

 

โœ” Recursive Neural Tensor layer : RNTN

 

โ—ป MV-RNN ๋ณด๋‹ค ์ ์€ ๊ฐœ์ˆ˜์˜ ํŒŒ๋ผ๋ฏธํ„ฐ๋ฅผ ๊ฐ€์ง€๋Š” ๋ชจ๋ธ 

 

 

โ—ป Treebank ๋ฐ์ดํ„ฐ์…‹์„ ์‚ฌ์šฉํ•œ ๊ธ/๋ถ€์ • ๋ถ„์„ task ์—์„œ RNTN ์ด ๋‹ค๋ฅธ ๋ชจ๋ธ์— ๋น„ํ•ด ๋†’์€ ์„ฑ๋Šฅ์„ ๋ณด์ž„ 

 

  • ๊ตฌ์กฐ๊ฐ€ ๊ฐ€์žฅ ๊ฐ„๋‹จํ•œ Bi NB ๋ชจ๋ธ์ด Simple RNN, MV-RNN ๋ชจ๋ธ๋ณด๋‹ค ์„ฑ๋Šฅ์ด ์ข‹์Œ → ๋ฐ์ดํ„ฐ์…‹์˜ ์ค‘์š”์„ฑ 

 

 

 

 

 

728x90

๋Œ“๊ธ€