SlideShare a Scribd company logo
1 of 30
Download to read offline
短単位品詞の用法曖昧性解決と
依存関係ラベリングの同時学習
松田寛
株式会社リクルート
大村舞 浅原正幸
本資料のURLをtwitterで公開します。印刷物をMegagonブースで配布します。
March 13, NLP2019 F2-3
要するに、なにをしたの?
(タイトルがわかりにくくてすみません)
2
Universal Dependencies日本語版の解析系を開発
● 新しい日本語依存構造解析器を実装
○ OSS (SudachiPy+spaCy) を活用
● 日本語 Universal Dependencies 体系に準拠
○ 形態素解析出力(UniDic短単位)の可能性品詞の用法解決を行い
UD品詞体系に準拠した出力を実現
3
提案手法の実装をgithubで公開中
● 日本語NLPライブラリ - GiNZA
○ https://rit-git.github.io/ginza/
○ MIT License
○ Python3.6 及び対応する pip(3.7には近日対応)
○ β版はソースコードのみを公開
○ 近日中に学習済みモデルを含めた正式版を公開予定
Stanford NLPとのベンチマーク結果も公開していきます!
4
使用したリソース
● NLP Framework
○ spaCy v2.0.17
※ spaCy日本語版の初の完全な実装
● Treebank (コーパス)
○ UD-Japanese BCCWJ v2.3 - 5.6万文, 126万語を使用
※ UD-Japanese BCCWJを利用した初の解析系実装
● Tokenizer (形態素解析器)
○ SudachiPy + Core辞書 を使用
※ 解析モードA,B,Cいずれにも対応可能
5
先行研究
Universal Dependenciesの日本語への適用
6
Universal Dependenciesとは
● 歴史
○ 2014年頃にUDコミュニティが日本を含め全世界に広がる
○ 日本語コーパスはGSD・KTC・PUD・BCCWJ等が公開済み
● 目的
○ Universal Dependencies (UD)は、構文解析の後段の処理の
共通化や、他の言語のコーパスを用いた言語横断的な学習、
言語間の定量的な比較などを可能にするための土台を目指
して、多言語で一貫した構文構造とタグセットを定義する
という活動である。[金山2015]
7
英語と日本語のUniversal Dependenciesの比較
8
● 日本語でもnsubj(主語)やobj(目的語)などのRelationラベルを振る
UD-Japanese BCCWJ: 現代日本語書き言葉均衡コーパスのUniversal Dependencies [大村2018] より引用
先行研究 [Omura 2018]
BCCWJコーパスのUniversal Dependencies化
9
文節係り受けから単語レベル依存関係への変換
● 文節主辞間の依存関係を保持する形でルールにより処理
UD-Japanese BCCWJ: Universal Dependencies Annotation for the Balanced Corpus of Contemporary Written Japanese (Omura, UDW2018) より抜粋
10
単語レベルの変換ルール
● 単語長はBCCWJのUniDic短単位を使用する
● 品詞変換ではBCCWJの用法・長単位品詞属性まで参照する
UD-Japanese BCCWJ:『現代日本語書き言葉均衡コーパス』の Universal Dependencies より表の一部を抜粋
11
Universal Dependencies - Relation Labels
● UDの依存関係ラベルは37種(UD-Japanese BCCWJは現時点で23種を使用)
12
なぜ用法・長単位品詞が必要か?
● UniDic短単位は語彙主義的な可能性に基づく品詞体系
● UD品詞は用法主義的であるため可能性品詞の解決が必要
UD-Japanese BCCWJ:『現代日本語書き言葉均衡コーパス』のUniversal Dependencies より抜粋
● 解析系では用法曖昧性解消処理を実装する必要がある
13
予備実験:正解トークンを使用した精度比較
● 依存構造解析器
○ Baseline:UDPipe v1.2 - CoNLL UD Task標準のNeural Parser
○ spaCy:Multi-task CNN Learnerを使用した多言語パーザ
LAS=Labeled Attachment Score, UAS=Unlabeled Attachment Score
※ 訓練コーパスのみ、交差を含む 115 文を除外している
14
提案手法
依存関係ラベルへのUD品詞の埋め込み
15
広範囲の文脈を考慮した用法曖昧性解決 #1
● 既存の形態素解析器はUniDic長単位品詞を扱えない
○ MeCab・SudachiのUniDic辞書の出力は短単位品詞のみ
○ 隣接形態素のみ考慮するモデルでは可能性品詞の解決は困難
■ とされているが、ある程度はCRFでも解決できるのでは…
■ 「つつじ」[松吉 2007]は機能語の複合表現を扱うもので用法曖昧性
解決そのものとは独立なタスクであるが関連は深い
○ 本研究では依存構造解析レイヤでシンプルに解決を試みる
16
広範囲の文脈を考慮した用法曖昧性解決 #2
● 依存関係ラベリングと同時に用法曖昧性解決を行う
○ 形態素解析と比較して広範囲の文脈を考慮することができる
○ 可能性品詞について正解UD品詞で依存関係ラベルを展開
■ 全品詞を展開すると問題空間が広がりすぎて精度が低下
○ 形態素解析誤りの補正も同時に行う
■ 品詞誤り
■ 区切り誤り(細分化のみ)
● 詳しくは次項以降で説明します
17
依存関係ラベルへのUD品詞の埋め込み
● UD-BCCWJで可能性品詞を持つ語の依存関係ラベルを置換
18
aux_as_AUXに置換
aux
依存関係ラベルへのUD品詞の埋め込み
● UD-BCCWJで可能性品詞を持つ語の依存関係ラベルを置換
19
acl_as_VERBに置換
acl
このラベル置換の枠組みで形態素解析誤りも補正できる!
BCCWJを再解析し品詞を誤る場合に上記置換を適用するのが最適解となった
形態素解析出力の補正 - 過剰分割のまとめ上げ
● 再解析結果で過剰分割となる部分に纏め上げラベルを付与
20
纏め上げラベルとしてas_NOUNを付与
補正できない場合
● Goldの区切りを形態素解析器が再現できない場合は未対応
21
実験:Tokenizationを含めた解析実験
● SudachiPy mode=Cにおける依存構造解析精度
○ GAP=トークン境界判定精度, POS=境界+品詞まで一致
○ UPOS=UAS+境界+品詞が一致, LPOS=UPOS+依存関係ラベルまで一致
22
実験:可能性品詞の用法曖昧性解決
● 評価対象
○ 評価データセットで可能性品詞をもつ 30,095 トークンのうち形態素
解析出力と正解の両端が一致するものに限定
○ 直接学習:学習時に形態素解析出力でなく正解トークンを使用
■ 依存関係ラベル拡張は行わず変換表のみでUD品詞を推定
○ 変換表の質に依らず提案方式は高精度でUD品詞を推定
23
実験:解析速度
● 実験環境
○ CPU Core-i9 6コア(12スレッド), GPU RTX2080 Max-Q
○ DDR4-2666 32GB, NVMe SSD
○ python 3.6.8, spacy[cuda92] 2.0.17, nvidia-driver 418.43
● 解析対象
○ 218,863文(平均単語数=18.9[語/文])
● 解析速度
○ prefer CPU: 46.6 [文/秒] - CPU load average: 1000%前後
○ prefer GPU: 67.0 [文/秒] - CPU: 100%前後, GPU: 4%
訓練時はGPU使用による高速化効果がさらに高まる
24
研究の課題と展望
● 形態素解析レイヤーでの用法曖昧性解決
○ 直接UD品詞で形態素解析した結果を本手法と比較したい
○ 機能語連続で解析揺れが目立っている
■ 機能語も積極的に複合辞化するべきか
■ UDでは文節が明示されないため応用でも複合辞化メリットは大
■ 他方、複合名詞の揺れに起因する誤解析は比較的少ない
● 依存構造解析
○ 機能語・複合名詞以外の誤解析の多くは依存先判定の誤り
○ ルート判定と全体精度を同時に向上(現状はトレードオフ)
25
産業用途でのUD利用メリット
26
産業用NLPにおけるUD利用メリット
● 最新OSSでNLP実装効率が劇的に改善・本質に集中できる
○ spaCyやStanford NLPなど高機能なFrameworkが使える
■ 商用利用可能な MIT or Apache License
■ UD体系を前提にAPIが設計されている
○ NE抽出・文書分類などのダウンストリームタスクも実装済
■ spaCyではマルチタスク学習が可能
● OSS NLP Frameworkで多言語タスクの実現が容易になる
○ システム開発観点ではi18n対応においてリソース差し替えのみで
言語の追加・切り替えが可能であることは重要な要件
○ pip install 一発で所望の言語を追加可能
27
デメリットはあるか?
● 既存のルールリソースがある場合はUD化作業が発生
○ 文節や格を単語レベル依存関係に読み替えるのが結構大変
■ 短単位品詞も出力可能なので品詞指定はそのまま使える
● 日本語だけ扱うのならUDでなくてもよい?
○ 文節が明示されるメリットはある
○ UDの依存関係ラベルも(慣れれば)使いやすいがやはり
文節があって格があるという立て付けも捨て難い
28
日本語UDを扱うGiNZAとStanford NLPの比較
● NLP2019投稿直後にStanford NLPが公開された
○ 本研究と同じ日本語版UDに対応したPython NLP Framework
○ 詳細調査中につき以下は推測を含みます
● Tokenizer
○ 提案手法
■ CRF, 形態素辞書 (1.5M words)←現状での精度差の主要因か
○ Stanford NLP
■ BiLSTM+Biaffine?, 辞書なし・語彙追加用コーパスを使用?
● Dependency Parser
○ 提案手法
■ Multi-task CNN Learner, BCCWJコーパス (1.26M tokens)
○ Stanford NLP
■ BiLSTM?, GSDコーパス (184k tokens)←コーパスが一桁小さい
29
まとめと今後の課題
● まとめ
○ UniDic短単位品詞の用法曖昧性を依存関係ラベリングと同時に解
決する手法を提案・実装した
● 今後の課題
○ 形態素解析レベルでの用法曖昧性解消との結果の比較
○ 学習済みモデルを含めたGiNZA正式版の公開
■ UD-Japanese成果の継続的な反映
○ 若手研究者の日本語離れ・Syntax離れに歯止めを!
● 全言語を統一的に扱うUDのBig Challengeにぜひご賛同を!
30

More Related Content

Featured

Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationErica Santiago
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellSaba Software
 

Featured (20)

Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
 

松田寛 - 短単位品詞の用法曖昧性解決と依存関係ラベリングの同時学習