0Pricing
LangChain / RAG / Vector DBs · Ders

RAG için Altın Test Kümesi Oluşturma

RAG kalitesini zaman içinde nesnel biçimde ölçmenizi ve karşılaştırmanızı sağlayan, özenle hazırlanmış bir soru-cevap veri kümesi oluşturun.

RAG için Altın Test Kümesi Oluşturma, CoddyKit'te ücretsiz bir LangChain / RAG / Vector DBs dersidir. Bu, 4 dersinin 4. dersidir. Aşağıdan dersin tamamını ücretsiz okuyabilir, sonra tarayıcıda yerleşik kod editörü ve 7/24 yapay zeka koçu ile uygulamalı olarak pratik yapabilirsin. Bu, LangChain / RAG / Vector DBs öğrenme yolunun bir parçasıdır ve ilerlemeniz web ve CoddyKit uygulaması arasında senkronize olur. LangChain / RAG / Vector DBs kursu toplamda 4 dersten oluşur.

Bu dersin bazı bölümleri henüz çevrilmemiş olup İngilizce olarak gösterilmektedir.

Why You Need a Test Set

Eyeballing a few answers does not tell you if a change helped or hurt. A golden test set of question-answer pairs gives you repeatable, comparable measurements.

Anatomy of a Test Case

Each case captures what to ask, what is correct, and where the answer lives.

  • question
  • ground_truth answer
  • relevant_sources (expected docs)

A Sample Dataset

Store cases as simple records you can load and iterate over.

testset = [
    {"question": "What is the refund window?",
     "ground_truth": "30 days from purchase.",
     "sources": ["policy.pdf#p2"]},
    {"question": "Who approves expenses?",
     "ground_truth": "The department manager.",
     "sources": ["handbook.pdf#p7"]},
]

Manual vs. Synthetic

You can write cases by hand for accuracy, or generate them by prompting an LLM over your documents for scale. A hybrid approach is common: generate, then review.

Generating Questions with an LLM

Feed a chunk to the model and ask it to produce a question whose answer is contained in that chunk, plus the answer itself.

prompt = (
  "Read the passage and write one question a user might ask, "
  "plus the exact answer.\n\nPassage: " + chunk.page_content
)
qa = llm.invoke(prompt)

Reviewing Synthetic Cases

LLM-generated pairs can be ambiguous or unanswerable. Human review filters out weak cases before they pollute your metrics.

Retrieval vs. Generation Metrics

Separate two questions: did we fetch the right docs (retrieval), and did we write the right answer (generation)? Each is measured differently.

Context Recall

Context recall checks whether the expected source appears among the retrieved chunks. It isolates retrieval quality from the LLM.

def context_recall(retrieved_ids, expected_ids):
    hits = sum(1 for e in expected_ids if e in retrieved_ids)
    return hits / len(expected_ids)

Answer Correctness

Compare the generated answer to the ground truth. Exact match is brittle, so use an LLM judge or semantic similarity for fuzzy correctness.

judge_prompt = (
  "Is the ANSWER correct given the REFERENCE? Reply yes or no.\n"
  "REFERENCE: " + truth + "\nANSWER: " + answer
)
verdict = llm.invoke(judge_prompt)

Running the Suite

Loop over every case, run your pipeline, and aggregate scores so one number summarizes the whole system.

scores = []
for case in testset:
    docs = retriever.invoke(case["question"])
    ans = rag_chain.invoke(case["question"])
    scores.append(evaluate(case, docs, ans))
print(sum(scores) / len(scores))

Track Results Over Time

Save each run with a timestamp and the config used. When a metric drops, you can pinpoint the change that caused the regression.

Quick Check

Test your understanding of RAG evaluation.

Recap

You built an evaluation foundation:

  • A golden test set of question, ground truth, and sources
  • Generate then review synthetic cases
  • Measure retrieval (context recall) and generation (answer correctness) separately
  • Track scores across runs

Sıkça Sorulan Sorular

“RAG için Altın Test Kümesi Oluşturma” dersi ücretsiz mi?

Evet — “RAG için Altın Test Kümesi Oluşturma” dersin tüm metni burada web'de ücretsiz olarak okunabilir. Etkileşimli olarak pratik yapmak (yerleşik kod editörü ve 7/24 yapay zeka koçu) ve LangChain / RAG / Vector DBs kursunun geri kalanını açmak için CoddyKit PRO'ya yükselt. LangChain / RAG / Vector DBs kursu toplamda 4 dersten oluşur.

“RAG için Altın Test Kümesi Oluşturma” dersinde ne öğreneceğim?

RAG kalitesini zaman içinde nesnel biçimde ölçmenizi ve karşılaştırmanızı sağlayan, özenle hazırlanmış bir soru-cevap veri kümesi oluşturun. LangChain / RAG / Vector DBs ile uygulamalı kodu tarayıcıda doğrudan çalıştırarak pratik yaparsın ve 7/24 yapay zeka koçu dersi çalışırken sorularını yanıtlar.

LangChain / RAG / Vector DBs öğrenmeye başlamak için deneyim gerekli mi?

Önceden deneyim gerekmez. CoddyKit'te LangChain / RAG / Vector DBs, başlangıçtan ileri seviyeye kadar yapılandırıldığı için buradan başlayabilir veya başından başlayıp kendi hızında ilerleme yapabilirsin. Bu, 4 dersinin 4. dersidir.

“RAG için Altın Test Kümesi Oluşturma” dersi ne kadar sürer?

Çoğu CoddyKit dersi yaklaşık 5–10 dakika sürer. Her biri kısa ve etkileşimli olduğu için sabit ilerleme yaparsın ve web ile uygulama arasında tam olarak bıraktığın yerden devam edebilirsin.

Bu LangChain / RAG / Vector DBs dersinde kod yazıp çalıştırabilir miyim?

Evet. Her LangChain / RAG / Vector DBs dersi yerleşik bir kod editörü içerir, bu sayede tarayıcıda gerçek kod yazıp çalıştırabilir ve anlık yapay zeka geri bildirimi alırsın — yerel kurulum gerekli değildir.

Bu kursun tüm dersleri

  1. Tüm RAG Bileşenlerini Tümleştirme
  2. Sorgulama ve Yanıt Üretme
  3. RAG Sistemi Performansını Değerlendirme
  4. RAG için Altın Test Kümesi Oluşturma
← LangChain / RAG / Vector DBs Sayfasına Dön