चैट-आधारित जनरेटिव AI मॉडल समझना

Python में Explainable AI

Fouad Trad

Machine Learning Engineer

चैट-आधारित जनरेटिव AI मॉडल

  • टेक्स्ट जनरेट करने के लिए उपयोग होते हैं
  • संदर्भ और ज्ञान के आधार पर भविष्यवाणी करते हैं

 

एक इमेज जिसमें उपयोगकर्ता जनरेटिव AI मॉडल को एक प्रॉम्प्ट भेज रहा है और रिस्पॉन्स पा रहा है।

Python में Explainable AI

चेन-ऑफ-थॉट प्रॉम्प्ट

  • मॉडल को अपना तर्क स्पष्ट बताने के लिए प्रेरित करता है

एक इमेज जो दिखाती है कि चेन-ऑफ-थॉट प्रॉम्प्ट मॉडल से स्टेप-बाय-स्टेप हल माँगता है और आउटपुट में हर स्टेप का कारण होता है।

Python में Explainable AI

चेन-ऑफ-थॉट प्रॉम्प्ट बनाना

prompt = """A shop starts with 20 apples. It sells 5 apples and then receives 8 more. 
How many apples does the shop have now? Show your reasoning step-by-step."""

response = get_response(prompt)
print(response)
To find out how many apples the shop has now, let's follow the transactions step-by-step:

1- The shop begins with 20 apples.
2- The shop sells 5 apples. We subtract this number from the starting quantity: 20 - 5 = 15
3- The shop receives 8 apples. We add this number to the remaining apples: 15 + 8 = 23
So, after these transactions, the shop has 23 apples.
Python में Explainable AI

सेल्फ-कंसिस्टेंसी

जनरेट किए गए उत्तरों पर मॉडल के भरोसे का आकलन करता है

एक इमेज जो दिखाती है कि सेल्फ-कंसिस्टेंसी प्रॉम्प्ट में वही प्रॉम्प्ट मॉडल को कई बार भेजा जाता है और हर बार एक रिस्पॉन्स मिलता है।

Python में Explainable AI

टेक्स्ट क्लासिफिकेशन में सेल्फ-कंसिस्टेंसी

टेक्स्ट क्लासिफिकेशन टास्क के लिए उपयोगी

एक इमेज जिसमें सेल्फ-कंसिस्टेंसी का उदाहरण है: मॉडल को किसी यूज़र रिव्यू को पॉज़िटिव या नेगेटिव वर्गीकृत करना है और मॉडल कई उत्तर देता है।

Python में Explainable AI

टेक्स्ट क्लासिफिकेशन में सेल्फ-कंसिस्टेंसी

टेक्स्ट क्लासिफिकेशन टास्क के लिए उपयोगी

एक इमेज जिसमें सेल्फ-कंसिस्टेंसी का उदाहरण है: मॉडल यूज़र रिव्यू को पॉज़िटिव या नेगेटिव वर्गीकृत करता है और कई उत्तर देता है। कॉन्फिडेंस कुल उत्तरों में हर श्रेणी के अनुपात से निकाला जाता है।

Python में Explainable AI

सेल्फ-कंसिस्टेंसी प्रॉम्प्ट बनाना

prompt = """Classify the following review as positive or negative. 
You should reply with either "positive" or "negative", nothing else.
Review: 'The customer service was great, but the product itself did not meet my expectations.'"""

responses = []
for i in range(5): sentiment = get_response(review)
responses.append(sentiment.lower())
confidence = { 'positive': responses.count('positive') / len(responses), 'negative': responses.count('negative') / len(responses) }
Python में Explainable AI

सेल्फ-कंसिस्टेंसी प्रॉम्प्ट बनाना

print(confidence)
{
    'positive': 0.6,
    'negative': 0.4
}
Python में Explainable AI

अभ्यास करते हैं!

Python में Explainable AI

Preparing Video For Download...