ÎncepețiÎncepe gratuit

Transfer learning prin one-shot learning

Transfer learning are mai multe abordări, una dintre ele fiind one-shot learning, în care un model este antrenat folosind un singur exemplu pe care l-a văzut.

Configurează un exemplu de one-shot learning pentru model.

Acest exercițiu face parte din cursul

Introducere în LLM-uri cu Python

Vezi cursul

Instrucțiuni pentru exercițiu

  • Completează exemplul de one-shot learning indicând că recenzia eșantion este Positive.

Exercițiu interactiv practic

Încearcă acest exercițiu completând acest cod de exemplu.

# 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"])
Editează și rulează codul