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
メールの分類をLLMをつかってやってみた
Search
ramo798
May 23, 2024
0
78
メールの分類をLLMをつかってやってみた
https://meguro-lt.connpass.com/event/305703/
ramo798
May 23, 2024
Tweet
Share
More Decks by ramo798
See All by ramo798
APIサーバのレスポンス速度をふわっと把握したかった
ramo798
0
420
Featured
See All Featured
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Building Better People: How to give real-time feedback that sticks.
wjessup
369
20k
Stop Working from a Prison Cell
hatefulcrawdad
271
21k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
130k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
657
61k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
46
7.7k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.7k
Building Adaptive Systems
keathley
44
2.8k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.2k
Fireside Chat
paigeccino
40
3.7k
Transcript
メールの分類を LLMをつかってやってみた ramo
自己紹介 ramo 仕事→ URIHOというサービス開発。 好きなフレームワーク→ remix, sveltekit マイブーム→ cloudflare workers
最近matzさんとツーショット撮りました
URIHOについて 販売企業 URIHOは企業間取引において発生する 売掛金の未払い・倒産に備える保証サービスです。 購入企業
やりたいこと 問い合わせメールの分類を行って よくある質問ページを拡充したい!
やったこと 1600件の問い合わせメールのうち 1000件を手動で分類 ↓ 分類モデルを作成し、残り600件の分類を自動化 内容の傾向の把握
技術的にやったこと LLMのBERTをファインチューニングして 分類モデルを作成しました その結果、少量のデータでもそれなりの精度になった
技術的にやったこと ・「cl-tohoku/bert-base-japanese-v3」というBERTモデ ルを使用 ・Hugging Faceのtransformersライブラリを使用する ・AutoModelForSequenceClassificationというクラスを使 用して分類問題を解けるようにファインチューニング
やったこと tokenizer = AutoTokenizer.from_pretrained("cl-tohoku/bert-base-japanese-v3") encoding = tokenizer(df_email['Content'].tolist(), padding=True, truncation=True, return_tensors="pt",
max_length=256) model = AutoModelForSequenceClassification.from_pretrained("cl-tohoku/bert-base-japanese-v3", num_labels=len(df_email['question_id'].unique())) # 訓練用のデータの準備等(省略) model.train()
結果 分類の種類 「よくある質問ページに書いてあること」 「サービスの説明をしてください」 「広告」 「その他」
結果 分類の種類 「よくある質問ページに書いてあること」 「サービスの説明をしてください」 「広告」 「その他」 → 90%の精度で分類可能に!
結果 分類の種類 「よくある質問ページに書いてあること」 ↓ よくある質問ページの大分類(5択) + それ以外 でタグ付けを行って学習
結果 分類の種類 「よくある質問ページに書いてあること」 ↓ よくある質問ページの大分類(5択) + それ以外 でタグ付けを行って学習 ↓ 約81%の精度
結果 90%の精度で分類可能に!
その他手法 ・Sentence Transformer + lightGBM →55% ・BoW + SVM →37%
・TF-IDF + SVM →40%
まとめ ・LLMを使うと少数のデータでもそれなりの精度がでる ・Hugging Faceでなんでもできる!
以上です。