9.5 Analysis of Evaluation for QA Source Code
As shown in Figure 9-4, let's take a look at the source code of the LangChain framework for Q&A evaluation (Evaluation for QA).
Figure 9-5 LangChain's evaluation qa directory
In the eval_prompt.py file, three classes PromptTemplate are mainly defined, which are templates for generating questions.
Gavin big coffee WeChat: NLP_Matrix_Space
eval_prompt.py code implementation:
1. # flake8: noqa
2. from langchain.prompts import PromptTemplate
3.
4. template = """You are a teacher grading a quiz.
5. You are given a question, the student's