वन-शॉट लर्निंग के साथ ट्रांसफ़र लर्निंग
ट्रांसफ़र लर्निंग के कई तरीके होते हैं. उनमें से एक है वन-शॉट लर्निंग, जहाँ मॉडल को सिर्फ़ एक उदाहरण से प्रशिक्षित किया जाता है जिसे उसने देखा है.
मॉडल के लिए एक वन-शॉट लर्निंग उदाहरण सेट अप करें.
यह अभ्यास पाठ्यक्रम का हिस्सा है
Python में LLMs का परिचय
अभ्यास निर्देश
- सैंपल रिव्यू को
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"])