Transfer learning s one-shot learningem
Transfer learning má mnoho podob – jednou z nich je one-shot learning, při kterém se model trénuje na základě jediného příkladu.
Připrav pro model příklad one-shot learningu.
Toto cvičení je součástí kurzu
Úvod do LLMs v Pythonu
Pokyny k cvičení
- Dokonči příklad one-shot learningu tak, že ukážeš, že ukázková recenze je
Positive.
Interaktivní cvičení na vyzkoušení si v praxi
Vyzkoušejte si toto cvičení dokončením tohoto ukázkového kódu.
# 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"])