Shot prompting

การใช้งาน DeepSeek ใน Python

James Chapman

AI Curriculum Lead, DataCamp

การให้ตัวอย่าง

หุ่นยนต์กำลังดูตัวอย่าง

  • Shot prompting
การใช้งาน DeepSeek ใน Python

Shot prompting คืออะไร?

Shot prompting: การใส่ตัวอย่างเพื่อชี้นำการตอบของ AI

$$

  • Zero-shot: ไม่มีตัวอย่าง มีแค่คำสั่ง
  • One-shot: ใช้ตัวอย่างหนึ่งชิ้นชี้นำการตอบ
  • Few-shot: ใช้หลายตัวอย่างเพื่อให้บริบทเพิ่มขึ้น

การแสดงผลจาก zero ถึง few shots

การใช้งาน DeepSeek ใน Python

ทำไม shot prompting จึงสำคัญ?

$$

✅ กรณีการใช้งาน shot prompting:

  • 📑 การจำแนกประเภทข้อความ
  • 💬 การวิเคราะห์ความรู้สึก
  • 🔍 การดึงข้อมูล
  • ✨ ... และอื่น ๆ อีกมากมาย!

กรณีการใช้งาน shot prompting

การใช้งาน DeepSeek ใน Python

Zero-shot prompting

prompt = """Classify sentiment as 1-5 (bad-good) in the following statements:
1. Meal was decent, but I've had better.
2. My food was delayed, but drinks were good.
"""
...
1. 3  
2. 2
การใช้งาน DeepSeek ใน Python

One-shot prompting

prompt = """Classify sentiment as 1-5 (bad-good) in the following statements. Return no
explanations:
1. The service was very slow -> 1
2. Meal was decent, but I've had better. ->
3. My food was delayed, but drinks were good. ->
"""
2. Meal was decent, but I've had better. -> 3  
3. My food was delayed, but drinks were good. -> 2
การใช้งาน DeepSeek ใน Python

Few-shot prompting

prompt = """Classify sentiment as 1-5 (bad-good) in the following statements. Return no
explanations:
1. The service was very slow -> 1
2. The steak was awfully good! -> 5
3. It was ok, no massive complaints. -> 3
4. Meal was decent, but I've had better. ->
5. My food was delayed, but drinks were good. ->
"""
4. Meal was decent, but I've had better. -> 3  
5. My food was delayed, but drinks were good. -> 2
การใช้งาน DeepSeek ใน Python

มาฝึกกันเถอะ!

การใช้งาน DeepSeek ใน Python

Preparing Video For Download...