Pengantar model bahasa besar (LLM)

Pengantar LLM di Python

Jasmin Ludolf

Senior Data Science Content Developer, DataCamp

Pengetahuan prasyarat

  • Menavigasi Hugging Face Hub
  • Model deep learning

Otak kartun membaca buku

Pengantar LLM di Python

Pengantar LLM

 

Ikon bola lampu dan otak melambangkan pemahaman

Pengantar LLM di Python

Pengantar LLM

 

Ilustrasi laptop melambangkan penggunaan

Pengantar LLM di Python

Ilustrasi abstrak model bahasa besar

Pengantar LLM di Python

Ilustrasi abstrak model bahasa besar dengan gelembung ringkas

Pengantar LLM di Python

Ilustrasi abstrak model bahasa besar dengan gelembung ringkas dan buat

Pengantar LLM di Python

Ilustrasi abstrak model bahasa besar dengan gelembung ringkas, buat, dan terjemahkan

Pengantar LLM di Python

Ilustrasi abstrak model bahasa besar dengan gelembung ringkas, buat, terjemahkan, tanya-jawab

Logo LLM

Pengantar LLM di Python

LLM

 

  • Berbasis arsitektur deep learning

 

  • Paling umum transformer

 

  • Jaringan saraf besar dengan banyak parameter dan data teks

Logo Hugging Face

Pengantar LLM di Python

Menggunakan model 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: hapus spasi berlebih
Pengantar LLM di Python

Keluaran model

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
Pengantar LLM di Python

Selanjutnya

 

  • Bangun dari pengetahuan LLM yang ada
  • Lakukan tugas baru
  • Lihat cara LLM dibangun
  • Fine-tune LLM
  • Evaluasi kinerja LLM

Jalur belajar

Pengantar LLM di Python

Ayo berlatih!

Pengantar LLM di Python

Preparing Video For Download...