Học chuyển giao với one-shot learning
Học chuyển giao có nhiều cách tiếp cận, trong đó có one-shot learning, nơi mô hình được huấn luyện chỉ với một ví dụ mà nó đã thấy.
Thiết lập một ví dụ one-shot learning cho mô hình.
Bài tập này là một phần của khóa học
Nhập môn LLMs trong Python
Hướng dẫn bài tập
- Hoàn thiện ví dụ one-shot learning bằng cách cho biết bài đánh giá mẫu là
Positive.
Bài tập tương tác thực hành trực tiếp
Hãy thử làm bài tập này bằng cách hoàn thành đoạn mã mẫu này.
# 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"])