เริ่มต้นใช้งานเริ่มต้นใช้งานได้ฟรี

Transfer learning ด้วย One-Shot Learning

Transfer learning มีหลายแนวทาง หนึ่งในนั้นคือ one-shot learning ซึ่งเป็นการฝึกโมเดลโดยใช้ตัวอย่างเพียงหนึ่งรายการ

ตั้งค่าตัวอย่าง one-shot learning สำหรับโมเดล

แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร

Python เบื้องต้นสำหรับ LLMs

ดูคอร์ส

คำแนะนำการฝึกหัด

  • เติมตัวอย่าง one-shot learning ให้สมบูรณ์ โดยระบุว่ารีวิวตัวอย่างมี sentiment เป็น 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"])
แก้ไขและรันโค้ด