Shot prompting

Trabajar con DeepSeek en Python

James Chapman

AI Curriculum Lead, DataCamp

Proporcionar ejemplos

Un robot mira ejemplos

  • Shot prompting
Trabajar con DeepSeek en Python

¿Qué es el shot prompting?

Shot prompting: incluir ejemplos para guiar las respuestas de la IA

$$

  • Zero-shot: sin ejemplos, solo instrucciones
  • One-shot: un ejemplo guía la respuesta
  • Few-shot: varios ejemplos aportan más contexto

Representación de cero a pocos ejemplos

Trabajar con DeepSeek en Python

¿Por qué importa el shot prompting?

$$

✅ Casos de uso del shot prompting:

  • 📑 Clasificación de texto
  • 💬 Análisis de sentimiento
  • 🔍 Extracción de datos
  • ✨ ... y muchos más

Casos de uso del shot prompting

Trabajar con DeepSeek en 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
Trabajar con DeepSeek en 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
Trabajar con DeepSeek en 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
Trabajar con DeepSeek en Python

¡Vamos a practicar!

Trabajar con DeepSeek en Python

Preparing Video For Download...