$30 off During Our Annual Pro Sale. View Details »
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
[論文解説] Not All Negatives are Equal: Label Aware...
Search
Reon Kajikawa
January 22, 2025
0
12
[論文解説] Not All Negatives are Equal: Label Aware Contrastive Loss for Fine grained Text Classification
EMNLP2021の論文。教師あり対照学習における改善手法の提案。負例に対してクラス間の近さを考慮した重み付けを行う。
Reon Kajikawa
January 22, 2025
Tweet
Share
More Decks by Reon Kajikawa
See All by Reon Kajikawa
[論文解説] mPLUG-DocOwl2: High-resolution Compressing for OCR-free Multi-page Document Understanding
reon131
0
3
[論文解説] Disentangled Learning with Synthetic Parallel Data for Text Style Transfer
reon131
0
14
[論文解説] Large Language Models can Contrastively Refine their Generation for Better Sentence Representation Learning
reon131
0
17
[論文解説] SentiCSE: A Sentiment-aware Contrastive Sentence Embedding Framework with Sentiment-guided Textual Similarity
reon131
0
14
[論文解説] Text Embeddings Reveal (Almost) As Much As Text
reon131
0
120
[論文解説] OssCSE: Overcoming Surface Structure Bias in Contrastive Learning for Unsupervised Sentence Embedding
reon131
0
6
[論文解説] Sentence Representations via Gaussian Embedding
reon131
0
91
[論文解説] Unsupervised Learning of Style-sensitive Word Vectors
reon131
0
16
[論文解説] One Embedder, Any Task: Instruction-Finetuned Text Embeddings
reon131
0
44
Featured
See All Featured
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
41
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
0
70
Paper Plane
katiecoart
PRO
0
44k
Making the Leap to Tech Lead
cromwellryan
135
9.7k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
31
Getting science done with accelerated Python computing platforms
jacobtomlinson
0
76
Designing for Timeless Needs
cassininazir
0
88
Crafting Experiences
bethany
0
21
Why Our Code Smells
bkeepers
PRO
340
57k
The agentic SEO stack - context over prompts
schlessera
0
550
So, you think you're a good person
axbom
PRO
0
1.8k
Agile that works and the tools we love
rasmusluckow
331
21k
Transcript
Not All Negatives are Equal: Label-Aware Contrastive Loss for Fine-grained
Text Classification Varsha Suresh, Desmond C. Ong EMNLP 2021 URL:https://aclanthology.org/2021.emnlp-main.359/ 発表者:M1 梶川 怜恩
テキスト分類 • クラス間の関係を理解させるように学習させたい • 対照学習における負例に着目した損失の提案 • クラス間の意味的な近さを考慮するように重み付けを行う 評価実験 • 通常の対照損失やクロスエントロピー損失よりも高い精度を達成した
• クラス数が多い場合や混同されやすいクラスが存在する場合に効果あり 1 概要
感情分析:ポジティブ~ネガティブをN値分類する • 順序ラベルであり、細かな度合いを分類するのは難しい • 「かなりポジティブ」と「ややポジティブ」 感情分類:喜び、悲しみ、怒り…を分類する • 意味的に類似するクラスは分類が難しい • 「悲しみ」と「挫ける」や「激怒」と「イライラ」
2 きめ細かな分類は微妙な違いを識別する能力が必要となる
単純な手法 • クロスエントロピー損失でBERTを追加学習する • カテゴリラベルを前提としているため、感情分析/分類では不適切な損失である • Loss(かなりポジをややポジと予測)= Loss(かなりポジをかなりネガ) 教師あり対照学習 (Gunel
et al., 21) • 対照損失で追加学習する • Few-shot学習において単純な手法よりも高い精度が出ると報告されている • クラス間の細かな違いは考慮されていない 3 既存手法
クラス間の関係を学習するような対照損失を提案する • 類似度行列の各要素を重み付けする • 順序ラベルの5値分類(A~E) 4 提案手法 1 0 0
… 0 0 1 0 … 0 0 0 1 … 0 … … … … … 0 0 0 … 1 0.7 0.2 0.7 … 0.01 0.3 0.5 0.3 … 0.05 0.6 0.3 0.6 … 0.0 … … … … … 0.0 0.1 0.0 … 0.8 𝑥1,𝐴 𝑥2,𝐵 𝑥3,𝐴 … 𝑥𝑁,𝐸 𝑥1,𝐴 𝑥2,𝐵 𝑥3,𝐴 … 𝑥𝑁,𝐸 𝑥1,𝐴 + 𝑥2,𝐵 + 𝑥3,𝐴 + … 𝑥𝑁,𝐸 + 𝑥1,𝐴 + 𝑥2,𝐵 + 𝑥3,𝐴 + … 𝑥𝑁,𝐸 + 教師あり対照学習 提案手法
提案手法 5
クラス間の関係を考慮して、重み付けするNNを追加 → 重み付け𝑤𝑖 は学習パラメータとする 6 Label-Aware Contrastive Loss 0.7 0.2
0.7 … 0.01 0.3 0.5 0.3 … 0.05 0 0 1 … 0 … … … … … 0 0 0 … 1 𝑥1,𝐴 𝑥2,𝐵 𝑥3,𝐴 … 𝑥𝑁,𝐸 𝑥1,𝐴 + 𝑥2,𝐵 + 𝑥3,𝐴 + … 𝑥𝑁,𝐸 + 提案手法
3つの損失で学習する 7 全体図
評価実験 8
2タスクで評価 • 感情分析(Acc) • SST-5:映画レビュー(5クラス) • SST-2:映画レビュー(2クラス) • 感情分類(Acc, F1)
• Empathetic Dialogues:対話データ(32種類) • GoEmotions:Redditのコメント(27種類) • ISEAR:感情体験に関する文(7種類) • Emolnt:ツイート(4種類) 9 データセット
提案手法 • モデル:ELECTRA • 最終層のCLSトークンを分類層への入力とする • 損失:Label-Aware Contrastive Loss 比較手法
• モデルの比較 • 感情分析特化モデル:SentiBERT, SentiLARE, SKEP • 損失の比較 • クロスエントロピー損失 • 教師あり対照損失[Gunel 21] 10 提案手法と比較手法
• 既存手法と同等の性能 • 少ないクラス数では既存手法に劣る • 2値分類では簡単すぎるため、明確な改善を示すのは困難 • 提案手法はクラス間の対比を強調するよう設計されており、クラス数が多い場合に有効である 11 実験結果:感情分析
既存の損失と比べて性能が改善 12 実験結果:感情分類
32, 16, 8クラス分類 • 一貫して改善が見られた 4クラス分類(類似する/しないクラス間で分類) • hard(類似するクラス間)において、手法の有効性が高い • easy(類似しないクラス間)において、手法の有効性は低い
13 分析:クラス数の変化させたとき
テキスト分類 • クラス間の関係を理解させるように学習させたい • 対照学習における負例に着目した損失の提案 • クラス間の意味的な近さを考慮するように重み付けを行う 評価実験 • 通常の対照損失やクロスエントロピー損失よりも高い精度を達成した
• クラス数が多い場合や混同されやすいクラスが存在する場合に効果あり 14 まとめ