تشغيل مسار ضمان الجودة
استخرج الإجابات من مقطع نصي
تشغيل مسار ضمان الجودة درس مجاني في NLP Academy على CoddyKit. هذا هو الدرس 2 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في NLP Academy، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة NLP Academy 4 دروس في المجموع.
بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.
What a Pipeline Gives You
A Hugging Face pipeline wraps a model and tokenizer into one easy call. You hand it a question and context, it hands back an answer. 🚀
Import the Helper
Everything starts with one import. The pipeline function from the transformers library builds the whole QA stack for you.
from transformers import pipelineCreate a QA Pipeline
Pass the task name question-answering to pipeline. With no model named, it downloads a sensible default for you.
qa = pipeline("question-answering")Give It a Context
The pipeline needs a context: the passage that contains the answer. Think of it as the text the model is allowed to read.
context = "The Eiffel Tower is located in Paris and was completed in 1889."Ask Your Question
Now call the pipeline with both a question and the context. It scans the passage and returns the best matching span.
result = qa(question="Where is the Eiffel Tower?", context=context)Read the Result
The result is a dictionary. The answer text lives under the answer key, ready to print or store.
print(result["answer"]) # ParisThe Confidence Score
Each result also carries a score between 0 and 1. Higher means the model is more sure about its chosen span.
print(result["score"]) # e.g. 0.98Start and End Positions
The result includes start and end character indexes. They tell you exactly where in the context the answer was found.
print(result["start"], result["end"])Choosing a Model
You can pin a specific model by name. A popular small QA model is distilbert fine-tuned on the SQuAD dataset.
qa = pipeline("question-answering",
model="distilbert-base-cased-distilled-squad")Reuse the Same Context
One context can answer many questions. Build the pipeline once, then call it repeatedly with new questions on the same passage.
It Only Reads the Context
Remember: this extractive pipeline answers only from the context you give. Ask about something not in the text and you get a poor span.
Quick Check
Recall how the QA pipeline returns its result.
Recap
One pipeline call takes a question plus context and returns a dict with answer, score, start, and end. You ran extractive QA in three lines. ✅
الأسئلة الشائعة
هل درس «تشغيل مسار ضمان الجودة» مجاني؟
نعم — نص درس «تشغيل مسار ضمان الجودة» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة NLP Academy، انتقل إلى CoddyKit PRO. تتضمن دورة NLP Academy 4 دروس في المجموع.
ماذا ستتعلم في «تشغيل مسار ضمان الجودة»؟
استخرج الإجابات من مقطع نصي تتمرن على NLP Academy مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.
هل أحتاج إلى خبرة سابقة لأبدأ NLP Academy؟
لا تُشترط خبرة سابقة. NLP Academy على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 2 من أصل 4.
كم من الوقت يستغرق درس «تشغيل مسار ضمان الجودة»؟
معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.
هل يمكنني كتابة وتشغيل أكواد في درس NLP Academy هذا؟
نعم. كل درس في NLP Academy يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.
جميع الدروس في هذه الدورة
- ضمان الجودة الاستخراجي مقابل التوليدي
- تشغيل مسار ضمان الجودة
- العثور على مقاطع الإجابة في السياق
- معالجة غياب الإجابة والمستندات الطويلة