One-shot-Prompting: Reicht das schon?
Wie du gesehen hast, ist in deinem ersten Prompt noch Luft nach oben. Versuche, ein Beispiel Love these! = 5 hinzuzufügen, und setze = nach jede Bewertung, um eine einheitlichere Formatierung und genauere Zahlen zu erhalten.
Diese Übung ist Teil des Kurses
Arbeiten mit DeepSeek in Python
Anleitung zur Übung
- Füge das Beispiel
Love these! = 5an den Anfang des Prompts ein und setze=nach jede Bewertung im Prompt, um anzugeben, wie das Ergebnis formatiert werden soll.
Interaktive Übung
Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.
client = OpenAI(api_key="", base_url="https://api.together.xyz/v1")
# Add the example to the prompt
prompt = """Classify sentiment as 1-5 (negative to positive). Return no explanations:
1. ____
2. Unbelievably good! ____
3. Shoes fell apart on the second use. ____
4. The shoes look nice, but they aren't very comfortable. ____
5. Can't wait to show them off! ____"""
response = client.chat.completions.create(model="deepseek-ai/DeepSeek-V3", messages=[{"role": "user", "content": prompt}], max_tokens=150)
print(response.choices[0].message.content)