RAGChain Docs
  • Introduction
  • Quick Start
  • Installation
  • RAGchain Structure
    • File Loader
      • Dataset Loader
        • Ko-Strategy-QA Loader
      • Hwp Loader
      • Rust Hwp Loader
      • Win32 Hwp Loader
      • OCR
        • Nougat Loader
        • Mathpix Markdown Loader
        • Deepdoctection Loader
    • Text Spliter
      • Recursive Text Splitter
      • Markdown Header Splitter
      • HTML Header splitter
      • Code splitter
      • Token splitter
    • Retrieval
      • BM25 Retrieval
      • Hybrid Retrieval
      • Hyde Retrieval
      • VectorDB Retrieval
    • LLM
    • DB
      • MongoDB
      • Pickle DB
    • Reranker
      • BM25 Reranker
      • UPR Reranker
      • TART Reranker
      • MonoT5 Reranker
      • LLM Reranker
    • Benchmark
      • Auto Evaluator
      • Dataset Evaluators
        • Qasper
        • Ko-Strategy-QA
        • Strategy-QA
        • ms-marco
  • Utils
    • Query Decomposition
    • Evidence Extractor
    • Embedding
    • Slim Vector Store
      • Pinecone Slim
      • Chroma Slim
    • File Cache
    • Linker
      • Redis Linker
      • Dynamo Linker
      • Json Linker
    • REDE Search Detector
    • Semantic Clustering
  • Pipeline
    • BasicIngestPipeline
    • BasicRunPipeline
    • RerankRunPipeline
    • ViscondeRunPipeline
  • For Advanced RAG
    • Time-Aware RAG
    • Importance-Aware RAG
Powered by GitBook
On this page
  • Overview
  • Usage
  • Initialize
  • Run
  1. Pipeline

BasicRunPipeline

BasicRunPipeline Class Documentation

Overview

The BasicRunPipeline class handles the run process of document question answering. It is simple pipeline for beginners. It retrieves passages from a retrieval module, runs a Language Model (LLM) module to get an answer, and returns the answer and the retrieved passages.

Usage

Initialize

The BasicRunPipeline class is initialized with the following parameters:

  • retrieval: Retrieval module to retrieve passages.

  • llm: LLM module to get answer. If not provided, a default BasicLLM module is used.

retrieval = BM25Retrieval(save_path="./bm25.pkl")
pipeline = BasicRunPipeline(retrieval=retrieval, llm=OpenAI())

Run

The run variable is runnable of Langchain LCEL. So you can use all method for running pipeline, like invoke, stream, batch, and so on.

answer = pipeline.run.invoke({"question": "Where is the capital of Korea?"})

If you want to get used passages or relevance scores of retrieved passages, you can use get_passages_and_run method.

answers, passages, scores = pipeline.get_passages_and_run(["Where is the capital of Korea?"])
PreviousBasicIngestPipelineNextRerankRunPipeline

Last updated 1 year ago