大規模言語モデル(LLM)入門

Python で学ぶ LLM の入門

Jasmin Ludolf

Senior Data Science Content Developer, DataCamp

前提知識

  • Hugging Face Hubのナビゲーション
  • ディープラーニングモデル

本を読んでいる漫画風の脳

Python で学ぶ LLM の入門

LLM入門

理解を表す電球と脳のアイコン

Python で学ぶ LLM の入門

LLM入門

利用を表すノートパソコンの図解

Python で学ぶ LLM の入門

大規模言語モデルの抽象的なイラスト

Python で学ぶ LLM の入門

要約バブル付きの大規模言語モデルの抽象的なイラスト

Python で学ぶ LLM の入門

要約と生成の吹き出しがある大規模言語モデルの抽象的な図解

Python で学ぶ LLM の入門

要約、生成、翻訳の3つの吹き出しがある大規模言語モデルの抽象的な図解

Python で学ぶ LLM の入門

要約、生成、翻訳、Q&Aの吹き出しがある大規模言語モデルの抽象的な図解

LLMロゴ

Python で学ぶ LLM の入門

LLM

  • ディープラーニングアーキテクチャに基づく
  • 最も一般的なtransformers
  • 多数のパラメータと大量のテキストデータを持つ巨大なニューラルネットワーク

Hugging Faceロゴ

Python で学ぶ LLM の入門

Hugging Faceモデルの利用

from transformers import pipeline


summarizer = pipeline(task="summarization", model="facebook/bart-large-cnn")
text = "Walking amid Gion's Machiya wooden houses is a mesmerizing experience. The beautifully preserved structures exuded an old-world charm that transports visitors back in time, making them feel like they had stepped into a living museum. The glow of lanterns lining the narrow streets add to the enchanting ambiance, making each stroll a memorable journey through Japan's rich cultural history." summary = summarizer(text, max_length=50)
  • clean_up_tokenization_spaces=True: 不要な空白を削除する
Python で学ぶ LLM の入門

ツールの出力

print(summary)
[{'summary_text': "Gion's Machiya
  wooden houses exuded an old-world 
  charm that transports visitors back 
  in time. The glow of lanterns lining 
  the narrow streets add to the 
  enchanting ambiance, making each 
  stroll a memorable journey through 
  Japan's"}]
print(summary[0]["summary_text"])
Gion's Machiya wooden houses exuded an 
old-world charm that transports 
visitors back in time. The glow of 
lanterns lining the narrow streets add 
to the enchanting ambiance, making each 
stroll a memorable journey through 
Japan's
Python で学ぶ LLM の入門

次は

  • 既存のLLMの知識を基盤として発展させる
  • 新しいタスクを実行する
  • LLMの構築方法を確認する
  • LLMをファインチューニング

学習コース

Python で学ぶ LLM の入門

練習しましょう!

Python で学ぶ LLM の入門

Preparing Video For Download...