Transfer learning with one-shot learning
Transfer learning has many approaches, one of them being one-shot learning, where a model is trained using one example it has seen.
Set up a one-shot learning example for the model.
Deze oefening maakt deel uit van de cursus
Introduction to LLMs in Python
Oefeninstructies
- Complete the one-shot learning example by showing the sample review is
Positive.
Praktische interactieve oefening
Probeer deze oefening eens door deze voorbeeldcode in te vullen.
# 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"])