प्रश्नोत्तरी

Python में Natural Language Processing (NLP)

Fouad Trad

Machine Learning Engineer

Extractive QA

  • उत्तर सीधे पैसेज से कॉपी किया जाता है

  संदर्भ दिखाने वाली इमेज: "The library closes at 6 PM on weekdays"

एक्स्ट्रैक्टिव उत्तर दिखाने वाली इमेज: "6 PM"

Abstractive QA

  • मॉडल नैचुरल-साउंडिंग उत्तर जनरेट करता है

  प्रश्न दिखाने वाली इमेज: "When does the library close on weekdays?"

एब्स्ट्रैक्टिव उत्तर दिखाने वाली इमेज: "Closure is at 6 PM"

Python में Natural Language Processing (NLP)

Extractive QA

  • उपयोगी कहाँ:
    • सर्च इंजन
    • डॉक्युमेंट रिट्रीवल सिस्टम
    • रीडिंग कॉम्प्रिहेंशन ऐप्स
  • अधिक सटीक, त्रुटियाँ कम

extractive_photo.png

Abstractive QA

  • उपयोगी कहाँ:
    • कॉन्वर्सेशनल एजेंट्स
    • वर्चुअल असिस्टेंट्स
    • कस्टमर सपोर्ट बॉट्स
  • त्रुटियाँ ला सकता है

abstractive_image.png

Python में Natural Language Processing (NLP)

Extractive QA

from transformers import pipeline

qa_pipeline = pipeline(task="question-answering", model="distilbert/distilbert-base-cased-distilled-squad")
context = """The Amazon rainforest is the largest tropical rainforest in the world, covering parts of Brazil, Peru, and Colombia."""
question = "Which countries does the Amazon rainforest cover?"
qa_answer = qa_pipeline(question=question, context=context) print(qa_answer)
{'score': 0.9242347478866577,

'start': 90, 'end': 116,
'answer': 'Brazil, Peru, and Colombia'}
Python में Natural Language Processing (NLP)

Abstractive QA

from transformers import pipeline
qa_pipeline = pipeline(task="text2text-generation",
                       model="fangyuan/hotpotqa_abstractive")

context = """The Amazon rainforest is the largest tropical rainforest in the world, covering parts of Brazil, Peru, and Colombia.""" question = "Which countries does the Amazon rainforest cover?"
input_text = f"question: {question} context: {context}"
result = qa_pipeline(input_text)
print(result)
[{'generated_text': 'The Amazon rainforest covers parts of Brazil, Peru, and Colombia.'}]
Python में Natural Language Processing (NLP)

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

Python में Natural Language Processing (NLP)

Preparing Video For Download...