Soru yanıtlama

Python ile Natural Language Processing (NLP)

Fouad Trad

Machine Learning Engineer

Çıkarımsal SYY

  • Yanıt, pasajdan doğrudan kopyalanır

  "Kütüphane hafta içi 18.00'de kapanır" bağlamını gösteren görsel

Çıkarımsal yanıtı gösteren görsel: "18.00"

Üretimsel SYY

  • Model doğal bir yanıt üretir

  "Kütüphane hafta içi ne zaman kapanır?" sorusunu gösteren görsel

Üretimsel yanıtı gösteren görsel: "Kapanış 18.00'de"

Python ile Natural Language Processing (NLP)

Çıkarımsal SYY

  • Kullanım alanları:
    • Arama motorları
    • Belge getirme sistemleri
    • Okuduğunu anlama uygulamaları
  • Daha doğru, hataya daha az eğilimli

extractive_photo.png

Üretimsel SYY

  • Kullanım alanları:
    • Sohbet botları
    • Sanal asistanlar
    • Müşteri destek botları
  • Hata üretebilir

abstractive_image.png

Python ile Natural Language Processing (NLP)

Çıkarımsal SYY

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 ile Natural Language Processing (NLP)

Üretimsel SYY

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 ile Natural Language Processing (NLP)

Haydi pratik yapalım!

Python ile Natural Language Processing (NLP)

Preparing Video For Download...