ПочатиПочніть безкоштовно

Трансферне навчання з one-shot learning

Трансферне навчання має багато підходів, один із них — one-shot learning, коли модель навчається на одному прикладі, який вона бачила.

Налаштуйте приклад one-shot learning для моделі.

Ця вправа є частиною курсу

Вступ до LLM у Python

Переглянути курс

Інструкції до вправи

  • Завершіть приклад one-shot learning, показавши, що зразок відгуку — Positive.

Інтерактивна практична вправа

Спробуйте виконати цю вправу, доповнивши цей зразок коду.

# 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"])
Редагувати та запускати код