डॉक्यूमेंट Q&A

Hugging Face के साथ काम करना

Jacob H. Marquez

Lead Data Engineer

डॉक्यूमेंट क्वेश्चन-आंसरिंग क्या है?

$$

  • डॉक्यूमेंट कंटेंट से सवालों के जवाब देता है
  • एक डॉक्यूमेंट और एक प्रश्न चाहिए
  • सीधे या पैराफ्रेज़्ड उत्तर देता है

$$

Question: "What is the total revenue of Q3?"

एक डॉक्यूमेंट

Hugging Face के साथ काम करना

डॉक्यूमेंट Q&A के उपयोग मामले

लीगल, फाइनेंस और सपोर्ट उपयोग मामले

$$

  • 📑 Legal: कॉन्ट्रैक्ट क्लॉज़ पहचानें

$$

  • 💰 Finance: मुख्य आंकड़े निकालें

$$

  • 🤓 Support: मैनुअल से उत्तर ढूँढें
Hugging Face के साथ काम करना

डॉक्यूमेंट Q&A से HR क्वेरी ऑटोमेट करना

$$

  • 📄 जानकारी US-Employee_Policy.pdf में है

$$

  • 🤖 उत्तर निकालने की सिस्टम बनाइए

$$

  • 🕑 HR का समय और मेहनत बचाएँ

$$

HR टीम पर काम का बोझ

Hugging Face के साथ काम करना

pypdf से टेक्स्ट निकालना

from pypdf import PdfReader


# Load the PDF file reader = PdfReader("US-Employee_Policy.pdf")
# Extract text from all pages document_text = "" for page in reader.pages:
document_text += page.extract_text()
Welcome to the US Employee Policy document...
Hugging Face के साथ काम करना

Q&A पाइपलाइन बनाना

# Load the question-answering pipeline
qa_pipeline = pipeline(
    task="question-answering",
    model="distilbert-base-cased-distilled-squad")


question = "How many volunteer days are offered annually?"
# Get the answer from the QA pipeline result = qa_pipeline(question=question, context=document_text)
print(f"Answer: {result['answer']}")
Answer: 1
Hugging Face के साथ काम करना

सब कुछ साथ में जोड़ना

$$

  • 📄 PDF लोड और पढ़ने के लिए pypdf का PdfReader उपयोग करें
  • 🔎 .pages और .extract_text() से टेक्स्ट निकालकर document_text में रखें
  • 🤔 question-answering पाइपलाइन सेट करें
  • ❓ पाइपलाइन को question और context दें
  • ⏰ क्वेरी ऑटोमेट करने के लिए फंक्शनों में रैप करें

डॉक्यूमेंट Q&A

HR टीम कंपनी संस्कृति बनाती हुई

Hugging Face के साथ काम करना

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

Hugging Face के साथ काम करना

Preparing Video For Download...