Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
深層学習を用いた自然言語処理(2)
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
shu_suzuki
January 17, 2019
Technology
1
110
深層学習を用いた自然言語処理(2)
2019年1月17日 第2回B3ゼミ資料
長岡技術科学 自然言語処理研究室
16104587 鈴木脩右
shu_suzuki
January 17, 2019
Tweet
Share
More Decks by shu_suzuki
See All by shu_suzuki
文献紹介:Investigating Evaluation of Open-Domain Dialogue Systems With Human Generated Multiple References
shu_suzuki
0
190
文献紹介:Do Neural Dialog Systems Use the Conversation History Effectively? An Empirical Study
shu_suzuki
0
84
文献紹介: How to Make Context More Useful? An Empirical Study on Context-Aware Neural Conversational Models
shu_suzuki
0
340
文献紹介:Conversational Response Re-ranking Based on Event Causality and Role Factored Tensor Event Embedding
shu_suzuki
0
170
文献紹介:Modeling Semantic Relationship in Multi-turn Conversations with Hierarchical Latent Variables
shu_suzuki
0
77
文献紹介:ReCoSa: Detecting the Relevant Contexts with Self-Attention for Multi-turn Dialogue Generation
shu_suzuki
0
210
文献紹介:Better Automatic Evaluation of Open-Domain Dialogue Systems with Contextualized Embeddings
shu_suzuki
0
120
文献紹介:Why are Sequence-to-Sequence Models So Dull?
shu_suzuki
0
70
文献紹介:Multi-Turn Response Selection for Chatbots with Deep Attention Matching Network
shu_suzuki
0
220
Other Decks in Technology
See All in Technology
【Ubie】AIを活用した広告アセット「爆速」生成事例 | AI_Ops_Community_Vol.2
yoshiki_0316
1
120
SREが向き合う大規模リアーキテクチャ 〜信頼性とアジリティの両立〜
zepprix
0
480
今こそ学びたいKubernetesネットワーク ~CNIが繋ぐNWとプラットフォームの「フラッと」な対話
logica0419
5
530
Oracle Cloud Observability and Management Platform - OCI 運用監視サービス概要 -
oracle4engineer
PRO
2
14k
ECS障害を例に学ぶ、インシデント対応に備えたAIエージェントの育て方 / How to develop AI agents for incident response with ECS outage
iselegant
4
430
CDKで始めるTypeScript開発のススメ
tsukuboshi
1
580
モダンUIでフルサーバーレスなAIエージェントをAmplifyとCDKでサクッとデプロイしよう
minorun365
4
230
今日から始めるAmazon Bedrock AgentCore
har1101
4
420
[CV勉強会@関東 World Model 読み会] Orbis: Overcoming Challenges of Long-Horizon Prediction in Driving World Models (Mousakhan+, NeurIPS 2025)
abemii
0
150
AI駆動開発を事業のコアに置く
tasukuonizawa
1
400
プロポーザルに込める段取り八分
shoheimitani
1
670
10Xにおける品質保証活動の全体像と改善 #no_more_wait_for_test
nihonbuson
PRO
2
340
Featured
See All Featured
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.4k
How STYLIGHT went responsive
nonsquared
100
6k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
110
The Mindset for Success: Future Career Progression
greggifford
PRO
0
240
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.3k
Building Adaptive Systems
keathley
44
2.9k
Heart Work Chapter 1 - Part 1
lfama
PRO
5
35k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
430
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
330
How to Think Like a Performance Engineer
csswizardry
28
2.5k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
120
Transcript
深層学習を用いた 自然言語処理(2) 2019年1月17日 長岡技術科学大学 自然言語処理研究室 16104587 鈴木脩右
分散表現を得る手法 カウントベース • ある単語の周囲の単語をカウントし, そこから分散表現を得る. 推論ベース • 推測することを目標とし,副産物として分散表現を得る.
分散表現を得る手法 カウントベース • ある単語の周囲の単語をカウントし, そこから分散表現を得る. 推論ベース • 推測することを目標とし,副産物として分散表現を得る.
word2vec • 教師なし学習で,2層のニューラルネットワークで構成される • ある単語(ターゲット)と周囲の単語(コンテキスト)で推論を行う 例) 吾輩 は 猫 で
ある → に入る単語を推論する • 入出力はone-hot表現(ターゲットが1,コンテキストが0のベクトル) • 学習した入力側の重みを分散表現として獲得 ? ?
word2vecのモデル •CBOWモデル (continuous bag-of-words) •Skip-gramモデル
CBOWモデル 吾輩 は 猫 で ある ? コンテキストから ターゲットを予測
skip-gramモデル 吾輩 は 猫 で ある ターゲットから コンテキストを予測 ? ?
Negative Sampling •語彙数が多いと学習時間が長くなる →正例を与えれば短時間で学習可能 •負例も学習しないと精度が落ちる →負例をいくつかサンプリングして学習 •サンプリングには確率分布を用いる →高頻度の単語を負例として学習可能
word2vecでできること •コサイン類似度から,類似単語を見つける •類推問題をベクトルの加減算で行える 例)王様 ー 男性 + 女性 = 女王様
•転移学習に用いる (文書分類,感情分析)
word2vecの試行(1)〜学習データ作成〜 1. 学習データの作成 1.1. 「吾輩は猫である」のtxtデータから一文ずつ抽出 1.2. MeCab+NEologdで形態素解析を行い単語に分割 1.3. 各ケースに分けて学習データを作成 case1:デフォルト
case2:ストップワード(助詞など)の削除 case3:case2+動詞と形容詞を原形 ※MeCabでは形容動詞は名詞+助動詞として扱っている
word2vecの試行(2)〜学習モデル作成〜 2. 学習モデルの作成 2.1. gensimライブラリをインポート 2.2. skip-gramモデルでcase毎にモデルを作成 次元=100 サンプリング数=5 コンテキスト幅=5
学習回数=20
word2vecの試行(3)〜学習モデルの実行〜 3. 学習モデルの実行 3.1. "猫"と類似度が高い10単語を算出 3.2. "主人"ー"教師"+"猫"で類推問題を行う
試行結果(1)〜"猫"に近い言葉トップ10〜 case1 順位 単語 コサイン類似度 1 属 0.5750970840454102 2 進化
0.5526435375213623 3 我 0.5522434711456299 4 一疋 0.5347474813461304 5 日本 0.4959474205970764 6 せめて 0.4941026270389557 7 東郷 0.4885278046131134 8 捕る 0.4851223826408386 9 衣服 0.4850785434246063 10 命 0.48465996980667114 case2 順位 単語 コサイン類似度 1 属 0.5774160623550415 2 単純 0.5677100419998169 3 どうし ても 0.5621654987335205 4 一疋 0.5609810948371887 5 捕り 0.5340269804000854 6 受けて 0.5336517095565796 7 あえて 0.5320902466773987 8 捕ら 0.5280115604400635 9 吾輩 0.5278669595718384 10 捕る 0.526888370513916 case3 順位 単語 コサイン類似度 1 家で 0.5735255479812622 2 一疋 0.5683689117431641 3 属 0.567547082901001 4 受けて 0.5511975288391113 5 夜中 0.5482147932052612 6 南無阿 弥陀仏 0.5468812584877014 7 愚 0.5467036962509155 8 動物 0.5419996380805969 9 どうし ても 0.5349091291427612 10 美しい 0.5301364660263062
試行結果(2)〜類推問題〜 "主人"-"教師"+"猫" ="横"(0.42507898807525635) (case1) ="吾輩" (0.4937707483768463) (case2) ="吾輩 " (0.5058480501174927)
(case3)
まとめ • Word2vecはターゲットやコンテキストで推論を行い,その重みを分 散表現として得る. • CBOWモデルはコンテキストからターゲットを予測する • skip-gramモデルはターゲットからコンテキストを予測する • 学習の高速化にはNegative
samplingという手法がある • 3種類のデータクレンジング方法で試行したが大きな違いは 得られなかった.大規模なコーパスで定量的な実験を行いたい
参考文献 [1] 斎藤康毅.ゼロから作る Deep Learning②.オライリー・ジャパ ン,2018. [2] 西村陸,松本忠博.日本語単語ベクトルの精度向上のための 前処理手法の検討.言語処理学会 第23回年次大会
発表論文集, pp.613-616,2017.
おまけ〜乾・鈴木研究室配布モデル〜 順位 単語 コサイン類似度 1 犬 0.8248943090438843 2 ネコ 0.8084875345230103
3 黒猫 0.7770006060600281 4 子猫 0.7636253833770752 5 ウサギ 0.7440483570098877 6 飼い猫 0.7325707674026489 7 ねこ 0.7288334369659424 8 子犬 0.727780818939209 9 野良猫 0.7255929708480835 10 飼っ 0.7047336101531982 "すき焼き"-"日本"+"アメリカ" ="ホットドッグ "(0.564887523651123)