SlideShare a Scribd company logo
1 of 36
Download to read offline
『BrandSafe はてな』の
アドベリフィケーションの
しくみ
伊奈 林太郎
id:tarao @oarat
株式会社はてな
2014-12-16
自己紹介
名前  
い な
伊奈   
り ん た ろ う
林太郎  (id:tarao / @oarat )
所属 はてなブックマークチーム
2008-08 はてなインターン
2008-10 はてなアルバイト (ブックマークチーム)
2010-04 日本学術振興会 特別研究員 (DC1)
2013-04 はてな正社員
2013-12 ブックマークチーム
自己紹介 — やってること
インターン / アルバイト時代
2008-08 本文抽出エンジン
2008-12 おすすめユーザ
2009-04 検索欄「もしかして」
2009-07 ユーザページ全文検索
2009-10 地域別エントリ
最近
2014-08 BrandSafe はてな
2014-09 Presso Twitter 連携
自己紹介 — やってること
インターン / アルバイト時代
2008-08 本文抽出エンジン
2008-12 おすすめユーザ
2009-04 検索欄「もしかして」
2009-07 ユーザページ全文検索
2009-10 地域別エントリ
最近
2014-08 BrandSafe はてな
2014-09 Presso Twitter 連携
◮ 検索技術 > 機械学習 ≫ アドテク
自己紹介 — やってること
インターン / アルバイト時代
2008-08 本文抽出エンジン
2008-12 おすすめユーザ
2009-04 検索欄「もしかして」
2009-07 ユーザページ全文検索
2009-10 地域別エントリ
最近
2014-08 BrandSafe はてな
2014-09 Presso Twitter 連携
◮ 検索技術 > 機械学習 ≫ アドテク
◮ (大学時代の専門は型理論)
BrandSafe はてなBrandSafe はてなBrandSafe はてなBrandSafe はてなBrandSafe はてなBrandSafe はてなBrandSafe はてな
BrandSafe はてな
アドベリフィケーション
BrandSafe はてな
アドベリフィケーション
広告配信先をフィルタリング
◮ アダルトサイト
◮ 2ch まとめ
◮ 違法ダウンロード
技術的には
◮ 任意の Web ページ (URL) の分類問題
◮ 各属性に対して二値判定
どうやって判定?
いろいろなやり方の選択肢
◮ 手動...orz
◮ ルールベース
◮ 機械学習
etc.
できるだけ楽にシンプルに
◮ 工数を抑えたい
◮ 計算量を抑えたい
◮ 複雑すぎてメンテできないと困る
URLの判定が走るまで
1. ユーザによる URL のブックマーク
2. GET
3. 本文抽出
4. メタ情報抽出
◮ キーワード
◮ リンク先
◮ 画像
5. カテゴリ判定
6. アドベリ判定
◮ 1をブックマーク以外のトリガからも実行
判定アルゴリズム判定アルゴリズム判定アルゴリズム判定アルゴリズム判定アルゴリズム判定アルゴリズム判定アルゴリズム
素朴なフィルタの例
NG ワード判定
◮ 実装が簡単
◮ 正規表現マッチ
◮ メンテナンスが簡単
◮ 単語をリストに追加するだけ
◮ 精度はあまり高くない
リンクの数
◮ e.g. 特定ドメインへのリンク
◮ e.g. アフィリエイトリンクの多さ
素朴なフィルタによる誤爆
例
◮ 「カブトムシの交尾」で Google AdSense 停止
(実際はもっと複合的な要因ではないかとの指摘も)
◮ 「やまもといちろう」問題
素朴なフィルタによる誤爆
例
◮ 「カブトムシの交尾」で Google AdSense 停止
(実際はもっと複合的な要因ではないかとの指摘も)
◮ 「やまもといちろう」問題
こんなことでは困る!
フィルタの組み合わせ
◮ ひとつひとつは素朴なフィルタ
◮ たくさん組み合わせたら賢くなる?!
フィルタの組み合わせ
ひとつだけだと弱い
フィルタの組み合わせ
フィルタを増やすと綺麗に分けられるかも?
ひとつだけだと弱い
直線が引ければよい
直線の式
ax + by + c = 0
直線が引ければよい
直線の式
ax + by + c = 0
各点から直線までの距離
(axi + byi + c)/
√
a2 + b2
直線が引ければよい
直線の式
ax + by + c = 0
各点から直線までの距離
(axi + byi + c)/
√
a2 + b2
◮ あとは良い a, b を設定するだけ!
え, これ手でチューニングするの?
AdaBoost [’95 Freund, Schapire]
特徴
◮ 弱分類器の重みと閾値を自動的に決定
◮ 弱分類器は弱すぎなければなんでもよい
◮ 精度が 50%以上なら全体精度も向上
◮ いろんな弱分類器をいい具合に組み合わせ可能
原理
◮ 入力にも重みを持たせる (最初はぜんぶ 1)
◮ 弱分類器を順に学習
◮ 弱分類器の重みと閾値の最適値を決定
◮ 前の弱分類器が誤判定した入力は, 後の弱分類
器では重みを上げて学習
BSはてなの弱分類器
◮ ブックマークした人のカテゴリの偏り
◮ タグの出現頻度
◮ 特定タグ占有率
◮ コメント率
◮ 特定属性 URL へのリンク
◮ キーワードの出現傾向
BSはてなの弱分類器
◮ ブックマークした人のカテゴリの偏り
◮ タグの出現頻度
◮ 特定タグ占有率
◮ コメント率
◮ 特定属性 URL へのリンク
◮ キーワードの出現傾向
ブックマークされてなくても
高精度に判定したい!
Perceptron [’58 Rosenblatt]
特徴
◮ 多次元の入力の重みづけをいい感じにする
◮ 計算がすごく簡単 (実装も簡単)
◮ 教科書に載ってるレベルで枯れている
◮ 近年見直されさまざまな改良が
実装方針
◮ ひとまず単純な実装
◮ キーワードの出現ベクトルが入力
◮ 精度を見つつ改良版を試す
Perceptron [’58 Rosenblatt]
— 原理
学習手続
1. 重みベクトルを w = (0, . . ., 0) で初期化
2. 現在の重みでの判定結果 g
3. 本来の正しい判定結果 a ∈ {1, −1}
4. a · g > 0 なら判定成功 or フィードバック
判定: 重み w と入力 p の内積 (の正負)
◮ w · p
フィードバック
◮ 正しい結果の向きに入力分だけ重みを更新
w := w + ap
Perceptronの簡単な実装
sub weights { shift->{weights} ||= {} }
sub feedback {
my ($self, $ps, $ad) = @_;
$self->weights->{$_} += $ad * $ps->{$_} for keys %$ps;
}
sub learn {
my ($self, $ps, $ad) = @_;
my $g = $self->guess($ps) || 0;
$self->feedback($ps, $ad) unless $g * $ad > 0;
}
sub guess {
my ($self, $ps) = @_;
my $weights = $self->weights || {};
return sum map {
($weights->{$_} || 0) * $ps->{$_};
} keys %$ps;
}
なんと, これですごく精度が出た
細かい知見など細かい知見など細かい知見など細かい知見など細かい知見など細かい知見など細かい知見など
教師データ集めが肝
◮ タグ検索等を駆使して傾向を把握
◮ 大量の URL を人の目で判定
◮ 判定基準のぶれをどう抑えるか
AdaBoost
◮ 元々スパムフィルタのために導入されていた
◮ 単純な実装だが本来の計算と少しだけ違う
◮ 素直に AdaGrad+RDA にしたら精度が低下...orz
Perceptron
◮ 驚くほどシンプルな実装
◮ はてなキーワードの見出し語を使う
→ スラングなどへの対応
◮ 入力キーワードを闇雲に増やすと精度が低下
◮ 特徴語に絞って入力している (たぶんこれが肝)
今後の展望
◮ 判定できる属性の拡充
◮ 画像対応
◮ フィルタリング以外の用途
◮ もう少し大規模に特徴量を扱うしくみ
まとめ
◮ はてなブックマークの実装/知見を利用した
はてな発のアドベリフィケーションシステム
◮ 比較的枯れた教科書的な技術の組み合わせ
◮ AdaBoost
◮ Perceptron
◮ 大規模データを扱ってきた知見を発揮
WE ARE HIRING
◮ アドテク・機械学習エンジニア 絶賛募集中
◮ 東京 / 京都 どちらの勤務でも可

More Related Content

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
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
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
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...
 

『BrandSafe はてな』のアドベリフィケーションのしくみ