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
感情に反応するSlack bot
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Satoshi SAKAO
March 21, 2018
Programming
330
1
Share
感情に反応するSlack bot
2018-03-21 ゆるゆるIT勉強会 feat.Reedex Vol.2 で発表したスライドです.
Satoshi SAKAO
March 21, 2018
More Decks by Satoshi SAKAO
See All by Satoshi SAKAO
Testcontainers/2024-11-20-llt32
ottijp
0
93
Pkl/2024-04-17-llt31
ottijp
0
130
JavaScriptのデバッグ/2023-09-04-llt30
ottijp
0
190
CDK for TerraformでAzureリソースをデプロイする/2023-05-15-llt29
ottijp
1
330
TWELITEへの誘い/2022-12-27-llt28
ottijp
0
190
ビルドツールBazelを触ってみた/2022-09-28-llt27
ottijp
0
220
HashiCorp Vaultを使ったシークレットのセキュアな一元管理 〜Ansibleを添えて〜/2022-07-12-llt26
ottijp
0
180
AWSインフラのデプロイをCDKでカイゼンする/2022-03-23-llt25
ottijp
0
120
Amazon Timestreamでデータ補間/2021-12-27-llt24
ottijp
0
120
Other Decks in Programming
See All in Programming
Modding RubyKaigi for Myself
yui_knk
0
880
Old Dog, New Tricks: The Java 25 Reinvention - JNation
bazlur_rahman
0
140
運用エージェントは "作る" から "育てる" へ - 記憶と自己進化の3層設計パターン / self-evolving-agents-three-layer-agent-design
gawa
12
3.4k
dRuby over BLE
makicamel
2
300
脅威をエンジニアリングの糧にして――現場編 / Turning Threats into Engineering Fuel — Field Edition
nrslib
0
240
キャリア迷子上等 ─ "ない道"は自分で作ればいい
16bitidol
2
210
ReactとSvelteのその先、Ripple-TS / Beyond React and Svelte: Ripple-TS
ssssota
3
2k
LLM本来の能力を解き放つサンドボックス技術とAI民主化への適用
yukukotani
3
2.3k
Why Laravel apps break—Mastering the fundamentals to keep them maintainable
kentaroutakeda
1
330
「AIで開発し、AIを届ける」をEvalでつなぐ 〜AIネイティブに始めるプロダクト開発の実践〜 / Connecting "Develop with AI, deliver AI" with Eval
rkaga
4
1.8k
関係性から理解する"同一性"の型用語たち
pvcresin
2
630
JavaDoc 再入門
nagise
0
260
Featured
See All Featured
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
380
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
230
ラッコキーワード サービス紹介資料
rakko
1
3.5M
The untapped power of vector embeddings
frankvandijk
2
1.7k
Agile that works and the tools we love
rasmusluckow
331
21k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.8k
Typedesign – Prime Four
hannesfritz
42
3.1k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
210
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.2k
A Soul's Torment
seathinner
6
2.9k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
210
The Illustrated Children's Guide to Kubernetes
chrisshort
51
52k
Transcript
感情に反応するSlack bot ゆるゆるIT勉強会 feat.Reedex Vol.2 2018/03/21 (Wed) Satoshi SAKAO (@ottijp)
1
Who 2 @ottijp Satoshi SAKAO • インフォコム株式会社 • オープンイノベーションセンター •
アプリケーションエンジニア • iOS / Swift / JS(ES6) / Node.js / IoT • ネコ / テニス
3 Google Cloud Platform
4 Firebase Cloud Functions Cloud Speech API Compute Engine App
Engine Cloud Storage Cloud SQL Cloud Load Balancing BigQuery Cloud Pub/Sub Cloud Machine Learning Engine Cloud Translation API Cloud Vision API Logging Debugger Cloud Console Container Registry Cloud IAM Kubernates Engine Cloud CDN Cloud DNS Genomics Cloud IoT Core Cloud Natural Language API
5 Firebase Cloud Functions Cloud Speech API Compute Engine App
Engine Cloud Storage Cloud SQL Cloud Load Balancing BigQuery Cloud Pub/Sub Cloud Machine Learning Engine Cloud Translation API Cloud Vision API Logging Debugger Cloud Console Container Registry Cloud IAM Kubernates Engine Cloud CDN Cloud DNS Genomics Cloud IoT Core Cloud Natural Language API
6 GCPの機械学習サービスのひとつ テキストを分析して情報を抽出する その中の感情分析機能を使った 投稿されたメッセージの感情に反応するSlack botを作ってみた Cloud Natural Language API
7 Cloud Natural Language API 構文解析 感情分析 コンテンツ分類 エンティティ感情分析 エンティティ認識
ポジティブ ニュートラル ネガティブ
感情分析 • Score • 感情(ネガティブ~ポジティブ)を表す • -1.0 〜 +1.0 の値
• Magnitude • 感情の強度を表す • 0.0 〜 ∞ の値 • テキスト全体・文単位それぞれで算出 8
感情分析(ポジティブな例) 9
感情分析(ネガティブな例) 10
botの構成 11 Cloud Natural Language API Cloud Functions Slack …
Outgoing Webhook ポイント •Cloud FunctionsのHTTPトリガファンクション •Outgoing Webhookの応答としてメッセージを返す HTTP Response
botの動作例 12 Slackに投稿されたメッセージを見て, ネガティブな場合に警告してくれる
テキストデータ以外からの変換 13 Cloud Vision API Cloud Speech API Cloud Natural
Language API 紙文書 音声 感情 テキストデータ
Cloud Natural Language APIのお試し利用 14 https://cloud.google.com/natural-language
$ exit 15
Appendix 16
17 Cloud Functions Slack トークン,ユーザID … •トークンとユーザIDによるSlackリクエストの検証 •環境変数はRuntime Configを使用 HTTP
Response Cloud Deployment Manager (Runtime Config)
Article 18 https://qiita.com/ottijp/items/bdabe443c5273874839d
対応言語 • 英語 • スペイン語 • 日本語 • 中国語(簡体字および繁体字) •
フランス語 • ドイツ語 • イタリア語 • 韓国語 • ポルトガル語 19
料金 20
制限 21 ※ リクエスト数の制限に注意
感情分析(ニュートラルな例1) 22
感情分析(ニュートラルな例2) 23
感情分析 • ポジティブ・ネガティブ両方の表現が混在するテキスト では全体的なScoreが0付近になることがある • Magnitudeを見ることで,平均的にニュートラルなの か,ポジティブとネガティブが打ち消してニュートラル なのか判断できる 24