Introductie tot large language models (LLM’s)

Introductie tot LLM’s in Python

Jasmin Ludolf

Senior Data Science Content Developer, DataCamp

Voorkennis

  • Navigeren op de Hugging Face Hub
  • Deep-learningmodellen

Cartoonbrein dat een boek leest

Introductie tot LLM’s in Python

Introductie tot LLM’s

 

Pictogram van een lamp en brein voor begrip

Introductie tot LLM’s in Python

Introductie tot LLM’s

 

Illustratie van een laptop voor gebruiken

Introductie tot LLM’s in Python

Abstracte illustratie van een large language model

Introductie tot LLM’s in Python

Abstracte illustratie van een large language model met een samenvattenballon

Introductie tot LLM’s in Python

Abstracte illustratie van een large language model met een samenvatten- en genererenballon

Introductie tot LLM’s in Python

Abstracte illustratie van een large language model met een samenvatten-, genereren- en vertaalballon

Introductie tot LLM’s in Python

Abstracte illustratie van een large language model met een samenvatten-, genereren-, vertalen- en Q&A-ballon

LLM-logo’s

Introductie tot LLM’s in Python

LLM’s

 

  • Gebaseerd op deep learning-architecturen

 

  • Meestal transformers

 

  • Grote neurale netwerken met veel parameters en tekstdata

Hugging Face-logo

Introductie tot LLM’s in Python

Hugging Face-modellen gebruiken

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: verwijdert onnodige witruimtes
Introductie tot LLM’s in Python

Modeluitvoer

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
Introductie tot LLM’s in Python

Wat komt er hierna

 

  • Bouwen op bestaande LLM-kennis
  • Nieuwe taken uitvoeren
  • Zien hoe LLM’s zijn gebouwd
  • LLM’s fine-tunen
  • LLM-prestaties evalueren

Leerlijn

Introductie tot LLM’s in Python

Laten we oefenen!

Introductie tot LLM’s in Python

Preparing Video For Download...