Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
AI彼女の感情制御を頑張る話
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
kokushin
June 26, 2023
Programming
930
3
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
AI彼女の感情制御を頑張る話
【LT大会】AI捻じ伏せプロンプト選手権 〜言うこと聞いてよLLM2023〜
https://connpass.com/event/285636/
kokushin
June 26, 2023
More Decks by kokushin
See All by kokushin
趣味全開のAITuber開発
kokushin
0
1k
AI彼女とペアプロする話
kokushin
2
600
window.matchMediaの話
kokushin
1
190
サイト制作における、より効果的な演出テクニックとは?
kokushin
1
140
Other Decks in Programming
See All in Programming
Java 27新機能 / Java 27 new features
kishida
2
220
UnityでSystem.Net.WebSocketsなWebSocketサーバが動かないのでUnity Monoのコードを覗いてみた / about implementing websocket server with unity mono
drumath2237
1
580
Domain-Driven Transformation
hschwentner
2
2.3k
動作中のプログラムの中身をリアルタイムに覗く / Realtime Debugger for CSharp with Roslyn
prota
1
1.8k
外から家のPCの電源入れたい!をPHPで解決する
kawashimo0
1
130
CodeRabbitの効果検証と過ごしてみた3ヶ月
armondando
0
210
カツオ、ご期待ください
suneo3476
0
160
GemmaをJevのように使ってみる / Use Gemma like Jev
kishida
5
760
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
540
Vue Fes Japan の “作る側”に関わってみて
naokihaba
0
140
パズルゲームの作り方 / how to make puzzle games
kaityo256
PRO
2
280
Everything will be SERVERLESS — 信じて運用した10年の経験値 / Everything Will be Serverless — Lessons Learned from 10 Years of Operational Experience
seike460
PRO
1
960
Featured
See All Featured
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
740
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.6k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.7k
SEO for Brand Visibility & Recognition
aleyda
0
4.8k
Utilizing Notion as your number one productivity tool
mfonobong
4
610
[RailsConf 2023] Rails as a piece of cake
palkan
59
7.1k
Documentation Writing (for coders)
carmenintech
77
5.6k
First, design no harm
axbom
PRO
2
1.3k
Into the Great Unknown - MozCon
thekraken
41
2.8k
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
68
58k
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
700
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.6k
Transcript
AI彼女の感情制御を頑張る話 @kokushing AI捻じ伏せプロンプト選手権 〜言うこと聞いてよLLM2023〜
自己紹介 Yusuke Ishiguro (こくしん) 株式会社メイクリー Co-Founder 得意: Webフロントエンド領域 趣味: 一人ハッカソン
最近はAIイラスト, 合成音声技術を研究中 Twitter: @kokushing
AI彼女について
ChatGPT×Live2Dを用いたブラウザで動く対話型アプリ Next.js+Vercelで実装 PWA対応 https://ai-girl.app/
一つ大きな問題が...
None
返答と感情が一致していない😭 ※現状、ランダムでモーションを再生しているため
このままだとUXが良くないため、感情の制御を行う どう実装するか? Natural Language API や kuromoji.js などを用いてネガポジ判定を行う? でも料金/実装コストがかかりそうだし、レスポンス速度が落ちそう...
ChatGPTに感情を出力してもらおう!
JSON形式で返却するように指定してみる { role: "system", content: ` ... キャラ設定 ... また、セリフの感情を判断して、ポジティブなら
1、ネガティブなら-1を 下記のJSONフォーマットで出力してください { "emotion": "" } ` }
None
None
なんかいけそう?と思ったが... • JSON形式で返してくれない (よく見たらオブジェクト...) • 指定したプロパティや値で返してくれない • そもそもメッセージだけでJSONを返してくれない
どうしよ〜🤔と悩んでいた頃...
Function calling 爆誕!
Function calling とは? • ユーザが入力した内容に応じて、任意の関数を実行できる機能 → 返答に関数呼び出しが必要とGPTが判断した場合に実行される → 外部APIとの連携処理などを簡単に組み込める •
サードパーティ製に頼らず、OpenAI純正のAPIとして実装できる • 現状 gpt-3.5-turbo-0613 及び gpt-4-0613 モデルでのみ利用可能
簡単な図解 「明日の天気教えて」 (アカン...これはAPIで取得せな...) 「明日は晴れです」 「晴れやで」 「やったぜ」 GPT 天気API ユーザ Function
calling !!
Function calling 使って AI彼女の返答と感情を JSON形式で取得してみる
Function callingでJSON形式の結果を得るには ポイントは2つ 1. createChatCompletion の function_call に関数名を直接指定する → デフォルトは
"auto" (GPTが関数呼び出しを判断する) → 直接関数名を指定することで、必ず呼び出すことができる function_call: { name: "getMessageAndEmotion" } 2. GPTがFunction callingを行うと function_call オブジェクトをJSON形式(string)で 取得できるため、JSON.parseしてそのまま返答として利用する
関数はこんな感じ
関数が呼ばれた結果 ※ createChatCompletion のレスポンス内容
クライアント側でのレスポンス結果 ※ emotion: 1 は「喜」の感情
JSON形式で取得できた👏
他の感情も問題なさそう
あとはLive2Dと連携すれば...
None
素敵な笑顔が見れました!
Thank You 🙏 ご清聴ありがとうございました。 メイクリーではAI×サブカルチャー領域での お仕事を募集しております! ご相談は @kokushing まで DMお待ちしてます!