SlideShare a Scribd company logo
1 of 21
Download to read offline
BERTをブラウザで動かしたい!
―MobileBERTとTensorFlow.js―
本⽥ 志温
@shion_honda
発表内容
• TensorFlow.jsのMobileBERT Q&A モデルの紹介
• デモ
• 応⽤例(プロトタイプ)の紹介
• MobileBERTとは
• TensorFlow.js Q&Aモデル
2
⾃⼰紹介
3
• 本⽥ 志温(ほんだ しおん)
• データサイエンティストっぽい仕事@リクルートライフスタイル
• 3⽉までは東京⼤学⼤学院にてAI創薬の研究
• これまでも[cv/nl]paper.challengeで何度か発表してきました
• ブログ: https://hippocampus-garden.com/
MobileBERT Q&A モデルのデモ
https://muppet.fandom.com/wiki/Bert
4
Bert is Ernie's best friend and roommate on Sesame Street. The pair share the basement apartment at 123 Sesame Street. In
contrast to the practical-joking, extroverted Ernie, Bert is serious, studious, and tries to make sense of his friend's actions.
His own passions include reading Boring Stories, collecting paper clips and bottle caps (especially the rare Figgy Fizz),
consuming oatmeal, and studying pigeons. While Ernie's best companion outside of Bert is Rubber Duckie, Bert has his pet
pigeon, Bernice. True to his detail-oriented, organized mind, Bert is president of the National Association of W Lovers.
Unfortunately for Bert, his nose has come off of his face on a number of occasions. He has a distinctive, bleating laugh.
While Ernie has appeared in many of scenes without Bert, Bert has not been seen without Ernie quite so often. Notable
exceptions include the songs "Doin' the Pigeon," "The Subway," "Bert's Blanket," and "Stick Out Your Hand and Say Hello"
with Rick Moranis, as well as occasional Muppet/Kid scenes, such as discussing emotions with John John.
Some of Bert's memorable moments include riding with Ernie in a plane in Follow That Bird, and interrupting The
Adventures of Elmo in Grouchland whenever it looked like the movie was becoming unsettling.
Bert's extended family includes his identical twin brother salesman Bart, infant nephew Brad, and several unseen relatives,
including his Aunt Matilda, Uncle Bart (who gave Bert his first paper clip), and great-great-grandfather Mountain Mike. The
album Sesame Street Sing-Along! also refers to Bert's Uncle Louie, who lives on a farm.
Bert and Ernie were the only Muppets to appear in the Sesame Street Pilot Episodes, and they also hosted This Way to
Sesame Street, a special sneak preview special promoting Sesame Street.
Passage (289 words)
Question #1
5
Question: Where does Bert live?
Answer #1: 正解
https://muppet.fandom.com/wiki/Bert
6
Bert is Ernie's best friend and roommate on Sesame Street. The pair share the basement apartment at 123 Sesame Street. In
contrast to the practical-joking, extroverted Ernie, Bert is serious, studious, and tries to make sense of his friend's actions.
His own passions include reading Boring Stories, collecting paper clips and bottle caps (especially the rare Figgy Fizz),
consuming oatmeal, and studying pigeons. While Ernie's best companion outside of Bert is Rubber Duckie, Bert has his pet
pigeon, Bernice. True to his detail-oriented, organized mind, Bert is president of the National Association of W Lovers.
Unfortunately for Bert, his nose has come off of his face on a number of occasions. He has a distinctive, bleating laugh.
While Ernie has appeared in many of scenes without Bert, Bert has not been seen without Ernie quite so often. Notable
exceptions include the songs "Doin' the Pigeon," "The Subway," "Bert's Blanket," and "Stick Out Your Hand and Say Hello"
with Rick Moranis, as well as occasional Muppet/Kid scenes, such as discussing emotions with John John.
Some of Bert's memorable moments include riding with Ernie in a plane in Follow That Bird, and interrupting The
Adventures of Elmo in Grouchland whenever it looked like the movie was becoming unsettling.
Bert's extended family includes his identical twin brother salesman Bart, infant nephew Brad, and several unseen relatives,
including his Aunt Matilda, Uncle Bart (who gave Bert his first paper clip), and great-great-grandfather Mountain Mike. The
album Sesame Street Sing-Along! also refers to Bert's Uncle Louie, who lives on a farm.
Bert and Ernie were the only Muppets to appear in the Sesame Street Pilot Episodes, and they also hosted This Way to
Sesame Street, a special sneak preview special promoting Sesame Street.
Answer: 123 Sesame Street
Question #2
7
Question: What does Bert like to collect?
Answer #2: 正解
https://muppet.fandom.com/wiki/Bert
8
Bert is Ernie's best friend and roommate on Sesame Street. The pair share the basement apartment at 123 Sesame Street. In
contrast to the practical-joking, extroverted Ernie, Bert is serious, studious, and tries to make sense of his friend's actions.
His own passions include reading Boring Stories, collecting paper clips and bottle caps (especially the rare Figgy Fizz),
consuming oatmeal, and studying pigeons. While Ernie's best companion outside of Bert is Rubber Duckie, Bert has his pet
pigeon, Bernice. True to his detail-oriented, organized mind, Bert is president of the National Association of W Lovers.
Unfortunately for Bert, his nose has come off of his face on a number of occasions. He has a distinctive, bleating laugh.
While Ernie has appeared in many of scenes without Bert, Bert has not been seen without Ernie quite so often. Notable
exceptions include the songs "Doin' the Pigeon," "The Subway," "Bert's Blanket," and "Stick Out Your Hand and Say Hello"
with Rick Moranis, as well as occasional Muppet/Kid scenes, such as discussing emotions with John John.
Some of Bert's memorable moments include riding with Ernie in a plane in Follow That Bird, and interrupting The
Adventures of Elmo in Grouchland whenever it looked like the movie was becoming unsettling.
Bert's extended family includes his identical twin brother salesman Bart, infant nephew Brad, and several unseen relatives,
including his Aunt Matilda, Uncle Bart (who gave Bert his first paper clip), and great-great-grandfather Mountain Mike. The
album Sesame Street Sing-Along! also refers to Bert's Uncle Louie, who lives on a farm.
Bert and Ernie were the only Muppets to appear in the Sesame Street Pilot Episodes, and they also hosted This Way to
Sesame Street, a special sneak preview special promoting Sesame Street.
Answer: paper clips and bottle caps
Question #3
9
Question: Who is the best friend of Ernie?
Answer #3: 不正解
https://muppet.fandom.com/wiki/Bert
10
Bert is Ernie's best friend and roommate on Sesame Street. The pair share the basement apartment at 123 Sesame Street. In
contrast to the practical-joking, extroverted Ernie, Bert is serious, studious, and tries to make sense of his friend's actions.
His own passions include reading Boring Stories, collecting paper clips and bottle caps (especially the rare Figgy Fizz),
consuming oatmeal, and studying pigeons. While Ernie's best companion outside of Bert is Rubber Duckie, Bert has his pet
pigeon, Bernice. True to his detail-oriented, organized mind, Bert is president of the National Association of W Lovers.
Unfortunately for Bert, his nose has come off of his face on a number of occasions. He has a distinctive, bleating laugh.
While Ernie has appeared in many of scenes without Bert, Bert has not been seen without Ernie quite so often. Notable
exceptions include the songs "Doin' the Pigeon," "The Subway," "Bert's Blanket," and "Stick Out Your Hand and Say Hello"
with Rick Moranis, as well as occasional Muppet/Kid scenes, such as discussing emotions with John John.
Some of Bert's memorable moments include riding with Ernie in a plane in Follow That Bird, and interrupting The
Adventures of Elmo in Grouchland whenever it looked like the movie was becoming unsettling.
Bert's extended family includes his identical twin brother salesman Bart, infant nephew Brad, and several unseen relatives,
including his Aunt Matilda, Uncle Bart (who gave Bert his first paper clip), and great-great-grandfather Mountain Mike. The
album Sesame Street Sing-Along! also refers to Bert's Uncle Louie, who lives on a farm.
Bert and Ernie were the only Muppets to appear in the Sesame Street Pilot Episodes, and they also hosted This Way to
Sesame Street, a special sneak preview special promoting Sesame Street.
Answer: (No Answer) *SQuADにはNo Answerの問題がある
MobileBERT Q&A モデル 実⽤例
11
ブラウザのページ内検索(Ctrl+F)に質問を⼊⼒できる
Chrome拡張機能のプロトタイプ.
Google Developers Japan: ブラウザと Tensorflow.js を使った BERT の活⽤⽅法を考える より.
常に上⼿くいくわけではない
12
https://www.bedbathandbeyond.com/store/product/kitchenaid-reg-5-speed-diamond-blender/3242409
質問 What is the pitcher made of?
正答 BPA-free polycarbonate pitcher
BERT Ice mode pulses at staggered intervals to uniformly crush a pitcher of ice in seconds
MobileBERTとは
13
モバイル端末向けに, 汎⽤性と精度はそのままに
軽量化・⾼速化を⾏ったBERT
ボトルネック型
(アーキテクチャの⼯夫)
Progressive knowledge transfer
(学習⽅法の⼯夫)
→ 汎化性能と各タスクでの精度を保ちつつ, BERT BASEの4倍⾼速
学習⽅法(蒸留)の⼯夫
14
• ⼩さいモデルをスクラッチで訓練してもうまくいかないため,
BERT Largeからの蒸留を採⽤
• Progressive Knowledge Transfer: 下層から順に⼀層ずつ訓練
• 各層の特徴マップと注意マップを近づけていく
• Pre-training Distilation: PKTの後にMLMの出⼒を合わせるような訓
練も⾏う
アーキテクチャの⼯夫
15
BERT Large IB-BERT
(Teacher)
MobileBERT
(Student)
• PKTのために, 教師と⽣徒で各層の⼊出⼒サイズは⼀致させな
ければならない
• 教師は逆ボトルネック型にして, 性能を維持しつつ⼊出⼒サイズ縮⼩
• ⽣徒はボトルネック型にして, ⼊出⼒サイズを保ちつつモデル圧縮
性能評価
16
ハイパラ探索の結果, 以下の設定を採⽤
x0.25
GLUE SQuAD
BERT BASEの4倍⾼速 (367ms)
汎化性能と各タスクの精度も維持 *BERT LARGEには負けている
TensorFlow.jsとは
• ブラウザで機械学習を実⾏するためのJavaScriptライブラリ
• GPUはWebGL経由で使える
• TensorFlowやKerasの学習済みモデルをインポートできる
• React Nativeもサポート
17
TensorFlow.js Q&Aモデルの使い⽅
18
https://github.com/tensorflow/tfjs-models/tree/master/qna
SQuAD 1.1でファインチューニング済みのBERTを呼ぶだけ
おまけ: Q&A以外の学習済みモデル
19
姿勢推定 (PoseNet) 有害テキストの検出
他にも⾳声コマンド認識など
ブラウザで動く機械学習アプリケーションが作れる!
https://www.tensorflow.org/js/models
20
BERTを使ってアプリケーションを
作ってみよう!t
https://muppet.fandom.com/wiki/Bert
参考⽂献など
[1] Zhiqing Sun, Hongkun Yu, Xiaodan Song, Renjie Liu, Yiming Yang, Denny Zhou. “MobileBERT:
a Compact Task-Agnostic BERT for Resource-Limited Devices.” ACL. 2020.
[2] Google Developers Japan: ブラウザと Tensorflow.js を使った BERT の活⽤⽅法を考える
[3] MobileBERT Q&Aモデルのデモ
[4] tfjs-models/qna at master · tensorflow/tfjs-models
[5] Jacob Devlin, Ming-Wei Chang, Kenton Lee, Kristina Toutanova. “BERT: Pre-training of Deep
Bidirectional Transformers for Language Understanding.” NACCL. 2019.
[6] アバター: Ultraman Mebius by sousaguilherme5
21

More Related Content

What's hot

2023-03-23_Spiral.AI
2023-03-23_Spiral.AI2023-03-23_Spiral.AI
2023-03-23_Spiral.AISasakiYuichi1
 
グラフデータ分析 入門編
グラフデータ分析 入門編グラフデータ分析 入門編
グラフデータ分析 入門編順也 山口
 
レコメンドバッチ高速化に向けたSpark/MapReduceの機械学習ライブラリ比較検証
レコメンドバッチ高速化に向けたSpark/MapReduceの機械学習ライブラリ比較検証レコメンドバッチ高速化に向けたSpark/MapReduceの機械学習ライブラリ比較検証
レコメンドバッチ高速化に向けたSpark/MapReduceの機械学習ライブラリ比較検証Recruit Technologies
 
最近のDeep Learning (NLP) 界隈におけるAttention事情
最近のDeep Learning (NLP) 界隈におけるAttention事情最近のDeep Learning (NLP) 界隈におけるAttention事情
最近のDeep Learning (NLP) 界隈におけるAttention事情Yuta Kikuchi
 
Visual Studio CodeでRを使う
Visual Studio CodeでRを使うVisual Studio CodeでRを使う
Visual Studio CodeでRを使うAtsushi Hayakawa
 
[part 2]ナレッジグラフ推論チャレンジ・Tech Live!
[part 2]ナレッジグラフ推論チャレンジ・Tech Live![part 2]ナレッジグラフ推論チャレンジ・Tech Live!
[part 2]ナレッジグラフ推論チャレンジ・Tech Live!KnowledgeGraph
 
【DL輪読会】TrOCR: Transformer-based Optical Character Recognition with Pre-traine...
【DL輪読会】TrOCR: Transformer-based Optical Character Recognition with Pre-traine...【DL輪読会】TrOCR: Transformer-based Optical Character Recognition with Pre-traine...
【DL輪読会】TrOCR: Transformer-based Optical Character Recognition with Pre-traine...Deep Learning JP
 
時系列問題に対するCNNの有用性検証
時系列問題に対するCNNの有用性検証時系列問題に対するCNNの有用性検証
時系列問題に対するCNNの有用性検証Masaharu Kinoshita
 
機械学習応用システムの安全性の研究動向と今後の展望
機械学習応用システムの安全性の研究動向と今後の展望機械学習応用システムの安全性の研究動向と今後の展望
機械学習応用システムの安全性の研究動向と今後の展望Nobukazu Yoshioka
 
機械学習モデルの判断根拠の説明(Ver.2)
機械学習モデルの判断根拠の説明(Ver.2)機械学習モデルの判断根拠の説明(Ver.2)
機械学習モデルの判断根拠の説明(Ver.2)Satoshi Hara
 
画像処理ライブラリ OpenCV で 出来ること・出来ないこと
画像処理ライブラリ OpenCV で 出来ること・出来ないこと画像処理ライブラリ OpenCV で 出来ること・出来ないこと
画像処理ライブラリ OpenCV で 出来ること・出来ないことNorishige Fukushima
 
Unityでお手軽ロボット開発「toio SDK for Unity」最新事例
Unityでお手軽ロボット開発「toio SDK for Unity」最新事例Unityでお手軽ロボット開発「toio SDK for Unity」最新事例
Unityでお手軽ロボット開発「toio SDK for Unity」最新事例UnityTechnologiesJapan002
 
SSII2018TS: 3D物体検出とロボットビジョンへの応用
SSII2018TS: 3D物体検出とロボットビジョンへの応用SSII2018TS: 3D物体検出とロボットビジョンへの応用
SSII2018TS: 3D物体検出とロボットビジョンへの応用SSII
 
オントロジーとは?
オントロジーとは?オントロジーとは?
オントロジーとは?Kouji Kozaki
 
Attentionの基礎からTransformerの入門まで
Attentionの基礎からTransformerの入門までAttentionの基礎からTransformerの入門まで
Attentionの基礎からTransformerの入門までAGIRobots
 
研究室における研究・実装ノウハウの共有
研究室における研究・実装ノウハウの共有研究室における研究・実装ノウハウの共有
研究室における研究・実装ノウハウの共有Naoaki Okazaki
 
言語表現モデルBERTで文章生成してみた
言語表現モデルBERTで文章生成してみた言語表現モデルBERTで文章生成してみた
言語表現モデルBERTで文章生成してみたTakuya Koumura
 
リクルートにおける画像解析事例紹介
リクルートにおける画像解析事例紹介リクルートにおける画像解析事例紹介
リクルートにおける画像解析事例紹介Recruit Technologies
 
【DL輪読会】Llama 2: Open Foundation and Fine-Tuned Chat Models
【DL輪読会】Llama 2: Open Foundation and Fine-Tuned Chat Models【DL輪読会】Llama 2: Open Foundation and Fine-Tuned Chat Models
【DL輪読会】Llama 2: Open Foundation and Fine-Tuned Chat ModelsDeep Learning JP
 
先端技術とメディア表現1 #FTMA15
先端技術とメディア表現1 #FTMA15先端技術とメディア表現1 #FTMA15
先端技術とメディア表現1 #FTMA15Yoichi Ochiai
 

What's hot (20)

2023-03-23_Spiral.AI
2023-03-23_Spiral.AI2023-03-23_Spiral.AI
2023-03-23_Spiral.AI
 
グラフデータ分析 入門編
グラフデータ分析 入門編グラフデータ分析 入門編
グラフデータ分析 入門編
 
レコメンドバッチ高速化に向けたSpark/MapReduceの機械学習ライブラリ比較検証
レコメンドバッチ高速化に向けたSpark/MapReduceの機械学習ライブラリ比較検証レコメンドバッチ高速化に向けたSpark/MapReduceの機械学習ライブラリ比較検証
レコメンドバッチ高速化に向けたSpark/MapReduceの機械学習ライブラリ比較検証
 
最近のDeep Learning (NLP) 界隈におけるAttention事情
最近のDeep Learning (NLP) 界隈におけるAttention事情最近のDeep Learning (NLP) 界隈におけるAttention事情
最近のDeep Learning (NLP) 界隈におけるAttention事情
 
Visual Studio CodeでRを使う
Visual Studio CodeでRを使うVisual Studio CodeでRを使う
Visual Studio CodeでRを使う
 
[part 2]ナレッジグラフ推論チャレンジ・Tech Live!
[part 2]ナレッジグラフ推論チャレンジ・Tech Live![part 2]ナレッジグラフ推論チャレンジ・Tech Live!
[part 2]ナレッジグラフ推論チャレンジ・Tech Live!
 
【DL輪読会】TrOCR: Transformer-based Optical Character Recognition with Pre-traine...
【DL輪読会】TrOCR: Transformer-based Optical Character Recognition with Pre-traine...【DL輪読会】TrOCR: Transformer-based Optical Character Recognition with Pre-traine...
【DL輪読会】TrOCR: Transformer-based Optical Character Recognition with Pre-traine...
 
時系列問題に対するCNNの有用性検証
時系列問題に対するCNNの有用性検証時系列問題に対するCNNの有用性検証
時系列問題に対するCNNの有用性検証
 
機械学習応用システムの安全性の研究動向と今後の展望
機械学習応用システムの安全性の研究動向と今後の展望機械学習応用システムの安全性の研究動向と今後の展望
機械学習応用システムの安全性の研究動向と今後の展望
 
機械学習モデルの判断根拠の説明(Ver.2)
機械学習モデルの判断根拠の説明(Ver.2)機械学習モデルの判断根拠の説明(Ver.2)
機械学習モデルの判断根拠の説明(Ver.2)
 
画像処理ライブラリ OpenCV で 出来ること・出来ないこと
画像処理ライブラリ OpenCV で 出来ること・出来ないこと画像処理ライブラリ OpenCV で 出来ること・出来ないこと
画像処理ライブラリ OpenCV で 出来ること・出来ないこと
 
Unityでお手軽ロボット開発「toio SDK for Unity」最新事例
Unityでお手軽ロボット開発「toio SDK for Unity」最新事例Unityでお手軽ロボット開発「toio SDK for Unity」最新事例
Unityでお手軽ロボット開発「toio SDK for Unity」最新事例
 
SSII2018TS: 3D物体検出とロボットビジョンへの応用
SSII2018TS: 3D物体検出とロボットビジョンへの応用SSII2018TS: 3D物体検出とロボットビジョンへの応用
SSII2018TS: 3D物体検出とロボットビジョンへの応用
 
オントロジーとは?
オントロジーとは?オントロジーとは?
オントロジーとは?
 
Attentionの基礎からTransformerの入門まで
Attentionの基礎からTransformerの入門までAttentionの基礎からTransformerの入門まで
Attentionの基礎からTransformerの入門まで
 
研究室における研究・実装ノウハウの共有
研究室における研究・実装ノウハウの共有研究室における研究・実装ノウハウの共有
研究室における研究・実装ノウハウの共有
 
言語表現モデルBERTで文章生成してみた
言語表現モデルBERTで文章生成してみた言語表現モデルBERTで文章生成してみた
言語表現モデルBERTで文章生成してみた
 
リクルートにおける画像解析事例紹介
リクルートにおける画像解析事例紹介リクルートにおける画像解析事例紹介
リクルートにおける画像解析事例紹介
 
【DL輪読会】Llama 2: Open Foundation and Fine-Tuned Chat Models
【DL輪読会】Llama 2: Open Foundation and Fine-Tuned Chat Models【DL輪読会】Llama 2: Open Foundation and Fine-Tuned Chat Models
【DL輪読会】Llama 2: Open Foundation and Fine-Tuned Chat Models
 
先端技術とメディア表現1 #FTMA15
先端技術とメディア表現1 #FTMA15先端技術とメディア表現1 #FTMA15
先端技術とメディア表現1 #FTMA15
 

More from Shion Honda

Bridging between Vision and Language
Bridging between Vision and LanguageBridging between Vision and Language
Bridging between Vision and LanguageShion Honda
 
Deep Learning Chap. 12: Applications
Deep Learning Chap. 12: ApplicationsDeep Learning Chap. 12: Applications
Deep Learning Chap. 12: ApplicationsShion Honda
 
Deep Learning Chap. 6: Deep Feedforward Networks
Deep Learning Chap. 6: Deep Feedforward NetworksDeep Learning Chap. 6: Deep Feedforward Networks
Deep Learning Chap. 6: Deep Feedforward NetworksShion Honda
 
画像認識 第9章 さらなる話題
画像認識 第9章 さらなる話題画像認識 第9章 さらなる話題
画像認識 第9章 さらなる話題Shion Honda
 
Towards Predicting Molecular Property by Graph Neural Networks
Towards Predicting Molecular Property by Graph Neural NetworksTowards Predicting Molecular Property by Graph Neural Networks
Towards Predicting Molecular Property by Graph Neural NetworksShion Honda
 
画像認識 6.3-6.6 畳込みニューラル ネットワーク
画像認識 6.3-6.6 畳込みニューラルネットワーク画像認識 6.3-6.6 畳込みニューラルネットワーク
画像認識 6.3-6.6 畳込みニューラル ネットワークShion Honda
 
深層学習による自然言語処理 第2章 ニューラルネットの基礎
深層学習による自然言語処理 第2章 ニューラルネットの基礎深層学習による自然言語処理 第2章 ニューラルネットの基礎
深層学習による自然言語処理 第2章 ニューラルネットの基礎Shion Honda
 
BERT: Pre-training of Deep Bidirectional Transformers for Language Understand...
BERT: Pre-training of Deep Bidirectional Transformers for Language Understand...BERT: Pre-training of Deep Bidirectional Transformers for Language Understand...
BERT: Pre-training of Deep Bidirectional Transformers for Language Understand...Shion Honda
 
IaGo: an Othello AI inspired by AlphaGo
IaGo: an Othello AI inspired by AlphaGoIaGo: an Othello AI inspired by AlphaGo
IaGo: an Othello AI inspired by AlphaGoShion Honda
 
Planning chemical syntheses with deep neural networks and symbolic AI
Planning chemical syntheses with deep neural networks and symbolic AIPlanning chemical syntheses with deep neural networks and symbolic AI
Planning chemical syntheses with deep neural networks and symbolic AIShion Honda
 

More from Shion Honda (11)

Bridging between Vision and Language
Bridging between Vision and LanguageBridging between Vision and Language
Bridging between Vision and Language
 
Graph U-Nets
Graph U-NetsGraph U-Nets
Graph U-Nets
 
Deep Learning Chap. 12: Applications
Deep Learning Chap. 12: ApplicationsDeep Learning Chap. 12: Applications
Deep Learning Chap. 12: Applications
 
Deep Learning Chap. 6: Deep Feedforward Networks
Deep Learning Chap. 6: Deep Feedforward NetworksDeep Learning Chap. 6: Deep Feedforward Networks
Deep Learning Chap. 6: Deep Feedforward Networks
 
画像認識 第9章 さらなる話題
画像認識 第9章 さらなる話題画像認識 第9章 さらなる話題
画像認識 第9章 さらなる話題
 
Towards Predicting Molecular Property by Graph Neural Networks
Towards Predicting Molecular Property by Graph Neural NetworksTowards Predicting Molecular Property by Graph Neural Networks
Towards Predicting Molecular Property by Graph Neural Networks
 
画像認識 6.3-6.6 畳込みニューラル ネットワーク
画像認識 6.3-6.6 畳込みニューラルネットワーク画像認識 6.3-6.6 畳込みニューラルネットワーク
画像認識 6.3-6.6 畳込みニューラル ネットワーク
 
深層学習による自然言語処理 第2章 ニューラルネットの基礎
深層学習による自然言語処理 第2章 ニューラルネットの基礎深層学習による自然言語処理 第2章 ニューラルネットの基礎
深層学習による自然言語処理 第2章 ニューラルネットの基礎
 
BERT: Pre-training of Deep Bidirectional Transformers for Language Understand...
BERT: Pre-training of Deep Bidirectional Transformers for Language Understand...BERT: Pre-training of Deep Bidirectional Transformers for Language Understand...
BERT: Pre-training of Deep Bidirectional Transformers for Language Understand...
 
IaGo: an Othello AI inspired by AlphaGo
IaGo: an Othello AI inspired by AlphaGoIaGo: an Othello AI inspired by AlphaGo
IaGo: an Othello AI inspired by AlphaGo
 
Planning chemical syntheses with deep neural networks and symbolic AI
Planning chemical syntheses with deep neural networks and symbolic AIPlanning chemical syntheses with deep neural networks and symbolic AI
Planning chemical syntheses with deep neural networks and symbolic AI
 

Recently uploaded

Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 

Recently uploaded (20)

Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 

BERTをブラウザで動かしたい! ―MobileBERTとTensorFlow.js―

  • 2. 発表内容 • TensorFlow.jsのMobileBERT Q&A モデルの紹介 • デモ • 応⽤例(プロトタイプ)の紹介 • MobileBERTとは • TensorFlow.js Q&Aモデル 2
  • 3. ⾃⼰紹介 3 • 本⽥ 志温(ほんだ しおん) • データサイエンティストっぽい仕事@リクルートライフスタイル • 3⽉までは東京⼤学⼤学院にてAI創薬の研究 • これまでも[cv/nl]paper.challengeで何度か発表してきました • ブログ: https://hippocampus-garden.com/
  • 4. MobileBERT Q&A モデルのデモ https://muppet.fandom.com/wiki/Bert 4 Bert is Ernie's best friend and roommate on Sesame Street. The pair share the basement apartment at 123 Sesame Street. In contrast to the practical-joking, extroverted Ernie, Bert is serious, studious, and tries to make sense of his friend's actions. His own passions include reading Boring Stories, collecting paper clips and bottle caps (especially the rare Figgy Fizz), consuming oatmeal, and studying pigeons. While Ernie's best companion outside of Bert is Rubber Duckie, Bert has his pet pigeon, Bernice. True to his detail-oriented, organized mind, Bert is president of the National Association of W Lovers. Unfortunately for Bert, his nose has come off of his face on a number of occasions. He has a distinctive, bleating laugh. While Ernie has appeared in many of scenes without Bert, Bert has not been seen without Ernie quite so often. Notable exceptions include the songs "Doin' the Pigeon," "The Subway," "Bert's Blanket," and "Stick Out Your Hand and Say Hello" with Rick Moranis, as well as occasional Muppet/Kid scenes, such as discussing emotions with John John. Some of Bert's memorable moments include riding with Ernie in a plane in Follow That Bird, and interrupting The Adventures of Elmo in Grouchland whenever it looked like the movie was becoming unsettling. Bert's extended family includes his identical twin brother salesman Bart, infant nephew Brad, and several unseen relatives, including his Aunt Matilda, Uncle Bart (who gave Bert his first paper clip), and great-great-grandfather Mountain Mike. The album Sesame Street Sing-Along! also refers to Bert's Uncle Louie, who lives on a farm. Bert and Ernie were the only Muppets to appear in the Sesame Street Pilot Episodes, and they also hosted This Way to Sesame Street, a special sneak preview special promoting Sesame Street. Passage (289 words)
  • 6. Answer #1: 正解 https://muppet.fandom.com/wiki/Bert 6 Bert is Ernie's best friend and roommate on Sesame Street. The pair share the basement apartment at 123 Sesame Street. In contrast to the practical-joking, extroverted Ernie, Bert is serious, studious, and tries to make sense of his friend's actions. His own passions include reading Boring Stories, collecting paper clips and bottle caps (especially the rare Figgy Fizz), consuming oatmeal, and studying pigeons. While Ernie's best companion outside of Bert is Rubber Duckie, Bert has his pet pigeon, Bernice. True to his detail-oriented, organized mind, Bert is president of the National Association of W Lovers. Unfortunately for Bert, his nose has come off of his face on a number of occasions. He has a distinctive, bleating laugh. While Ernie has appeared in many of scenes without Bert, Bert has not been seen without Ernie quite so often. Notable exceptions include the songs "Doin' the Pigeon," "The Subway," "Bert's Blanket," and "Stick Out Your Hand and Say Hello" with Rick Moranis, as well as occasional Muppet/Kid scenes, such as discussing emotions with John John. Some of Bert's memorable moments include riding with Ernie in a plane in Follow That Bird, and interrupting The Adventures of Elmo in Grouchland whenever it looked like the movie was becoming unsettling. Bert's extended family includes his identical twin brother salesman Bart, infant nephew Brad, and several unseen relatives, including his Aunt Matilda, Uncle Bart (who gave Bert his first paper clip), and great-great-grandfather Mountain Mike. The album Sesame Street Sing-Along! also refers to Bert's Uncle Louie, who lives on a farm. Bert and Ernie were the only Muppets to appear in the Sesame Street Pilot Episodes, and they also hosted This Way to Sesame Street, a special sneak preview special promoting Sesame Street. Answer: 123 Sesame Street
  • 7. Question #2 7 Question: What does Bert like to collect?
  • 8. Answer #2: 正解 https://muppet.fandom.com/wiki/Bert 8 Bert is Ernie's best friend and roommate on Sesame Street. The pair share the basement apartment at 123 Sesame Street. In contrast to the practical-joking, extroverted Ernie, Bert is serious, studious, and tries to make sense of his friend's actions. His own passions include reading Boring Stories, collecting paper clips and bottle caps (especially the rare Figgy Fizz), consuming oatmeal, and studying pigeons. While Ernie's best companion outside of Bert is Rubber Duckie, Bert has his pet pigeon, Bernice. True to his detail-oriented, organized mind, Bert is president of the National Association of W Lovers. Unfortunately for Bert, his nose has come off of his face on a number of occasions. He has a distinctive, bleating laugh. While Ernie has appeared in many of scenes without Bert, Bert has not been seen without Ernie quite so often. Notable exceptions include the songs "Doin' the Pigeon," "The Subway," "Bert's Blanket," and "Stick Out Your Hand and Say Hello" with Rick Moranis, as well as occasional Muppet/Kid scenes, such as discussing emotions with John John. Some of Bert's memorable moments include riding with Ernie in a plane in Follow That Bird, and interrupting The Adventures of Elmo in Grouchland whenever it looked like the movie was becoming unsettling. Bert's extended family includes his identical twin brother salesman Bart, infant nephew Brad, and several unseen relatives, including his Aunt Matilda, Uncle Bart (who gave Bert his first paper clip), and great-great-grandfather Mountain Mike. The album Sesame Street Sing-Along! also refers to Bert's Uncle Louie, who lives on a farm. Bert and Ernie were the only Muppets to appear in the Sesame Street Pilot Episodes, and they also hosted This Way to Sesame Street, a special sneak preview special promoting Sesame Street. Answer: paper clips and bottle caps
  • 9. Question #3 9 Question: Who is the best friend of Ernie?
  • 10. Answer #3: 不正解 https://muppet.fandom.com/wiki/Bert 10 Bert is Ernie's best friend and roommate on Sesame Street. The pair share the basement apartment at 123 Sesame Street. In contrast to the practical-joking, extroverted Ernie, Bert is serious, studious, and tries to make sense of his friend's actions. His own passions include reading Boring Stories, collecting paper clips and bottle caps (especially the rare Figgy Fizz), consuming oatmeal, and studying pigeons. While Ernie's best companion outside of Bert is Rubber Duckie, Bert has his pet pigeon, Bernice. True to his detail-oriented, organized mind, Bert is president of the National Association of W Lovers. Unfortunately for Bert, his nose has come off of his face on a number of occasions. He has a distinctive, bleating laugh. While Ernie has appeared in many of scenes without Bert, Bert has not been seen without Ernie quite so often. Notable exceptions include the songs "Doin' the Pigeon," "The Subway," "Bert's Blanket," and "Stick Out Your Hand and Say Hello" with Rick Moranis, as well as occasional Muppet/Kid scenes, such as discussing emotions with John John. Some of Bert's memorable moments include riding with Ernie in a plane in Follow That Bird, and interrupting The Adventures of Elmo in Grouchland whenever it looked like the movie was becoming unsettling. Bert's extended family includes his identical twin brother salesman Bart, infant nephew Brad, and several unseen relatives, including his Aunt Matilda, Uncle Bart (who gave Bert his first paper clip), and great-great-grandfather Mountain Mike. The album Sesame Street Sing-Along! also refers to Bert's Uncle Louie, who lives on a farm. Bert and Ernie were the only Muppets to appear in the Sesame Street Pilot Episodes, and they also hosted This Way to Sesame Street, a special sneak preview special promoting Sesame Street. Answer: (No Answer) *SQuADにはNo Answerの問題がある
  • 11. MobileBERT Q&A モデル 実⽤例 11 ブラウザのページ内検索(Ctrl+F)に質問を⼊⼒できる Chrome拡張機能のプロトタイプ. Google Developers Japan: ブラウザと Tensorflow.js を使った BERT の活⽤⽅法を考える より.
  • 12. 常に上⼿くいくわけではない 12 https://www.bedbathandbeyond.com/store/product/kitchenaid-reg-5-speed-diamond-blender/3242409 質問 What is the pitcher made of? 正答 BPA-free polycarbonate pitcher BERT Ice mode pulses at staggered intervals to uniformly crush a pitcher of ice in seconds
  • 14. 学習⽅法(蒸留)の⼯夫 14 • ⼩さいモデルをスクラッチで訓練してもうまくいかないため, BERT Largeからの蒸留を採⽤ • Progressive Knowledge Transfer: 下層から順に⼀層ずつ訓練 • 各層の特徴マップと注意マップを近づけていく • Pre-training Distilation: PKTの後にMLMの出⼒を合わせるような訓 練も⾏う
  • 15. アーキテクチャの⼯夫 15 BERT Large IB-BERT (Teacher) MobileBERT (Student) • PKTのために, 教師と⽣徒で各層の⼊出⼒サイズは⼀致させな ければならない • 教師は逆ボトルネック型にして, 性能を維持しつつ⼊出⼒サイズ縮⼩ • ⽣徒はボトルネック型にして, ⼊出⼒サイズを保ちつつモデル圧縮
  • 16. 性能評価 16 ハイパラ探索の結果, 以下の設定を採⽤ x0.25 GLUE SQuAD BERT BASEの4倍⾼速 (367ms) 汎化性能と各タスクの精度も維持 *BERT LARGEには負けている
  • 17. TensorFlow.jsとは • ブラウザで機械学習を実⾏するためのJavaScriptライブラリ • GPUはWebGL経由で使える • TensorFlowやKerasの学習済みモデルをインポートできる • React Nativeもサポート 17
  • 19. おまけ: Q&A以外の学習済みモデル 19 姿勢推定 (PoseNet) 有害テキストの検出 他にも⾳声コマンド認識など ブラウザで動く機械学習アプリケーションが作れる! https://www.tensorflow.org/js/models
  • 21. 参考⽂献など [1] Zhiqing Sun, Hongkun Yu, Xiaodan Song, Renjie Liu, Yiming Yang, Denny Zhou. “MobileBERT: a Compact Task-Agnostic BERT for Resource-Limited Devices.” ACL. 2020. [2] Google Developers Japan: ブラウザと Tensorflow.js を使った BERT の活⽤⽅法を考える [3] MobileBERT Q&Aモデルのデモ [4] tfjs-models/qna at master · tensorflow/tfjs-models [5] Jacob Devlin, Ming-Wei Chang, Kenton Lee, Kristina Toutanova. “BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding.” NACCL. 2019. [6] アバター: Ultraman Mebius by sousaguilherme5 21