大規模言語モデル(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 入門

要約・生成・翻訳のバブルを持つ大規模言語モデルの抽象的なイラスト

Pythonで学ぶ LLM 入門

要約・生成・翻訳・Q&Aのバブルを持つ大規模言語モデルの抽象的なイラスト

LLMのロゴ

Pythonで学ぶ LLM 入門

LLM

 

  • ディープラーニングアーキテクチャに基づく

 

  • 最も一般的なのはトランスフォーマー

 

  • 大量のパラメータとテキストデータを持つ大規模なニューラルネットワーク

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をファインチューニングする
  • LLMの性能を評価する

学習パス

Pythonで学ぶ LLM 入門

練習しましょう!

Pythonで学ぶ LLM 入門

Preparing Video For Download...