Transferlernen mit One-Shot-Learning
Beim Transferlernen gibt es viele Ansätze, einer davon ist das One-Shot-Lernen, bei dem ein Modell anhand eines Beispiels trainiert wird, das es gesehen hat.
Richte ein einmaliges Lernbeispiel für das Modell ein.
Diese Übung ist Teil des Kurses
Einführung in LLMs in Python
Anleitung zur Übung
- Vervollständige das Beispiel für einmaliges Lernen, indem du zeigst, dass die Musterprüfung
Positive
ist.
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"])