ComeçarComece gratuitamente

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.

Este exercício faz parte do curso

Introduction to LLMs in Python

Ver Curso

Instruções de exercício

  • Complete the one-shot learning example by showing the sample review is Positive.

Exercício interativo prático

Experimente este exercício preenchendo este código de exemplo.

# 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"])
Editar e executar código