Transfer Learning mit One-Shot-Learning
Transfer Learning hat viele Ansätze, einer davon ist das One-Shot-Learning, bei dem ein Modell anhand eines einzigen ihm bereitgestellten Beispiels trainiert wird.
Richte ein One-Shot-Lernbeispiel für das Modell ein.
Diese Übung ist Teil des Kurses
Einführung in LLMs mit Python
Anleitung zur Übung
- Schließe das One-Shot-Lernbeispiel ab, indem du zeigst, dass die Beispielbewertung
Positivelautet.
Interaktive Übung
Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.
# Include an example in the input ext
input_text = """
Text: "The dinner we had was great and the service too."
Classify the sentiment of this sentence as either positive or negative.
Example:
Text: "The food was delicious"
____
Text: "The dinner we had was great and the service too."
Sentiment:
"""
# Apply the example to the model
result = model(____, max_length=100)
print(result[0]["label"])