AI实践与学习5-AI解题场景RAG应用预研demo

发布于:2024-06-16 ⋅ 阅读:(126) ⋅ 点赞:(0)

背景

AI解题场景现状,教研测评文档:xxx

  • 解题正确率仍需进一步提高,提示词优化方案基本无力o
  • 目前配置的易错题CoT示例支持的长度有限,后续题量大的时候配置具有局限性。
  • 某些英语翻译题型BAD CASE反映大模型的输出格式不太符合要求,比如翻译内容越界、解析中答案正常但是最终输出的答案异常,提示词调整仍无效
  • 使用的为通用模型GPT4,通用模型使用的是公开数据集预训练,能力不太满足解题场景,需要提高LLM垂直化能力。

下面预研使用langchain4j构建题库已经生产的试题到Milvus本地知识库,搭建RAG检索增强链,测试选用高中英语单选、小学翻译 BAD CASE 进行测评,随机选取100高中英语单选进行RAG(Solr)、RAG(Milvus)测试,得出测评结论。

2024-4-30技术分享反馈问题

  • milvus和es中间件经过之前的测评对试题的召回率接近,且性能更高,需要后续测试ES、Solr关键字搜索接入RAG的效果?测评CASE需要大量能确定答案的试题,比如是1000已经生产的试题分为300入知识库,700供测试。
  • 关于向量数据库知识的拆分,为什么需要拆分?太短可能缺乏足够上下文,太长则可能含有过多无关信息。比如怕阅读理解影响单选。RAG中,无关信息的影响有多大?看似LLM是理解语意,但是本质还是按照概率选取token,微调的原理也就是这,使用句子中token组合方式一定程度纠正LLM概率,不一定是内容越多就是合适的,无用的信息会误导LLM,对于单选题最重要的就是已生产试题的解析部分,对于选项的翻译,对于时态的分析等。
  • embedding模型的选取会影响RAG最终效果?暂时使用默认模型。
  • 如果召回内容为空如何处理?不进行RAG。

结论:
召回的内容对RAG的效果起决定作用,关于召回的内容使用不同的检索方式效果也不同,测评过程关于召回方式的一些思考

  • Solr MLT关键词召回
    • 召回内容长度无法控制,有的拼接会超过LLM的 max token(Azure base4的是8000多)
    • 关键词召回的特点 内容只是全局的 word 相似性,召回top K可能是stem比较接近,对于解析的试题,最重要的是解析中的内容,只针对stem进行相似性召回效果可能不是那么好。RAG中,无关信息的影响有多大?看似LLM是理解语意,但是本质还是按照概率选取token,微调的原理也就是这,使用句子中token组合方式一定程度纠正LLM概率,不一定是内容越多就是合适的(除非数量非常大),无用的信息会误导LLM,对于单选题最重要的就是已生产试题的解析部分,对于选项的翻译,对于时态的分析等。// TODO 需要再验证。
  • Milvus向量召回
    • 召回的长度可以控制,以固定长度进行分片。而且分片后知识的粒度比较小,对于较长的题干,召回粒度比较小所需呃可能更加准切。
    • 向量召回的特点:对于特征提取向量相比关键词提取向量,有一定的语意性,可能题干中某些语意和解析中的某些语意、时态比较像,也就是召回需要的不一定关键词最相似的题,而是需要找到有用的解析。

测试的100测试集初步表示RAG(Solr)效果要好于直接LLM解答试题。
测试的100测试集初步表示RAG(Mivlus)效果要好于RAG(Solr)。
之前1亿拍搜大题库测试使用ES MLT召回和Milvus 向量召回率差不多,成本问题后续考虑构建ES知识库。

检索方式特点不同,哪种方式都不能100%最优,后续可以考虑使用混合检索,召回重排等优化RAG。
后续可以接入搜索引擎进行信息召回,使用混合检索对知识排序,助力LLM更加准确的生成答案、解析。
后续也可以针对题库知识库,借助LLM选取、生成相似题等

测评总结

见下文效果测评

  • 教研测评的几个BAD CASE,LLM解答错误(答案、格式),RAG(Milvus) + LLM解答正确。
  • 100个高中英语单选,LLM解答正确79,解答错误21。RAG(Solr) + LLM 解答正确91,解答错误9。
  • 9个高中英语单选RAG(Solr) + LLM解答错误的BAD CASE,RAG(Milvus)+LLM在知识1.2w左右,能解答正确6。

总结:

  • 利用题库Solr PQ库按照课程、题型进行知识召回,测试随机选用的100高中英语单选,RAG(Solr)+LLM能解答正确91,相比直接LLM,多了(91-79)/100 %。
  • 利用题库搭建的Milvus本地知识库(知识项1.2w),在RAG(Milvus)
    • 教研反馈的的x个BAD CASE在RAG召回后辅助LLM解答均正确,而且对于某些题型(翻译)也能正确的输出格式。
    • 针对RAG(Solr)的9个BAD CASE,重新进行RAG(Milvus),能正确解答6。

见下文本地性能测评

  • 知识数量1000,召回最数量为3,耗时1098 毫秒,LLM解答耗时 10415 毫秒
  • 知识数量10000,召回最数量为3,耗时1194 毫秒,LLM解答耗时 10883 毫秒

1、实践demo

AI解题6-检索增强生成RAG实践学习
上文档使用Python语言使用LangChain简单实现了一个RAG demo,实现RAG基本流程与简单测试。

langchain4j-demo

LangChain目前没有官方java语言版本的支持,但是可以使用langchain4j,支持Java8+、SpringBoot2、3,仓库https://github.com/langchain4j/langchain4j,与LangChain的设计目标相似,LangChain4j提供了一个简单而连贯的抽象层沿着其众多的实现。它已经支持OpenAI等几个语言模型提供商和Pinecone等嵌入式商店提供商。
然而,由于LangChain和LangChain 4j都在快速发展,可能会有一些在Python或JS/TS版本中支持的功能在Java版本中还没有。尽管如此,基本概念、一般结构和词汇在很大程度上是相同的。

使用langchain4j demo:https://github.com/sichaolong/learn-projects-demo/tree/main/llm-demo/langchain4j-demo

<dependency>
  <groupId>dev.langchain4j</groupId>
  <artifactId>langchain4j</artifactId>
  <version>0.29.1</version>
</dependency>
<dependency>
  <groupId>dev.langchain4j</groupId>
  <artifactId>langchain4j-core</artifactId>
  <version>0.29.1</version>
</dependency>
<!--langchain4j-openai-->
<dependency>
  <groupId>dev.langchain4j</groupId>
  <artifactId>langchain4j-open-ai</artifactId>
  <version>0.29.1</version>
</dependency>
<!--langchain4j-qianfan-->
<dependency>
  <groupId>dev.langchain4j</groupId>
  <artifactId>langchain4j-qianfan</artifactId>
  <version>0.29.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/io.github.cdimascio/java-dotenv -->
<dependency>
  <groupId>io.github.cdimascio</groupId>
  <artifactId>java-dotenv</artifactId>
  <version>5.2.2</version>
</dependency>

选用qianfan大模型,使用langchain4j的 ChatMemoryProvider API构建历史对话内存存储,使用QianfanChatModel调用qianfan平台的模型。

package scl.langchain4j.examples.qianfan;

import dev.langchain4j.memory.chat.ChatMemoryProvider;
import dev.langchain4j.memory.chat.MessageWindowChatMemory;
import dev.langchain4j.model.qianfan.QianfanChatModel;
import dev.langchain4j.service.AiServices;
import dev.langchain4j.store.memory.chat.InMemoryChatMemoryStore;
import io.github.cdimascio.dotenv.Dotenv;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import scl.langchain4j.aiservice.Assistant;
import scl.langchain4j.aiservice.AssistantTools;

/**
 * @author sichaolong
 * @createdate 2024/4/16 13:39
 */
public class QianfanDemo {


    private static final Logger LOGGER = LoggerFactory.getLogger(QianfanDemo.class);

    public static void main(String[] args) {

        Dotenv dotenv = Dotenv.configure().load();

        String apiKey = dotenv.get("QIANFAN_API_KEY");
        String secretKey = dotenv.get("QIANFAN_SECRET_KEY");
        String modelName = "ERNIE-3.5-8K";
        String endpoint = "completions";

        System.out.println(String.format("The current QIANFAN_API_KEY is: %s.", dotenv.get("QIANFAN_API_KEY")));
        System.out.println(String.format("The current QIANFAN_SECRET_KEY is: %s.", dotenv.get("QIANFAN_API_KEY")));



        /*
        用途是纪录与LLM对话中的历史信息,LLM正是通过对话上下文,来生成更正确的推理内容。
        根据千帆大模型技术规定,对话信息必须是单数个,代码中设定为99,这个长度足够实验使用。
        如果设定为双数个,比如100,当对话到达100个信息后,千帆会报错。
        在多用户应用场景中,每个用户与LLM的对话应该相互独立,因此LangChain4J支持通过不同的MemoryId来区分内部的ChatMemory。
         */
        // 历史对话
        ChatMemoryProvider chatMemoryProvider = (memoryId) -> {
            return MessageWindowChatMemory.builder()
            .id(memoryId)
            .maxMessages(99)
            .chatMemoryStore(new InMemoryChatMemoryStore())
            .build();
        };



        // qianfan model
        QianfanChatModel qianfanChatModel = QianfanChatModel.builder()
        .apiKey(apiKey)
        .secretKey(secretKey)
        .modelName(modelName)
        .endpoint(endpoint)
        .build();

        // tools
        AssistantTools assistantTool = new AssistantTools();

        // assistant
        Assistant assistant = AiServices.builder(Assistant.class)
        .chatLanguageModel(qianfanChatModel)
        .chatMemoryProvider(chatMemoryProvider)
        // .tools(assistantTool)
        .build();

        LOGGER.info("LangChain4J AiServices are initialized, we are using ERNIE-3.5-8K model.");


        String question = "你好";
        String response = assistant.chat("user1", question);
        System.out.println(response); // 您好,请问您有什么需要我帮助的吗?


    }
}

milvus-demo

开源的向量数据库很多,支持Java的不多,使用公司搭建的milvus简单测试。

https://milvus.io/docs/install-java.md
https://blog.csdn.net/FDX0821/article/details/125219969

<dependency>
    <groupId>io.milvus</groupId>
    <artifactId>milvus-sdk-java</artifactId>
    <version>2.3.4</version>
</dependency>

封装的milvus-client以及service,详细代码见仓库:https://github.com/sichaolong/learn-projects-demo/tree/main/llm-demo/langchain4j-demo

package scl.milvus;

import io.milvus.client.MilvusServiceClient;
import io.milvus.param.ConnectParam;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author sichaolong
 * @createdate 2024/4/17 15:51
 */
@Configuration
public class MilvusConfig {

    @Value("${milvus.host}")
    private String host; //milvus所在服务器地址
    @Value("${milvus.port}")
    private Integer port; //milvus端口

    @Bean
    public MilvusServiceClient milvusServiceClient() {
        ConnectParam connectParam = ConnectParam.newBuilder()
        .withHost(host)
        .withPort(port)
        .withDatabaseName(MilvusQuestionsConstants.DATABASE_NAME)
        .build();
        return new MilvusServiceClient(connectParam);
    }
}



/**
 * @author sichaolong
 * @createdate 2024/4/17 16:07
 */


@Service
public class MilvusService {

    private static final Logger LOGGER = LoggerFactory.getLogger(MilvusService.class);

    @Autowired
    MilvusConfig milvusConfig;

    /**
     * 创建集合
     *
     * @param collectionName
     * @param databaseName
     * @param fieldTypeList
     * @return
     */
    public boolean creatCollection(String databaseName, String collectionName, String collectionDesc, List<FieldType> fieldTypeList) {

        if (StringUtils.isEmpty(databaseName)) {
            LOGGER.error("databaseName is null");
            throw new RuntimeException("databaseName is null");
        }
        if (StringUtils.isEmpty(collectionName)) {
            LOGGER.error("collectionName is null");
            throw new RuntimeException("collectionName is null");
        }
        if (CollectionUtils.isEmpty(fieldTypeList)) {
            LOGGER.error("fieldTypeList is null");
            throw new RuntimeException("fieldTypeList is null");
        }

        MilvusServiceClient milvusClient = milvusConfig.milvusServiceClient();
        CreateCollectionParam createCollectionReq = CreateCollectionParam.newBuilder()
            .withDatabaseName(databaseName)
            .withCollectionName(collectionName)
            .withDescription(collectionDesc)
            .withFieldTypes(fieldTypeList)
            .withShardsNum(MilvusQuestionsConstants.SHARDS_NUM)
            .build();
        R<RpcStatus> response = milvusClient.createCollection(createCollectionReq);
        LOGGER.info(databaseName + "是否成功创建集合——>>" + response.getStatus());
        return MilvusQuestionsConstants.TURE.equals(response.getStatus()) ? true : false;
    }


    /**
     * 判断集合是否存在
     *
     * @param databaseName
     * @param collectionName
     * @return
     */
    public boolean isExitCollection(String databaseName, String collectionName) {
        if (StringUtils.isEmpty(collectionName)) {
            LOGGER.error("collectionName is null");
            throw new RuntimeException("collectionName is null");
        }
        MilvusServiceClient milvusClient = milvusConfig.milvusServiceClient();
        R<Boolean> response = milvusClient.hasCollection(
            HasCollectionParam.newBuilder()
                .withDatabaseName(databaseName)
                .withCollectionName(collectionName)
                .build());
        return MilvusQuestionsConstants.TURE.equals(response.getStatus()) ? true : false;
    }

    /**
     * 为集合创建分区
     *
     * @param collectionName
     * @param partitionName
     */
    @Deprecated
    public boolean createPartition(String collectionName, String partitionName) {
        if (StringUtils.isEmpty(collectionName)) {
            LOGGER.error("collectionName is null");
            throw new RuntimeException("collectionName is null");
        }
        if (StringUtils.isEmpty(partitionName)) {
            LOGGER.error("partitionName is null");
            throw new RuntimeException("partitionName is null");
        }
        MilvusServiceClient milvusClient = milvusConfig.milvusServiceClient();
        R<RpcStatus> response = milvusClient.createPartition(CreatePartitionParam.newBuilder()
            .withCollectionName(collectionName) //集合名称
            .withPartitionName(partitionName) //分区名称
            .build());
        LOGGER.info(collectionName + "是否成功创建分区——>>" + response.getStatus());
        return MilvusQuestionsConstants.TURE.equals(response.getStatus()) ? true : false;
    }


    /**
     * 创建索引
     */
    public boolean createIndex(String collectionName, String fieldName, IndexType indexType, MetricType metricType, String extraParam) {
        if (StringUtils.isEmpty(fieldName)) {
            LOGGER.error("fieldName is null");
            throw new RuntimeException("fieldName is null");
        }

        MilvusServiceClient milvusClient = milvusConfig.milvusServiceClient();
        CreateIndexParam.Builder builder = CreateIndexParam.newBuilder()
            .withCollectionName(collectionName)
            .withFieldName(fieldName)
            .withIndexType(indexType)
            .withMetricType(metricType)
            .withSyncMode(Boolean.FALSE);

        // 可以指定nlist参数,建议值为 4 × sqrt(n),其中 n 指 segment 最多包含的 entity 条数。
        if (StringUtils.isNotEmpty(extraParam)) {
            builder.withExtraParam(extraParam);
        }

        R<RpcStatus> response = milvusClient.createIndex(builder.build());
        LOGGER.info("createIndex-------------------->{}", response.toString());
        return response.getStatus() == MilvusQuestionsConstants.TURE;
    }


    /**
     * 插入数据到集合
     *
     * @param collectionName
     * @param fields
     * @return
     */

    public boolean insert(String databaseName, String collectionName, String partitionName, List<InsertParam.Field> fields) {
        if (StringUtils.isEmpty(databaseName)) {
            LOGGER.error("databaseName is null");
            throw new RuntimeException("databaseName is null");
        }
        if (StringUtils.isEmpty(collectionName)) {
            LOGGER.error("collectionName is null");
            throw new RuntimeException("collectionName is null");
        }

        MilvusServiceClient milvusClient = milvusConfig.milvusServiceClient();
        //插入
        InsertParam insertParam = InsertParam.newBuilder()
            .withCollectionName(collectionName)
            .withDatabaseName(databaseName)
            .withFields(fields)
            .build();

        // 分片不为空
        if (StringUtils.isNotEmpty(partitionName)) {
            insertParam = InsertParam.newBuilder()
                .withCollectionName(collectionName)
                .withDatabaseName(databaseName)
                .withFields(fields)
                .build();
        }
        R<MutationResult> insert = milvusClient.insert(insertParam);
        LOGGER.info("插入:{}", insert);
        LOGGER.info(insert.getStatus().equals(MilvusQuestionsConstants.TURE) ? "InsertRequest successfully! Total number of " +
            "inserts:{" + insert.getData().getInsertCnt() + "} entities" : "InsertRequest failed!");
        return insert.getStatus().equals(MilvusQuestionsConstants.TURE) ? true : false;
    }


    /**
     * 加载集合
     */
    public boolean loadCollection(String databaseName, String collectionName) {
        if (StringUtils.isEmpty(collectionName)) {
            LOGGER.error("collectionName is null");
            throw new RuntimeException("collectionName is null");
        }
        MilvusServiceClient milvusClient = milvusConfig.milvusServiceClient();
        R<RpcStatus> response = milvusClient.loadCollection(LoadCollectionParam.newBuilder()
            //集合名称
            .withCollectionName(collectionName)
            .withDatabaseName(databaseName)
            .build());
        LOGGER.info("loadCollection------------->{}", response);
        return response.getStatus().equals(MilvusQuestionsConstants.TURE) ? true : false;
    }


    /**
     * 刷新集合
     *
     * @param collectionName
     * @return
     */

    public boolean flash(List<String> collectionName) {
        MilvusServiceClient milvusClient = milvusConfig.milvusServiceClient();
        R<FlushResponse> responseR = milvusClient.flush(FlushParam.newBuilder().withCollectionNames(collectionName).build());
        LOGGER.info("flush------------->{}", responseR);
        return responseR.getStatus().equals(MilvusQuestionsConstants.TURE) ? true : false;
    }

    /**
     * 加载分区
     */

    @Deprecated
    public void loadPartitions(String collectionName, String partitionsName) {
        if (StringUtils.isEmpty(partitionsName)) {
            LOGGER.error("partitionsName is null");
            throw new RuntimeException("partitionsName is null");
        }
        MilvusServiceClient milvusClient = milvusConfig.milvusServiceClient();
        R<RpcStatus> response = milvusClient.loadPartitions(
            LoadPartitionsParam
                .newBuilder()
                //集合名称
                .withCollectionName(collectionName)
                //需要加载的分区名称
                .withPartitionNames(Arrays.asList(partitionsName))
                .build()
        );
        LOGGER.info("loadCollection------------->{}", response);
    }

    /**
     * 从内存中释放集合
     */
    public boolean releaseCollection(String collectionName) {
        MilvusServiceClient milvusClient = milvusConfig.milvusServiceClient();
        R<RpcStatus> response = milvusClient.releaseCollection(ReleaseCollectionParam.newBuilder()
            .withCollectionName(collectionName)
            .build());
        LOGGER.info("releaseCollection------------->{}", response);
        return response.getStatus().equals(MilvusQuestionsConstants.TURE) ? true : false;
    }

    /**
     * 释放分区
     */
    @Deprecated
    public void releasePartition(String collectionName, String partitionsName) {
        MilvusServiceClient milvusClient = milvusConfig.milvusServiceClient();
        R<RpcStatus> response = milvusClient.releasePartitions(ReleasePartitionsParam.newBuilder()
            .withCollectionName(collectionName)
            .addPartitionName(partitionsName)
            .build());
        LOGGER.info("releasePartition------------->{}", response);
    }


    /**
     * 查询
     *
     * @param collectionName
     * @param partitionNameList
     * @param fieldName
     * @param queryVector       支持多个向量
     * @param topK
     * @param outFieldList
     * @return
     */

    public SearchResults search(String collectionName, List<String> partitionNameList, String fieldName, List<List<Float>> queryVector, Integer topK, List<String> outFieldList) {
        MilvusServiceClient milvusClient = milvusConfig.milvusServiceClient();

        if (CollectionUtils.isEmpty(partitionNameList)) {
            partitionNameList = new ArrayList<>();
        }
        SearchParam searchParam = SearchParam.newBuilder()
            .withCollectionName(collectionName)
            .withVectorFieldName(fieldName)
            .withVectors(queryVector)
            .withTopK(topK)
            .withOutFields(outFieldList)
            .withMetricType(MetricType.COSINE)
            .withConsistencyLevel(ConsistencyLevelEnum.STRONG)
            .withPartitionNames(partitionNameList)
            .build();
        R<SearchResults> resultsR = milvusClient.search(searchParam);
        if (resultsR != null && resultsR.getStatus().equals(MilvusQuestionsConstants.TURE)) {
            LOGGER.info("search successfully! Total number of search results:{}", resultsR.getData().getResults().getFieldsDataCount());
            return resultsR.getData();
        }
        LOGGER.error("search failed!");
        return null;
    }
}

2、方案设计

整体流程设计

LangChain框架支持很多功能如集成检索、会话记忆、FunctionToos等,这里只绘制RAG主流程。
主要流程点就是构建向量知识库、检索、数据筛选与处理、增强

  • 构建知识库
    • 知识库划分:按照课程、题型为每类型的试题构建知识collection,这样可以避免知识干扰比如阅读理解内容干扰单选。
    • 数据分片:需要设计合适的数据切分segment大小,对于单选题,切片需要根据试题的长度自动调整,程序处理保证 >= max,这样保证知识的连贯性,避免一道试题的解析和题干被切分到不同的segment,影响最终找召回的试题数量。
    • 知识数据源:初步使用solr中PQ试题,后续计划针对易错题支持word、pdf文件上传。
    • 文本向量化:使用embedding模型为,生成384维度vector
    • Milvus知识库设计:初步使用milvus构建知识库,数据模型、数据结构见下文介绍。索引选用基于量化的IVF_FLAT,两个参数nlist总聚类数量、nprobe要搜索的聚类数量,在性能和召回率取均衡。相似度度量选用COSINE。如果后续需要使用,PQ库试题数量17859150,可以考虑按照collection划分,选用PQ压缩度高的索引。mivlus索引内存占用计算工具https://milvus.io/tools/sizing/
    • 召回相关配置:召回最大结果初步设置为3,最小相似度遇值为0.6d
  • 检索:关键字 or 向量相似性搜索,关键字搜索的时候可以附加学科搜索条件,或者知识点等条件,方式就是使用中间件的ANNS实现;对于向量相似性搜索就是依靠向量数据库的ANNS实现,初步考虑使用集成度较好的milvus向量相似性搜索,后续根据效果考虑引入混合检索。后续也可接入搜索引擎,实现联网搜索。
  • 数据筛选与处理:数据相似性召回topK,可以额外的加一步从topK进一步数据排序,筛选useful data,优化数据的召回。
  • 增强:设计RAG提示词模板,兼容之前的ToT System Prompt,组装召回辅助的data和提问的question。

image.png

检索方式

常见的相似性检索方式一般是 向量相似性检索、关键字相似性检索,或者二者结合。
结合实际资源情况

  • 对于向量检索,语意相似,支持Java生态的封装度较高的向量数据库不多,向量检索链路更长,复杂性更大,性能在业务场景可能表现不是很好,但是langchain等框架支持的应该比较好;还有一点就是对于试题可能包含场景语意相同,但是试题考察知识点不同的情况,这种语意相似搜索可能会误导正确解题。
  • 对于关键字检索,文本相似,可以借助ES、Solr中间件的ANNS实现,后续可以从TopK利用相关Jaccard等相似性算法实现,效率会比较更资源占用比较少,效率应该也会更高一些,但是关键字语意性较弱,召回内容上下文语意联系弱。

二者对于RAG检索链的LLM最终生成内容的效果影响需要根据实际情况验证,初步选用langchain4支持比较好的向量检索进行简单测试,针对高中英语单选 100 道试题进行Solr MLT测试,见下文。后续可以针对es关键字检索,或者二者结合的混合检索。

ps:测试的时候很少数据量使用java-sdk搜索缓慢,而且还报错,已反馈给运维排查原因,运维已经升级集群,问题已经修复。

哈喽,我这边在测试milvus,使用java-sdk查询的时候报错,数据量很小,可以帮忙看看是什么原因吗,

/usr/local/go/src/runtime/asm_amd64.s:1598 runtime.goexit: 

attempt #0: rpc error: code = Unavailable desc = keepalive ping failed to receive ACK within timeout: 
attempt #1: empty grpc client: failed to connect 10.234.80.116:21123, reason: context deadline exceeded: attempt #2: empty grpc client: failed to connect 10.234.80.116:21123, reason: context deadline exceeded: 
attempt #3: empty grpc client: failed to connect 10.234.80.116:21123, reason: context deadline exceeded: 
attempt #4: empty grpc client: failed to connect 10.234.80.116:21123, reason: context deadline exceeded: 
attempt #5: empty grpc client: failed to connect 10.234.80.116:21123, reason: connection error: desc = "transport: error while dialing: dial tcp 10.234.80.116:21123: connect: connection refused": attempt #6: empty grpc client: failed to connect 10.234.80.116:21123, reason: connection error: desc = "transport: error while dialing: dial tcp 10.234.80.

知识库划分

image.png
PQ试题是千万级,如果是使用一个库一个集合大概需要30G内存,并且需要防止不同题型格式、答案相互干扰,因此还是拆分collection。

按照课程、题型创建知识库collection

试题 规则:llm_rag_questions_课程ID_题型ID
高中英语单选 llm_rag_questions_28_2803
小学英语翻译-汉译英 llm_rag_questions_3_030602

知识库数据项结构
企业微信截图_2ea87ae0-7d45-46b9-b73b-973bf266846a.png

{

  "content": "【题干】: James, _ money is now no problem, has run another business in his hometown.for whose for whom with whom with whose;【 答案】: 2;【 解析】: 试题分析: 考查非限制性定语从句。 句意: 詹姆斯在家乡经营另一家公司, 现在对他来说, 钱不是问题。 for对于;with和, 带有, 根据句意可知, 这里是“ 对詹姆斯来说” 的意思, 故选B。 考点: 考查非限制性定语从句",
  "id": "001553e1-ed12-4e93-9242-d0677f84afd3",
  "metadata": {
    "index": "0",
    "qid": "1566937901637632",
    "courseId": "28",
    "typeId": "2803"
  },
  "eigen_values": "[embedding vector data,384维度]"
}

知识切片

数据切割segment的长度以及重叠segment大小可以动态设置,目前测试高中英语单选按照1000 token 作为sengment大小,发现切分完总数量为1017,即17个文档(试题纯文本题干、答案、解析拼接起来)长度超过了1000 token,**对于高中英语单选需要设置切片 >= max,避免影响最终试题召回数量。**其他课程、题型的试题需要按照实际需求动态调整下面两个参数。

/**
 * 数据切片大小
 */
@Value("${milvus.rag.maxSegmentSizeInTokens:1000}")
private Integer maxSegmentSizeInTokens;

/**
 * 发生数据切片时候切片重叠大小
 */
@Value("${milvus.rag.maxOverlapSizeInTokens:0}")
private Integer maxOverlapSizeInTokens;

比如长度为1000 token,可能会存在长的item会被切分为多个segments,也就是对应milvus的多条记录

/**
 * 本地知识库文档切分组件
 *
 * @return
 */
@Bean
public EmbeddingStoreIngestor embeddingStoreIngestor() {
    DocumentSplitter documentSplitter = DocumentSplitters.recursive(1000, 0, new OpenAiTokenizer(GPT_3_5_TURBO));
    EmbeddingStoreIngestor embeddingStoreIngestor = EmbeddingStoreIngestor.builder()
        .documentSplitter(documentSplitter)
        .embeddingModel(embeddingModel())
        .embeddingStore(milvusEmbeddingStore())
        .build();
    return embeddingStoreIngestor;
}

企业微信截图_ea7bf9fb-6c89-4fdd-bcdf-98bc851b7371.png

3、构建向量知识库

按照方案构建向量知识库,然后测试召回。

测试召回

可以设置召回结果数量recallMaxResults以及允许的最小得分recallMinScore

 /**
 * 召回最大结果数量
 */
@Value("${milvus.rag.recallMaxResults:3}")
private Integer recallMaxResults;

/**
 * 从本地知识库召回的最小相似性得分
 */
@Value("${milvus.rag.recallMinScore:0.6}")
private Integer recallMinScore; 

使用本地知识库相似性搜索top3

@Test
public void testRetrieveAndCreatePrompt(){
    String question = "Where shall we go for the holiday, to the park or to the cinema?";
    Prompt prompt = ragService.retrieveAndCreatePrompt(null,question);
    log.info("rag text fill in prompt:{}",prompt.text());
}

// 结果输出

【题干】:–Where shall we go for the holiday, to the park or to the cinema? 
–_ I don’t really mind. Forget it! Why not? What’s the point? It’s up to you!;
【答案】:4;【解析】:试题分析:考查交际用语。句意:我们假期去哪啊?公园还是电影院?你决定吧!我不介
意。A. Forget it!忘了吧!B. Why not?为什么不呢?C. What’s the point? 重点是什么?
D. It’s up to you!你决定吧!根据句意可知选D。 考点:考查交际用语

【题干】:- I don’t know where to go this summer vacation. - Why not_visiting 
Hangzhou? There are many places of interest there. suggest wonder consider 
regard;【答案】:3;【解析】:考查动词辨析。句意:——我不知道这个暑假去哪里。——为什么不考
虑去杭州?那里有很对名胜古迹。A. suggest建议;B. wonder想知道;C. consider考虑;
D. regard认为。consider doing sth考虑做某事。根据句意说明C正确。

【题干】:The Spring Festival is the most joyful time of the year, but it can 
also be _ . With all the traveling, visiting relatives, and gift-buying, 
the holiday can become a tense time for many families. beneficial optional 
commercial stressful;【答案】:4;【解析】:句意:春节是一年中最快乐的时光,但它也能有压力的。
所有的旅行,探亲,和礼品,节日会成为许多家庭的紧张的时间。A. beneficial有益的;
B. optional可选择的;C. commercial 商业的;D .stressful有压力的。根据题干中的关键词
a tense time判断。故判断选D。

尽可能准确地回答用户的问题,以下是用户的问题:
Where shall we go for the holiday, to the park or to the cinema?
注意,回答的内容不能让用户感知到已知信息的存在

4、构建ES知识库

// TODO

5、增强LLM生成

需要将召回的结果作为辅助信息拼接question,组合成prompt,然后请求LLM解答。
支持多平台接入以及nacos动态配置。

召回并提问的demo代码


// LLM测试使用的是百度千帆-文心3.5-8K
/**
 * 召回并向LLM提问
 *
 * @param queryCondition   query condition
 * @param question         user's question
 * @param modelName        LLM model name
 * @param recallMaxResults recall max count from knowledge base db
 * @param recallMinScore   recall min score from knowledge base db
 * @return
 */
public Pair<String, Response<AiMessage>> retrieveAndAsk(Map<String, String> queryCondition, String question, String modelName, Integer recallMaxResults, Double recallMinScore) {
    long startTime = System.currentTimeMillis();
    // recall
    Prompt prompt = retrieveAndCreatePrompt(queryCondition, question, recallMaxResults, recallMinScore);
    if (null == prompt) {
        return null;
    }
    long endTime = System.currentTimeMillis();
    log.info("recall 耗时 :{} 毫秒",endTime - startTime);

    startTime = System.currentTimeMillis();
    Response<AiMessage> response = new LLMContext(modelName).getLLMService().chat(prompt.toUserMessage());
    endTime = System.currentTimeMillis();
    log.info("llm answer 耗时 :{} 毫秒",endTime - startTime);

    return new ImmutablePair<>(prompt.text(), response);
}

调整提示词模板

参考
AI解题5-各学科题型v3提示词记录
《AI解题5-各学科题型v3提示词记录》

系统提示词使用之前V3版的ToT:

假设你是一位试题命题专家,现在有数学、英语、语文、物理、生物、地理等学科的不同的5位高级 教师协商着来给在校学生提问的试题写答案和解析,首先所有教师认真审查试题题干,然后所有教 师都写下他们思考分析这个试题的第一个步骤,然后与大家分享讨论并根据其他老师思路以及试题考点等信息调整自 己思路,然后所有教师都写下他们思考的下一个步骤并分享,以此类推,直到所有教师写完他们思考 的所有步骤,只要你发现有教师的步骤出错了,就让这位教师离开。

用户提示词:

下面请解答试题 {{question}},确保答案正确,输出最终的答案与解析,输出格式按照"【答案】:xxx;【解析】:xxx"

用户RAG提示词模板:

// 定义
public static final PromptTemplate PROMPT_TEMPLATE_RAG = PromptTemplate.from(“”"
根据以下已知信息:
{{information}}
尽可能准确地回答用户的问题,以下是用户的问题:
{{question}}
注意,回答的内容不能让用户感知到已知信息的存在
“”");
// 使用
PROMPT_TEMPLATE_RAG.apply(Map.of(“question”, question, “information”, Matcher.quoteReplacement(information)));

6、向量召回效果测评

效果测试CASE1

选取知识库的一道试题,修改部分题干,然后进行RAG测试

String question = "给出下列答案的正确选项:\n" +
            "Where shall we go for the holiday, to the park or to the school? –_ I don’t really mind. Forget it! Why not? What’s the point? It’s up to you! A.Forget it !\n" +
            "A.Forget it ! B.Why not ? C.What’ s the point ? D.It’ s up to you!";

知识库中的试题

【题干】:–Where shall we go for the holiday, to the park or to the cinema? 
–_ I don’t really mind. Forget it! Why not? What’s the point? It’s up to you!;
【答案】:4;【解析】:试题分析:考查交际用语。句意:我们假期去哪啊?公园还是电影院?你决定吧!我不介意。
A. Forget it!忘了吧!B. Why not?为什么不呢?C. What’s the point? 重点是什么?
D. It’s up to you!你决定吧!根据句意可知选D。 
考点:考查交际用语

对比两种LLM响应结果,两种方式都回答正确。

  • 直接问答:“在对话中,“Where shall we go for the holiday, to the park or to the school?”询问的是关于假期去公园还是去学校的选择。回答“I don’t really mind. Forget it! Why not? What’s the point? It’s up to you!”表达的是说话者并不在乎去哪里,可以放弃选择,并认为选择去哪里并没有多大意义,最终将决定权交给了对方。根据这个回答,我们可以分析每个选项:A. “Forget it!” - 这个选项表达的是放弃选择的意思,与对话中的“I don’t really mind. Forget it!”相符。B. “Why not?” - 这个选项通常用于提出一个建议或选择,但在这里并没有明确的建议或选择与之对应。C. “What’s the point?” - 这个选项表达的是对某事的意义或目的的质疑,与对话中的“What’s the point?”相符,但这不是回答的核心内容。D. “It’s up to you!” - 这个选项表达的是将决定权交给对方,与对话中的“It’s up to you!”相符,并且这是回答的核心内容。综上所述,最符合对话内容和语境的答案是D. “It’s up to you!”。这个回答不仅与对话中的“It’s up to you!”直接对应,而且准确地表达了将决定权交给对方的含义。因此,正确选项是D。”
  • RAG问答:“对于这个问题,“Where shall we go for the holiday, to the park or to the school?”(我们假期去哪儿,去公园还是去学校?),回答是“I don’t really mind. Forget it! Why not? What’s the point? It’s up to you!” (我真的不介意。忘了吧!为什么不呢?重点是什么?你决定吧!)。根据回答中的“It’s up to you!”(你决定吧!),可以判断正确选项是D. It’s up to you!。这个回答表示对方并不在乎去哪里,认为决定权在于提问者, 因此D选项“It’s up to you!”(你决定吧!)是最符合的回答。其他选项如A. Forget it!(忘了吧!)、B. Why not?(为什么不呢?)和C. What’s the point?(重点是什么?)在回答中并没有明确体现出来。所以正确答案是D。”

测试代码demo

/**
 * 测试直接问答
 */

@Test
public void testAsk(){
    String question = "给出下列答案的正确选项:\n" +
        "Where shall we go for the holiday, to the park or to the school? –_ I don’t really mind. Forget it! Why not? What’s the point? It’s up to you! A.Forget it !\n" +
        "A.Forget it ! B.Why not ? C.What’ s the point ? D.It’ s up to you!";
    Pair<String, Response<AiMessage>> responsePair = ragService.ask(question, LLMConstants.ModelKey.QIANFAN_ERNIE_3_5_8K);

    Response<AiMessage> ar = responsePair.getRight();
    String questionText = responsePair.getLeft();

    int inputTokenCount = ar.tokenUsage().inputTokenCount();
    int outputTokenCount = ar.tokenUsage().outputTokenCount();

    log.info("question text:{}",questionText);
    log.info("ai response message:{}",ar.content());
    log.info("input token:{}",inputTokenCount);
    log.info("output token:{}",outputTokenCount);
}


/**
 * 测试RAG问答
 */
@Test
public void testRetrieveAndAsk(){
    String question = "给出下列答案的正确选项:\n" +
        "Where shall we go for the holiday, to the park or to the school? –_ I don’t really mind. Forget it! Why not? What’s the point? It’s up to you! A.Forget it !\n" +
        "A.Forget it ! B.Why not ? C.What’ s the point ? D.It’ s up to you!";
    Pair<String, Response<AiMessage>> responsePair = ragService.retrieveAndAsk(null, question, LLMConstants.ModelKey.QIANFAN_ERNIE_3_5_8K, 3, 0.6d);

    String questionText = responsePair.getLeft();
    Response<AiMessage> ar = responsePair.getRight();
    int inputTokenCount = ar.tokenUsage().inputTokenCount();
    int outputTokenCount = ar.tokenUsage().outputTokenCount();

    log.info("question text:{}",questionText);
    log.info("ai response message:{}",ar.content());
    log.info("input token:{}",inputTokenCount);
    log.info("output token:{}",outputTokenCount);

}

直接提问LLM输出


: llm answer 耗时 :16883 毫秒


# prompt

question text:尽可能准确地回答用户的问题,以下是用户的问题:


给出下列答案的正确选项:
Where shall we go for the holiday, to the park or to the school? –_ I don’t really mind. Forget it! Why not? What’s the point? It’s up to you! A.Forget it !
A.Forget it ! B.Why not ? C.What’ s the point ? D.It’ s up to you!
注意,回答的内容不能让用户感知到已知信息的存在


# ai response
ai response message:AiMessage { text = 
    "在对话中,“Where shall we go for the holiday, to the park or to the school?”询问的是关于假期去公园还是去学校的选择。回答“I don’t really mind. Forget it! Why not? What’s the point? It’s up to you!”表达的是说话者并不在乎去哪里,可以放弃选择,并认为选择去哪里并没有多大意义,最终将决定权交给了对方。
    根据这个回答,我们可以分析每个选项:
    A. "Forget it!" - 这个选项表达的是放弃选择的意思,与对话中的“I don’t really mind. Forget it!”相符。
    B. "Why not?" - 这个选项通常用于提出一个建议或选择,但在这里并没有明确的建议或选择与之对应。
    C. "What’s the point?" - 这个选项表达的是对某事的意义或目的的质疑,与对话中的“What’s the point?”相符,但这不是回答的核心内容。
    D. "It’s up to you!" - 这个选项表达的是将决定权交给对方,与对话中的“It’s up to you!”相符,并且这是回答的核心内容。
    综上所述,最符合对话内容和语境的答案是D. "It’s up to you!"。这个回答不仅与对话中的“It’s up to you!”直接对应,而且准确地表达了将决定权交给对方的含义。因此,正确选项是D。" toolExecutionRequests = null }

: input token:108
: output token:297

RAG提问LLM输出

OpenJDK 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended
2024-04-22T17:04:30.340+08:00  INFO 9940 --- [           main] scl.utils.MilvusUtils                    : query filter condition expression:(id == '71d1aeff-9920-4ef6-861d-851580bad111' || id == 'f22ee2b4-1eb9-490e-8c4f-b157e137de80' || id == '01c8bfd8-0362-4182-b407-c8356e04447f')
2024-04-22T17:04:30.763+08:00  INFO 9940 --- [           main] scl.utils.MilvusUtils                    : recall rowRecord fieldValues: {metadata={"index":"0","qid":"1566936461533184","courseId":"28","试题题型ID":"2803"}, eigen_values=[0.07091101, -0.0041972166, 0.066441506, -0.0035635938, 0.081386544, 0.0640172, 0.108017676, -0.054643556, 0.037722982, -0.023815865, 0.06163776, -0.056918807, 0.013414095, -0.032453265, 0.06796127, 0.053777058, -0.010577296, 0.056933686, -0.04524725, -0.0011801354, 0.019920498, -0.02709577, -0.030314432, 0.025412377, -0.043896817, -0.06352252, -0.022586646, 0.039180268, 0.001720015, 0.027795712, -0.07113, 0.09052912, -0.10741309, 0.053848114, 0.020921914, 0.05395399, 0.0093051735, -0.13184606, 0.04377727, 0.014681368, -0.04913031, -0.001187413, 0.04488247, -0.04836739, 0.045956783, 0.025684817, 0.023040244, 0.008345577, 0.03645673, -0.058029074, -0.015791904, 0.043881524, -0.0851162, -0.023385791, 0.026458442, 0.03855828, -0.061711434, -0.06544183, 0.044551395, -0.012634066, -0.056899212, -0.014478533, 0.041719705, 0.026560044, -0.07242597, -0.047714394, -0.023346692, 0.051098254, 0.054778833, 0.11748073, -0.08319796, 0.025703302, 0.018706156, -0.010477543, -0.120293446, -0.07256499, -0.025765678, -0.019519597, 0.0015837247, -0.033005655, -0.017236337, -0.051606387, 0.076625116, 0.019966772, -0.07909408, 0.045481082, -0.063483045, -0.027004158, 0.00653777, -0.008874071, 0.024459327, -0.01765289, 0.025207836, 0.07368304, -0.016138, 0.065127686, -0.06243371, -0.031658784, -0.103567354, 0.0121468315, 0.08317814, 0.052937683, -0.033613496, -0.018531686, -0.042379513, -0.031989127, -0.0720641, 0.028360134, 0.06387176, -0.046883762, -0.014010364, -0.023385175, 0.04482844, -0.06300163, -0.041014027, 0.04487298, -0.011484165, -6.0304994E-4, -0.048054017, 0.013949337, -0.040118217, 0.066118926, -0.062289987, -0.015339347, -0.066483214, -0.17037882, 0.12093453, 9.8487665E-34, -0.020932531, 0.047987524, 0.014110831, -0.06681867, 0.028095216, 0.010220987, -0.041255012, 0.009562793, -0.06308919, 0.00593788, 0.10949687, -0.08891408, -0.031599626, -0.013542291, -0.045565005, 0.032027796, -0.046132114, -0.008850605, 0.062086295, 0.018398298, 0.030925902, 0.01764306, 0.01121084, 0.044715367, -0.044272408, -0.030639382, 0.092948444, 0.041781824, 0.039294116, 0.035911273, -0.08531273, 0.024217824, -0.0016687905, -0.03575227, 0.013261927, -0.010146077, -0.035330165, 0.009833115, -0.056215145, -0.060339633, -0.028363744, 0.005470755, -0.098889366, 0.05384967, 7.24565E-4, 0.009112273, 0.066173725, -0.059279386, -0.0029131423, -0.05061183, 0.020052992, 0.038279925, 0.0029042603, 0.022239996, 0.08093511, -0.08628243, -0.011649979, 0.017301297, -0.05287461, -0.061636988, 0.0472893, -0.116667844, -0.008557578, 0.020763304, -0.028121032, -0.0017005728, 2.860344E-4, 0.017089125, 0.04295883, -0.07167035, 0.011807581, 0.03858602, -0.05667576, -0.005984965, 0.016789027, 0.004777505, 0.0032647944, 0.009114041, 0.022772627, -0.0384224, -0.015686812, -0.049260706, -0.021630649, 0.04971613, -0.061496355, -0.027551142, 0.123971984, 0.02604017, -0.013647234, 0.03791004, -0.12150385, -0.01503662, 0.044248387, 0.026616232, 0.012082509, -5.825152E-33, 0.0036881827, 0.08254246, -0.035484537, -0.048528574, 0.011035946, -0.018058699, 0.043367542, -0.076083615, 0.060727023, 0.064721406, -0.13492489, -0.062428646, -0.03877538, 0.020861043, -0.03029519, 0.0137147205, 0.027407562, -0.021012913, -0.096229784, 0.049495608, -0.06273127, 0.051337887, -0.05037985, 0.028297177, -0.07883384, 0.1135855, -0.032096405, -0.036632933, -0.031432565, -0.008271221, -0.008182273, -0.009252863, -0.027438698, 0.06834286, -0.015434873, -0.005187127, 0.028457085, -0.046695214, 0.0054133534, 0.06924362, 0.07917581, 0.007113182, -0.069232866, 0.0061513344, -0.0077411355, -0.0052577034, -0.025324343, -0.031629983, -0.0024252718, -0.0013306183, -0.021460146, -0.01650708, -0.045784548, -0.075973436, 0.06674542, 0.0068431934, 0.032665826, -0.047351096, 0.033236634, -0.06635442, 0.038822267, 0.035295404, 0.02916547, 0.0041528735, -0.045568604, 0.07384258, 0.044066496, 0.08304709, 0.09585482, -0.0047269776, -0.0034082513, 0.047460727, -0.042483687, -0.005174991, -0.078659296, 0.10472818, 0.098762825, -0.009037899, -0.0131373145, -0.040587053, 0.013106264, -0.017893469, 0.013859676, 0.0051665106, -0.013059181, 0.019444566, 0.028562315, 0.07571482, -0.029856814, 0.01564038, -0.013151025, -0.013242532, -0.007279363, -0.034695964, -0.010492471, -4.6873794E-8, -0.024294544, -0.011577614, -0.0036289652, -0.07206588, -0.035236415, -0.16362838, -0.007278321, 0.06784172, 0.08941505, -0.023811266, 0.009788585, -0.045010544, -0.12429794, 0.067158, -0.04232939, 0.051227387, -0.06713169, -0.04318576, 0.016588654, -0.037747063, -0.038981352, 0.014241084, -0.022805711, -0.06601609, -0.032599684, 0.031323418, -0.031079577, 0.05465914, -0.00857536, 0.0088618025, 0.06276358, -0.03015093, -0.13549678, -0.0475893, -0.02390425, -0.07991448, 0.06479383, -0.07690362, 0.039208956, -0.05521115, 0.017942967, -0.07076963, 0.027517227, 0.06368147, 0.02511424, -0.05715514, 0.12140323, -0.021903025, -0.044957284, 0.022752061, -0.13343954, -0.054787997, 0.03953726, -0.01804671, 0.013260945, 0.03613257, -0.032670166, 0.010857566, -0.035597432, 0.018633353, -0.012930256, 0.045098096, -0.06961429, 1.5964953E-4], distance=0.6631622, id=71d1aeff-9920-4ef6-861d-851580bad111, content=【题干】:–Where shall we go for the holiday, to the park or to the cinema? –_ I don’t really mind. Forget it! Why not? What’s the point? It’s up to you!;【答案】:4;【解析】:试题分析:考查交际用语。句意:我们假期去哪啊?公园还是电影院?你决定吧!我不介意。A. Forget it!忘了吧!B. Why not?为什么不呢?C. What’s the point? 重点是什么?D. It’s up to you!你决定吧!根据句意可知选D。 考点:考查交际用语}
2024-04-22T17:04:30.771+08:00  INFO 9940 --- [           main] scl.utils.MilvusUtils                    : recall rowRecord fieldValues: {metadata={"index":"0","qid":"1566951730495488","courseId":"28","试题题型ID":"2803"}, eigen_values=[0.023659779, 0.036747497, 0.09589001, -0.03245045, 0.086715996, 0.004561368, 0.069355346, -0.04861114, 0.023725556, -0.0021257494, 0.052492414, -0.100312576, -0.008047376, -0.031259682, 0.043501303, 0.023283156, 0.063403, -0.007016361, -0.06388855, 0.022874156, -0.058268514, 0.0057885237, 0.060931288, 0.0772821, -0.014976302, -0.03117638, -0.013733214, -3.9893933E-4, -0.019729575, 0.059061743, -0.12660284, 0.025487082, 0.028204957, 0.02023005, 0.051060375, 0.0663493, 0.046850774, -0.09886315, 0.046224058, 0.0021350896, 0.0030385312, -0.06786146, 0.008137197, 0.037679497, -0.009517801, -2.7558565E-4, -0.04027721, -0.034475762, 0.035269007, 0.01377802, -0.031931914, 0.045927536, -0.08299027, -0.035857603, 0.094207786, 0.14387311, -0.035258714, 0.021992134, 0.04083504, -0.027362952, -0.09105333, 0.022751296, 0.008612684, 0.034434244, 0.035626467, -0.053605482, -0.060078476, 0.04116379, -0.0075863204, 0.11858443, -0.036400907, -0.0075774095, -0.06231167, 0.0414516, -0.054554027, -0.10511192, 0.085541815, 0.034815278, 0.036565647, -0.031712428, -0.046106115, -0.038158525, 0.033330142, 0.043233074, -0.07592911, -0.031039672, -0.03771228, 0.0669639, 0.039018597, -0.0355558, 0.019980628, 0.0010823437, -0.01299236, 0.057200205, -0.02626564, 0.0908492, -0.09246992, -0.028551731, -0.03370807, 9.926945E-4, 0.0446877, 0.058322392, -0.027332583, -4.0638284E-4, -0.06727561, -0.039138798, -0.031365536, -0.012630427, 0.04011253, 0.051306132, 0.002243118, -0.0942368, 0.040492963, -0.08483629, -0.0044048503, 0.12540844, -0.02161151, 0.039798565, -0.025355881, 0.041635733, -0.031075746, 0.037150223, -0.05199315, -0.036607448, -0.08481067, -0.09593895, 0.12333102, -4.754627E-33, 0.0021651427, -0.034633204, 0.01142306, 0.011322477, -0.012714596, -0.04695282, 0.058232557, -9.0005406E-4, -0.055626493, 0.011982506, 0.009152396, -0.039121803, -0.12892367, -0.0044056484, -0.06530625, -0.04075577, 0.019502439, 0.012062223, 0.042438447, 0.045150194, 0.064986534, -0.063960396, -0.014032219, 0.04559601, 0.017254127, -0.013185053, 0.02456694, -0.03265335, -2.3884722E-4, 0.042374097, -0.05619478, 0.0043183547, -0.056483418, -0.07249368, -0.063411355, -0.026617441, -0.03623633, 0.013990037, -0.020101095, -0.0411341, -0.06404381, 0.029624596, -0.048946895, -0.06016256, 0.010089184, -7.629567E-4, -0.017481595, -0.06179466, -0.022494828, -0.049656224, -0.02752846, 0.007914722, 0.02538599, -0.035739474, 0.0088033145, -0.026711375, -0.02954586, -0.054415554, -0.05942735, -0.03812943, 0.04451044, -0.064891055, -0.007843003, 0.025988093, -0.059215475, 0.03677892, -0.034280308, 0.0136455195, 0.09698184, -0.086307876, -0.07633833, 0.077716604, -0.10638731, 0.03571385, -0.0053186095, -0.0016870475, 0.010351068, -0.08646835, -0.0050306604, -0.00956903, 0.04309543, -0.0111344615, -0.033280976, -0.021935638, 0.03975372, 0.040395673, 0.06277576, 0.0042761615, -0.0059545026, 0.044102274, -0.16401634, -0.01403279, 0.036131714, 0.03848661, -0.044018406, -1.7779049E-33, 0.078787245, 0.014220739, -0.07390516, -0.015836632, 0.013440777, -0.041969337, 0.045312125, 0.03729598, 0.05581588, 0.06552899, -0.12703755, -0.07207813, -0.02073337, -0.042949334, 0.008412438, 0.057371244, 0.054449383, -0.0016281033, -0.02430603, 0.040991526, -0.033144504, -0.009649028, -0.06547762, -0.008800207, -0.13061978, 0.06443863, 0.01986541, -0.024921954, -0.05010588, 0.041285332, 0.011520474, -0.059452124, -0.06486796, 0.107241035, -0.014681121, -0.023111722, 0.023743773, -0.046089925, -0.04812641, 0.032171566, 0.10016414, -0.012976512, -0.04554282, 7.0734834E-4, 0.008919019, 0.010396455, 0.009134224, -0.078842476, -0.09137848, -0.027456446, 0.027271159, -0.04563738, -0.010891432, -4.5467194E-4, 0.04856231, 0.002636905, 0.03990814, -0.037569385, 0.024578972, -0.08925055, -0.017203748, 0.07650726, 0.0012281972, 0.016197985, -0.03342841, 0.1067545, 0.0048515126, 0.0022035735, 0.032619927, -0.030233346, -0.027746499, 0.059152097, -0.037887525, 0.023680957, -0.078659244, 0.06819627, 0.072058775, 0.0075501716, 0.006715464, 0.0059013073, 0.010211345, 0.041642394, -0.046689205, 0.063826166, -0.012749295, -0.007198046, 0.05449844, 0.07565448, -0.03504002, -0.0260056, 0.047617596, 0.026607806, 0.0024319217, 0.022396319, 0.04304243, -4.697621E-8, 0.03588926, -0.024171552, -0.05846597, -0.074289136, -0.010261465, -0.06384459, -0.031913843, -0.01569536, 0.0949468, -0.116975956, 0.044671677, -0.042903334, -0.0023984578, 0.056323107, -0.043955535, 0.034025356, -0.031282265, -0.08235814, 0.0024620271, -0.03454311, -0.05107711, 0.055813253, -0.023995055, -0.035400923, -0.011281708, 0.04410961, -0.09223159, 0.022755131, -0.05475158, 0.0024384258, 0.039397307, -0.0046250783, -0.10070415, -0.018766472, 0.046442453, -0.048546437, 0.09076395, -0.109403156, 0.018414887, -0.029282931, -0.0039690007, -0.0743789, 0.029234963, 0.04665792, 0.06749573, -0.08522756, 0.076062076, -0.019783497, -0.07740849, -0.004406081, -0.05188133, -0.04335709, 0.05957704, -0.048483647, 0.07042317, 0.078580014, -0.07712706, -0.0094199, 0.001035436, 0.012949896, 0.06623334, 0.06888126, -0.069240205, 0.00906566], distance=0.56825197, id=f22ee2b4-1eb9-490e-8c4f-b157e137de80, content=【题干】:— What do you want to do next? We have half an hour until the basketball game. — _. Whatever you want to do is fine with me. It’s up to you Glad to hear that You can’t miss it It just depends;【答案】:1;【解析】:试题分析:考察交际。文意是接下来你打算做什么,距离篮球比赛还有一个半小时。下文是你和我做什么都是好的。It’s up to you取决于你; Glad to hear that很高兴听到这些;You can’t miss it你不能错过它;It just depends视情况而定;文意是接下来你打算做什么,距离篮球比赛还有一个半小时。下文是你和我做什么都是好的。可知此处由你来定,所以答案是A。 考点:考察交际。}
2024-04-22T17:04:30.772+08:00  INFO 9940 --- [           main] scl.utils.MilvusUtils                    : recall rowRecord fieldValues: {metadata={"index":"0","qid":"1566937344573440","courseId":"28","试题题型ID":"2803"}, eigen_values=[-0.0011419613, 0.030432004, 0.110222384, 0.045762654, 0.097584076, -0.018672973, 0.11127557, -0.038199678, 0.0140072815, -0.045626853, 0.14398691, -0.15042669, -0.0020982765, -0.031242562, 0.053242575, 0.06286053, -0.026396053, 0.08798832, -0.03978167, 0.038732212, -0.0387769, 0.011892646, 0.020295704, 0.04573425, 0.027785555, -0.05381151, 0.049570605, -0.01412923, 0.019439213, 0.053677283, -0.07446897, 0.010843186, -0.060368318, 0.067808166, 0.056570493, 0.04375407, 0.047951896, -0.09575823, 0.0301443, 0.019176476, -0.06631508, -0.087532975, 0.0027613875, -0.052440103, 0.034509942, -0.0027307894, -0.03324791, 0.02412971, 0.023191027, -0.035471566, -0.022979325, 0.007252051, -0.12864505, -0.011459614, 0.08395867, 0.04011828, -0.053712286, 0.027283948, -0.010647939, -0.05213526, -0.09342881, 6.025731E-4, 0.05097748, 0.0017237011, -0.037444808, 0.030106733, -0.067895696, 0.043621898, 0.08775906, 0.13225415, -0.07662556, 0.029404968, -0.07481403, 8.2898006E-4, -0.10485766, -0.08512472, 0.059000444, 0.0063539622, -0.0089168595, -0.0034170265, -0.09682202, -0.0045665125, 0.057232548, 0.050996587, -0.07535125, 0.025075546, -0.100619026, -0.005735343, -0.014722452, -0.026920905, 0.025853502, 0.069395885, -0.023023853, 0.01845906, -0.053166095, 0.028245324, -0.09061364, -0.039521385, -0.04327351, 0.038824897, 0.051157203, 0.054882143, -0.04557147, 0.04165604, -0.043237265, -0.04351316, -0.027576683, -0.042850845, 0.047407925, 0.02335267, 0.041639816, -0.12916571, 0.01790899, -0.15354745, -0.11183823, 0.06499708, -0.05629799, 0.0050655757, 0.017665792, -0.01410669, -0.04202776, 0.0048233345, -0.015352643, -0.047120377, -0.039352078, -0.10916735, 0.14583457, -3.08777E-33, -0.027699811, -0.009403804, 0.006323189, -0.036201853, -0.029393345, -0.030257829, -0.013622595, -0.031029712, -0.069770634, 0.02357773, 0.024623927, -0.06409843, -0.035334785, -0.0027481995, -0.020375183, 0.0028160396, 0.045580816, -0.025115652, 0.058558192, 0.059663266, 0.1262906, -0.003654393, -0.017076984, 0.056127086, 0.013438195, -0.044046413, 0.047020182, 0.014253523, 0.031620994, 0.051766258, -0.043875795, -0.015382732, -0.04339933, -0.02049348, -0.02369828, -0.014315972, -0.027223995, 0.030323392, -0.024320075, -0.03237254, -0.039856803, -0.014517813, 0.028045097, -0.035385974, -0.026256192, 0.032476023, 0.008472675, -0.060786143, -0.015366898, -0.09111347, -0.019454611, 0.055292465, 0.0062581045, 0.0663212, 0.07415831, -0.07773652, -0.049148526, -0.0030135373, -0.008733838, -0.037789907, 0.045167502, -0.05592534, -0.019544316, 0.008663905, -0.026082799, -0.035006445, -0.033696536, -0.0043597827, 0.074881226, -0.10203698, -0.035331197, -0.002110658, -0.038238924, -0.030204859, -0.059263304, -0.02861379, -0.009448823, 0.003036691, 0.066729054, -0.061814453, -0.00891547, -0.011472471, -0.06501846, 0.05076407, 0.015323366, 0.041962825, 0.032431822, -0.052066643, -0.07616986, 0.028940994, -0.123164125, 0.05409903, 0.014652141, 0.0034400164, -0.032608315, -3.1346908E-33, 0.058426093, 0.1358997, -0.026573444, -0.09688864, -0.008565524, -0.029479291, 0.06302128, 0.017147096, 0.073808394, 0.05316854, -0.09967756, -0.09391617, 0.0052946853, -0.008383359, -0.037801594, 0.07948134, 0.030824013, 0.021010768, -0.024342595, 0.053607948, -0.08716814, 0.020897446, -0.11128172, 0.008347343, -0.042931065, 0.031786412, 0.08588472, -0.039565023, -0.039388135, 0.026487496, 0.03118214, -0.014757706, -0.043056652, 0.099933095, -0.058539703, -0.011434625, 0.00806072, -0.021928705, -0.045742873, 0.04878902, 0.08036424, -0.020470664, 0.012943376, 0.031273257, -0.028913802, 0.026876891, -0.052982748, -0.06914704, -0.05928233, -0.01846084, -0.0014928718, 0.024046918, -0.029802566, -0.015551265, 0.040346615, -0.026076855, 0.017917046, -0.040513385, 0.028988425, -0.09613111, 0.029871307, 6.4181216E-4, 0.0082692895, 0.034185324, -0.044318, 0.01770076, 0.0066650487, 0.036484297, 0.059109267, -0.06505474, 0.0085405875, 0.019599011, 0.004634782, 0.014439114, -0.016298871, 0.035512835, 0.040901378, -0.0147676, 0.009285512, -0.027094012, -0.019435873, -0.023206796, -0.030157382, 0.017098272, -0.069021195, -0.013668419, 0.01683613, 0.072963744, -0.04331488, 0.030494692, -0.0052665267, 0.009923069, 0.022519432, 0.021247583, -0.048272777, -4.4155723E-8, 6.480966E-4, -0.04625109, 0.0036897177, -0.09348787, 0.01231332, -0.063383184, -0.008596998, 0.04033134, 0.062480666, -0.059743278, 0.0376517, 0.019887464, -0.11355272, -0.017404046, -0.032611, 0.06214709, -0.035455413, -0.03906425, 0.016576676, -0.04352112, -0.044382986, 0.038988676, -0.04148092, -0.047667723, -0.0021963334, 0.08982049, -0.04108857, -0.010879231, -0.05244611, 0.014811304, 0.0183133, 0.012296689, -0.09960993, -0.025807071, -0.022655472, 0.0041599823, 0.03552629, -0.019500406, 0.022701975, -0.028116554, -0.003407756, -0.054954614, 0.007338212, 0.055948205, 0.018959949, -0.0397476, 0.14155556, -0.031256683, -0.04288058, 0.01405051, -0.05915122, -0.074609876, 0.032039624, -0.032719914, -0.008589911, 0.076495245, 0.02727713, 0.041509777, -0.00879321, 0.032889854, 0.111440934, 0.04684015, -0.03539317, -0.0019615826], distance=0.55670863, id=01c8bfd8-0362-4182-b407-c8356e04447f, content=【题干】:- Would you like to go hiking with me, Susan? - I’d like to, _ you don‟t want to go alone. until before if after;【答案】:3;【解析】:试题分析: 句意:—Susan,和我去徒步旅行怎么样?—好的,如果你不想独自一人去。根据you don‟t want to go alone可知本句表示条件。故C正确。 考点:考查状语从句}
2024-04-22T17:04:30.773+08:00  INFO 9940 --- [           main] scl.langchain4j.rag.RAGService           : --------------------------- recall data item -----------------------------

2024-04-22T17:04:30.773+08:00  INFO 9940 --- [           main] scl.langchain4j.rag.RAGService           : Relevant embedding: 【题干】:–Where shall we go for the holiday, to the park or to the cinema? –_ I don’t really mind. Forget it! Why not? What’s the point? It’s up to you!;【答案】:4;【解析】:试题分析:考查交际用语。句意:我们假期去哪啊?公园还是电影院?你决定吧!我不介意。A. Forget it!忘了吧!B. Why not?为什么不呢?C. What’s the point? 重点是什么?D. It’s up to you!你决定吧!根据句意可知选D。 考点:考查交际用语
2024-04-22T17:04:30.773+08:00  INFO 9940 --- [           main] scl.langchain4j.rag.RAGService           : Score: 0.8315810859203339
2024-04-22T17:04:30.773+08:00  INFO 9940 --- [           main] scl.langchain4j.rag.RAGService           : embeddingId: 71d1aeff-9920-4ef6-861d-851580bad111
2024-04-22T17:04:30.773+08:00  INFO 9940 --- [           main] scl.langchain4j.rag.RAGService           : --------------------------- recall data item -----------------------------

2024-04-22T17:04:30.773+08:00  INFO 9940 --- [           main] scl.langchain4j.rag.RAGService           : Relevant embedding: 【题干】:— What do you want to do next? We have half an hour until the basketball game. — _. Whatever you want to do is fine with me. It’s up to you Glad to hear that You can’t miss it It just depends;【答案】:1;【解析】:试题分析:考察交际。文意是接下来你打算做什么,距离篮球比赛还有一个半小时。下文是你和我做什么都是好的。It’s up to you取决于你; Glad to hear that很高兴听到这些;You can’t miss it你不能错过它;It just depends视情况而定;文意是接下来你打算做什么,距离篮球比赛还有一个半小时。下文是你和我做什么都是好的。可知此处由你来定,所以答案是A。 考点:考察交际。
2024-04-22T17:04:30.773+08:00  INFO 9940 --- [           main] scl.langchain4j.rag.RAGService           : Score: 0.7841259837150574
2024-04-22T17:04:30.773+08:00  INFO 9940 --- [           main] scl.langchain4j.rag.RAGService           : embeddingId: f22ee2b4-1eb9-490e-8c4f-b157e137de80
2024-04-22T17:04:30.773+08:00  INFO 9940 --- [           main] scl.langchain4j.rag.RAGService           : --------------------------- recall data item -----------------------------

2024-04-22T17:04:30.773+08:00  INFO 9940 --- [           main] scl.langchain4j.rag.RAGService           : Relevant embedding: 【题干】:- Would you like to go hiking with me, Susan? - I’d like to, _ you don‟t want to go alone. until before if after;【答案】:3;【解析】:试题分析: 句意:—Susan,和我去徒步旅行怎么样?—好的,如果你不想独自一人去。根据you don‟t want to go alone可知本句表示条件。故C正确。 考点:考查状语从句
2024-04-22T17:04:30.773+08:00  INFO 9940 --- [           main] scl.langchain4j.rag.RAGService           : Score: 0.7783543169498444
2024-04-22T17:04:30.773+08:00  INFO 9940 --- [           main] scl.langchain4j.rag.RAGService           : embeddingId: 01c8bfd8-0362-4182-b407-c8356e04447f
2024-04-22T17:04:30.775+08:00  INFO 9940 --- [           main] scl.langchain4j.rag.RAGService          

: recall 耗时 :1339 毫秒
: llm answer 耗时 :16931 毫秒

#  prompt
question text:
根据以下已知信息:
【题干】:–Where shall we go for the holiday, to the park or to the cinema? –_ I don’t really mind. Forget it! Why not? What’s the point? It’s up to you!;【答案】:4;【解析】:试题分析:考查交际用语。句意:我们假期去哪啊?公园还是电影院?你决定吧!我不介意。A. Forget it!忘了吧!B. Why not?为什么不呢?C. What’s the point? 重点是什么?D. It’s up to you!你决定吧!根据句意可知选D。 考点:考查交际用语

【题干】:— What do you want to do next? We have half an hour until the basketball game. — _. Whatever you want to do is fine with me. It’s up to you Glad to hear that You can’t miss it It just depends;【答案】:1;【解析】:试题分析:考察交际。文意是接下来你打算做什么,距离篮球比赛还有一个半小时。下文是你和我做什么都是好的。It’s up to you取决于你; Glad to hear that很高兴听到这些;You can’t miss it你不能错过它;It just depends视情况而定;文意是接下来你打算做什么,距离篮球比赛还有一个半小时。下文是你和我做什么都是好的。可知此处由你来定,所以答案是A。 考点:考察交际。

【题干】:- Would you like to go hiking with me, Susan? - I’d like to, _ you don‟t want to go alone. until before if after;【答案】:3;【解析】:试题分析: 句意:—Susan,和我去徒步旅行怎么样?—好的,如果你不想独自一人去。根据you don‟t want to go alone可知本句表示条件。故C正确。 考点:考查状语从句
尽可能准确地回答用户的问题,以下是用户的问题:

给出下列答案的正确选项:
Where shall we go for the holiday, to the park or to the school? –_ I don’t really mind. Forget it! Why not? What’s the point? It’s up to you! A.Forget it !
A.Forget it ! B.Why not ? C.What’ s the point ? D.It’ s up to you!

注意,回答的内容不能让用户感知到已知信息的存在


# ai回答
ai response message:AiMessage { text = 
  "对于这个问题,“Where shall we go for the holiday, to the park or to the school?”
  (我们假期去哪儿,去公园还是去学校?),回答是“I don’t really mind. Forget it! Why not? What’s the point? It’s up to you!”
  (我真的不介意。忘了吧!为什么不呢?重点是什么?你决定吧!)。
  根据回答中的“It’s up to you!”(你决定吧!),可以判断正确选项是D. It’s up to you!。这个回答表示对方并不在乎去哪里,认为决定权在于提问者,
  因此D选项“It’s up to you!”(你决定吧!)是最符合的回答。
  其他选项如A. Forget it!(忘了吧!)、B. Why not?(为什么不呢?)和C. What’s the point?(重点是什么?)在回答中并没有明确体现出来。
  所以正确答案是D。" toolExecutionRequests = null }

: input token:508
: output token:190

效果测试CASE2

BAD CASE 试题ID:1922726081847296

Adults, __overly concerned with fame and fortune, sometimes fail to see the joy in simple things __ children do not.、
A.unless … but
B.although … and
C.when … where
D.even if … unless

正确的答案和解析

正确的答案为:C,解析:考查状语从句和定语从句。句意:当成年人过度关注名利时,有时看不到简单事物中的快乐,而孩子们则不会如此。A. unless … but 除非…… 但是;B. although … and 尽管……和;C. when … where 时候…… 哪里;D. even if … unless甚至……除非。分析句子结构及结合句意可知,该句主句是 Adults, sometimes fail to see the joy in simple things,其中间是一个时间状语从句,后面是一个定语从句;其中,时间状语从句省略句表示“当成年人过度关注名利时”,应该用连接副词when引导;定语从句(simple things ________ children do not fail to see the joy)中先行词是simple things,在从句中做地点状语,应该用关系副词where引导。故选C项。

ERNIIR-3.5

直接向ERNIE-3.5 解答,结果回答错误

【答案】:B.although … and
【解析】:本题考查的是连词的用法。"although"用于表示尽管,“and"用于连接两个并列的句子。所以"B.although … and"是正确的选项。句子的意思是"尽管成年人过于关注名利,他们有时候无法看到简单事物中的快乐,而孩子们却可以。”

使用ERNIR-3.5 RAG解答,解答正确

“答案为 C.when … where
这句话的意思是:成年人,当过度关注名利时,有时会看不到孩子们所不知道的简单事物的乐趣,第一空when引导时间状语从句,表示“当……的时候”,第二空where引导地点状语从句,表示“在……的地方”,故选C。”

ps:召回的相似试题top3

1、Relevant embedding:
【题干】:_ some people are motivated by a need for success, others are motivated by a fear of failure. Because If Unless While;【答案】:4;【解析】:考查连词。句意:有些人的动力来自对成功的需要,而有些人的动力来自对失败的恐惧。because因为;if如果;unless除非;while尽管;然而;当……时。此处表示对比,相当于whereas,译作“而”。故选D项。连词while有以下不同的作用和含义: 一、引导时间状语从句时, 译作"当……时"。如: 1. Make hay while the sun shines. 烈日当空照,勿忘晒干草。(乘机行事,抓紧时机。) 2. We must work hard to gain more knowledge while we are young. 趁着我们年轻,我们必须刻苦学习,获得更多的知识。 二、引导让步状语从句 。 常放在句首,译作"尽管"、“虽然”,比although或 though语气要轻。如: While I believe it is true, I cannot prove it. 虽然我相信那是真的,但我无法证明。 三、引导条件状语从句 。 相当于as long as,译作"只要"。如: 1. While there is life, there is hope.只要有生命,就有希望。 2. While a spark of life remains, it is a doctor’s duty to save the patient. 只要病人有一息生机,医生就有责任救他。 四、引导原因状语从句 。 相当于since,有"既然"的意思。如: 1. You’ll never save any money while you’re so extravagant. 你这么奢侈,永远存不下钱来。 2. I’d like to get it settled today while we’re at it. 既然我们着手干了,我想今天就把它干完。 五、连接并列句 。 表示对比,相当于whereas,译作"而"、“可是”。 如: 1. An outdoors man will soon become pale if he changes to an indoor job, while a desk clerk will take on a tan after a short vacation in the sun. 从事室外工作的人如果调到室内工作,不久肤色就会变白;而一个伏案工作的文员出去度个短假,就会被太阳晒黑。 2. Motion is absolute while stagnation is relative. 运动是绝对的,而静止是相对的。 六、连接并列句 表示递进,相当于and what is more, 译作"并且"、“而且”。如: 1.The new man-made fibres are more hardwearing than natural fibres and greatly reduce mending, while good ready-made clothes are cheap and plentiful. 新的人造纤维比天然纤维耐磨,因此能大大减少修补工作,而且做好的衣服价廉物美,数量也多。 【此处有音视频】
Score: 0.7288281619548798
embeddingId: bfb6118a-eb57-4c50-addc-6bce29fe8273

2、Relevant embedding:
【题干】:The girl is sure to become a good actress _ she gets the right training. until if although unless;【答案】:2;【解析】:试题分析:本题考查状语从句。句意:如果这个女孩得到正确的训练,她一定能成为一个好演员。A until 译为“到…为止; 直到…才”;B if 译为“如果”;C although 译为“虽然;尽管”;D unless 译为“如果不;除非”, 根据句意, 选择B。 考点:考查状语从句

Score: 0.7259715497493744
embeddingId: 710aa686-8ac0-42ae-b16d-e068a4c743c5

3、Relevant embedding:
【题干】:_ my father doesn’t say a lot in daily life, he gives me much love and affection. Because When Although If;【答案】:3;【解析】:本题考查连词的用法,Because由于;When当;Although尽管;If如果。根据句意,可知选C。句意:尽管我的父亲在日常的生活中不多话,但他给了我很多爱。

Score: 0.7121817767620087
embeddingId: 5f5e8a84-61e6-4219-8c36-2163f696b858

Azure base4

多情况测试对比

  • 直接解答:原题解答错误
  • 直接解答:变试题解答错误
  • 知识库存在该该试题,原题RAG解答:解答正确
  • 知识库存在该该试题,相似题RAG解答:解答正确

直接解答,原题解答错误

Adults, __overly concerned with fame and fortune, sometimes fail to see the joy in simple things __ children do not.、
A.unless … but
B.although … and
C.when … where
D.even if … unless

【答案】:B.although … and
【解析】:这是一个英语填空题,需要根据句子的语境和逻辑关系选择合适的词填空。首先,"Adults, __overly concerned with fame and fortune, sometimes fail to see the joy in simple things __ children do not."这句话的意思是"成年人,过于关注名利,有时无法看到简单事物的乐趣,而孩子们却能看到。"根据这个意思,我们可以排除A和D选项,因为unless和even if在这里都不符合语境。然后,我们再比较B和C选项,可以看出although和and更能表达这个意思,因为although可以表示尽管成年人过于关注名利,但他们有时还是无法看到简单事物的乐趣,而and可以连接成年人和孩子们的行为,表达出他们在看待简单事物的乐趣上的不同。所以,正确答案是B.although … and。

直接解答,相似题解答错误

Children, __often fascinated by nature and animals, can learn valuable lessons __ spending time outdoors. A.unless … but B.although … and C.when … where D.even if … unless

【答案】:B.although … and
【解析】:这是一个英语填空题,考察的是连词的用法。在这个句子中,"Children"是主语,"can learn valuable lessons"是谓语,"often fascinated by nature and animals"和"spending time outdoors"是两个并列的状语。"although"用于引导让步状语从句,表示"尽管"的意思,"and"用于连接两个并列的状语。所以,选项B是正确的。

RAG,原题解答正确

Adults, __overly concerned with fame and fortune, sometimes fail to see the joy in simple things __ children do not.、
A.unless … but
B.although … and
C.when … where
D.even if … unless
【答案】:C;
【解析】:考查状语从句和定语从句。句意:当成年人过度关注名利时,有时看不到简单事物中的快乐,而孩子们则不会如此。A. unless … but 除非…… 但是;B. although … and 尽管……和;C. when … where 时候…… 哪里;D. even if … unless甚至……除非。分析句子结构及结合句意可知,该句主句是 Adults, sometimes fail to see the joy in simple things,其中间是一个时间状语从句,后面是一个定语从句;其中,时间状语从句省略句表示“当成年人过度关注名利时”,应该用连接副词when引导;定语从句(simple things _ children do not fail to see the joy)中先行词是simple things,在从句中做地点状语,应该用关系副词where引导。故选C项。

RAG,相似题目解答正确

Children, __often fascinated by nature and animals, can learn valuable lessons __ spending time outdoors. A.unless … but B.although … and C.when … where D.even if … unless

【答案】:C;
【解析】:考查状语从句和定语从句。句意:当孩子们经常被大自然和动物吸引时,他们可以在户外度过的时间中学习宝贵的经验。A. unless … but 除非…… 但是;B. although … and 尽管……和;C. when … where 当……在哪里;D. even if … unless即使……除非。分析句子结构及结合句意可知,该句主句是 Children, can learn valuable lessons,其中间是一个时间状语从句,后面是一个定语从句;其中,时间状语从句省略句表示“当孩子们经常被大自然和动物吸引时”,应该用连接副词when引导;定语从句(spending time outdoors)中先行词是valuable lessons,在从句中做地点状语,应该用关系副词where引导。故选C项。"

效果测试CASE3

BAD CASE 试题ID:2466657146732545

Man may disappear________ other creatures who became too specialized to survive their environment.
A.as
B.just as
C.as if
D.as have
【答案】: D
【解析】:考查倒装语序。句意:人们可能会像其他太依赖于在它们自己的环境存活的生物一样消失。这里as引导方式状语从句,从句结构不完整,主语是other creatures(其它生物),后面的定语从句是修饰主语的,other creatures缺失谓语动词,那么这里用到的就是倒装。正常语序应该是Other creatures who became too specialized to survive their environment have disappeared。(其他太依赖于在它们自己的环境存活的生物已经消失了。),这里把have提前,因为和前面的句子有同样的谓语动词,所以进行了省略,避免重复,故选D。

Azure GPT4

直接解答,原题解答错误

Man may disappear________ other creatures who became too specialized to survive their environment.
A.as
B.just as
C.as if
D.as have

【答案】:B.just as;
【解析】:这是一道考查英语语法的题目,题目中的空格需要填入一个合适的词或短语,使得句子在语法和语义上都是正确的。选项A “as"的意思是"作为”,选项C “as if"的意思是"好像”,选项D “as have"的意思是"如同有”,这三个选项在语义上都无法使句子完整。而选项B “just as"的意思是"正如”,符合句子的语境,所以正确答案是B。句子的意思是"人类可能会像那些过于专门化以至于无法适应环境的生物一样消失"

RAG,原题解答正确

Man may disappear________ other creatures who became too specialized to survive their environment.
A.as
B.just as
C.as if
D.as have

【答案】:D;
【解析】:考查倒装语序。句意:人们可能会像其他太依赖于在它们自己的环境存活的生物一样消失。这里as引导方式状语从句,从句结构不完整,主语是other creatures(其它生物),后面的定语从句是修饰主语的,other creatures缺失谓语动词,那么这里用到的就是倒装。正常语序应该是Other creatures who became too specialized to survive their environment have disappeared。(其他太依赖于在它们自己的环境存活的生物已经消失了。),这里把have提前,因为和前面的句子有同样的谓语动词,所以进行了省略,避免重复,故选D。

RAG,相似题解答正确?

Some species may become extinct ________ other species that have adapted to their environment.
A.as
B.just as
C.as if
D.as have
// Azure GPT4
【答案】:B;
【解析】:本题考查的是比较状语从句的用法。句意:一些物种可能会像其他已经适应了环境的物种那样灭绝。A. as当…时候;B. just as正如;C. as if好像;D. as have如同…有。根据句意,这里要表达的是“一些物种可能会像其他已经适应了环境的物种那样灭绝”,故选B项。
// ERNIIE-4
【答案】:B.just as
【解析】:这句话的意思是:一些物种可能会像其他已经适应了它们的环境的物种一样灭绝,just as正如,和……一样,as如果,as if好像,as have没有这种用法,故选B。

效果测试CASE4

BAD CASE 试题ID:3457632764436480,小学翻译-汉译英-整句,copy到测试环境试题ID: 2490776046460929

主要测试解答格式是否存在越界情况。

我和我的朋友去旅行。 I _ with my friends.
【答案】:go to travel
【解析】:本题考查句子翻译。根据汉语意思,可知句子是陈述句,时态是一般现在时,去旅行go to travel,主语I是第一人称单数,go用原形,故答案为go to travel。

Azure GPT4

直接解答,解答错误,翻译越界

ask llm messages :[SystemMessage { text = “假设你是一位试题命题专家,现在有数学、英语、语文、物理、生物、地理等学科的不同的5位高级教师协商按步骤来给在校学生提问的试题写答案和解析
(1) 首先所有教师认真审查试题题干,然后所有教师都写下他们思考分析这个试题的第一个步骤
(2) 然后与大家分享讨论并根据其他老师思路以及试题考点等信息调整自己思路
(3) 协商一致后然后所有教师都写下他们思考的下一个步骤并分享
以此类推,直到所有教师写完他们思考的所有步骤。过程中只要你发现有教师的步骤出错了,就让这位教师重新思考分析,参考其他老师的步骤写出新的步骤,重试3次仍错误就让这个老师离开。
" }, UserMessage { name = null contents = [TextContent { text = “下面请回答问题,确保答案准确,下面是问题:
我和我的朋友去旅行。 I _ with my friends.
输出最终的答案与解析,输出格式按照”【答案】:xxx;【解析】:xxx”

【答案】:I travel with my friends.
【解析】:在这个句子中,“我和我的朋友去旅行”,英文表达应该是"I travel with my friends"。"I"是主语,"travel"是动词,"with my friends"是状语,表示和朋友一起。所以整个句子的意思就是我和我的朋友一起去旅行。

RAG,相似题解答正确(知识库400条数据),格式正确

我和我的朋友将要去旅行。 I _ with my friends.
【答案】:am going to travel
【解析】:本题考查动词时态和短语翻译。首先,根据题干“我和我的朋友将要去旅行”,可知这是一个将来时态的句子。在英文中,表示将来时态常用的结构是“be going to do sth.”,其中“be”动词根据主语的人称和数进行变化。由于主语“I”是第一人称单数,所以“be”动词用“am”。接下来,翻译“去旅行”这个短语,英文为“go to travel”。由于前面已经用了“am going to”,所以这里“go”要用原形。因此,整个句子的英文翻译为“I am going to travel with my friends.”,故填“am going to travel”。

我和我的朋友已经去旅游了 。 I _ with my friends.
【答案】:have gone to travel
【解析】:本题考查现在完成时态和动词短语。根据题干“我和我的朋友已经去旅游了”,可知需要使用现在完成时态表示已经完成的动作。现在完成时态的构成是“have/has + 过去分词”,而“去旅游”的英文是“go to travel”,其过去分词形式是“gone”。因此,整个句子的英文表达是“I have gone to travel with my friends”。故填“have gone to travel”。

7、关键词召回效果测评

效果测评CASE1

从solr随机选取高中英语单选 100 道试题,分别进行LLM、LLM + RAG召回解答试题,生成JSON文件对比解题正确率以及质量结果。

模型选用Azure GPT4,召回使用的是solr MLT 纯文本的textStem,待解答题干使用QML格式的的stem(使用QML格式的stem召回不出来?)总共召回3,排除召回的自己,最终组装进提示词供LLM参考的试题2个。

solr MLT

solr query:

qt=/mlt&mlt.fl=textStem&mlt.mintf=1&mlt.mindf=1&fl=*&rows=3&fq=courseId:28&fq=typeId:2803&stream.body=Someone+took+away+my+umbrella,+I’d+never+expect+it+_.+returning+to+be+returned+return+to+returning

生成的JSON格式

{
	"answer": "<ans><sq><an isop>2</an></sq></ans>",
	"explanation": "<exps><general></general><seg name=\"详解\"><span word-font-size=\"14px\" word-font=\"宋体\">考查过去分词和动词短语。句意:因为她穿着红色的裙子,所以在机场的人群中很容易被认出来。</span><span word-font-size=\"14px\" word-font=\"Times New Roman\">be dressed in</span><span word-font-size=\"14px\" word-font=\"宋体\">穿着……,作状语表状态,故用</span><span word-font-size=\"14px\" word-font=\"Times New Roman\">dressed</span><span word-font-size=\"14px\" word-font=\"宋体\"></span><span word-font-size=\"14px\" word-font=\"Times New Roman\">sb be easy to do sth</span><span word-font-size=\"14px\" word-font=\"宋体\">主动形式表达被动意思,所以用</span><span word-font-size=\"14px\" word-font=\"Times New Roman\">pick out</span><span word-font-size=\"14px\" word-font=\"宋体\">。故</span><span word-font-size=\"14px\" word-font=\"Times New Roman\">B</span><span word-font-size=\"14px\" word-font=\"宋体\">选项正确。</span></seg><seg name=\"点睛\"><span word-font-size=\"14px\" word-font=\"宋体\">主动形式表被动意义的不定式</span><p align=\"both\"><span word-font-size=\"14px\" word-font=\"Times New Roman\">1.</span><span word-font-size=\"14px\" word-font=\"宋体\">主语+</span><span word-font-size=\"14px\" word-font=\"Times New Roman\">be +adj. +to do</span><span word-font-size=\"14px\" word-font=\"宋体\"></span></p><p align=\"both\"><span word-font-size=\"14px\" word-font=\"宋体\">能用于此句型的形容词有</span><span word-font-size=\"14px\" word-font=\"Times New Roman\">: difficult, easy, comfortable, fit, hard, pleasant, tiresome(</span><span word-font-size=\"14px\" word-font=\"宋体\">使人疲劳的</span><span word-font-size=\"14px\" word-font=\"Times New Roman\">), interesting, nice, heavy, dangerous, light, important, etc.</span><span word-font-size=\"14px\" word-font=\"宋体\">注意:当上述形容词在句中作宾语补足语,后接不定式时,不定式也用主动形式表达被动含义。</span></p><p align=\"both\"><span word-font-size=\"14px\" word-font=\"Times New Roman\">2.</span><span word-font-size=\"14px\" word-font=\"宋体\">主语</span><span word-font-size=\"14px\" word-font=\"Times New Roman\">+be +adj. + enough +to do</span><span word-font-size=\"14px\" word-font=\"宋体\"></span></p><p align=\"both\"><span word-font-size=\"14px\" word-font=\"Times New Roman\">3.</span><span word-font-size=\"14px\" word-font=\"宋体\">主语</span><span word-font-size=\"14px\" word-font=\"Times New Roman\">+be  +too +adj. +to do</span><span word-font-size=\"14px\" word-font=\"宋体\"></span></p><p align=\"both\"><span word-font-size=\"14px\" word-font=\"Times New Roman\">4.</span><span word-font-size=\"14px\" word-font=\"宋体\">不定式短语作后置定语时,如果主语是不定式动词短语的逻辑主语。则采用不定式的主动形式表被动概念。</span></p><p align=\"both\"><span word-font-size=\"14px\" word-font=\"Times New Roman\">I have a meeting to attend today.</span></p><p align=\"both\"><span word-font-size=\"14px\" word-font=\"Times New Roman\">5.There be </span><span word-font-size=\"14px\" word-font=\"宋体\">句型中,用来修饰主语的不定式多用主动。</span></p><p align=\"both\"><span word-font-size=\"14px\" word-font=\"Times New Roman\">6.</span><span word-font-size=\"14px\" word-font=\"宋体\">在“疑问代词</span><span word-font-size=\"14px\" word-font=\"Times New Roman\"> + </span><span word-font-size=\"14px\" word-font=\"宋体\">不定式”结构中。</span></p><p align=\"both\"><span word-font-size=\"14px\" word-font=\"Times New Roman\">7.let, to blame, to seek</span><span word-font-size=\"14px\" word-font=\"宋体\">等用不定主动形式表示被动含义。</span></p><p align=\"both\"><span word-font-size=\"14px\" word-font=\"Times New Roman\">8. with+O.+to do </span><span word-font-size=\"14px\" word-font=\"宋体\">结构中,不定式作宾补时,常用主动表被动,且表将要发生的动作。</span>
<span word-font-size=\"14px\" word-font=\"宋体\">分析句子可知,</span><span word-font-size=\"14px\" word-font=\"Times New Roman\">sb be easy to do sth</span><span word-font-size=\"14px\" word-font=\"宋体\">主动形式表达被动含义,符合第一点用法。所以用</span><span word-font-size=\"14px\" word-font=\"Times New Roman\">pick out</span><span word-font-size=\"14px\" word-font=\"宋体\">。故</span><span word-font-size=\"14px\" word-font=\"Times New Roman\">B</span><span word-font-size=\"14px\" word-font=\"宋体\">选项正确</span></p></seg></exps>",
	"id": "2141465926983682",
	"llmAnswerExp": "【答案】:B;【解析】:考查非谓语动词和动词词义辨析。句意:她穿着红裙子,在机场的大人群中很容易被挑选出来。\n\n首先,我们来翻译这个英文题目的中文释义。\"in a red dress\"是定语,修饰\"she\",表示她穿着红裙子。\"she was easy to pick out in the big crowd at the airport\"表示在机场的大人群中,她很容易被挑选出来。\n\n其次,我们来分析错误选项的错误原因。选项A和D中的\"Being dressed\"和\"Having dressed\"都是非谓语动词,但在这个句子中,我们需要一个过去分词作定语,修饰\"she\",表示她被别人穿上红裙子。而\"Being dressed\"和\"Having dressed\"都不能表示被动意义。选项C中的\"be picked out\"是被动语态,但在这个句子中,我们需要一个能够表示主动意义的动词。\n\n最后,我们来解释选择正确选项的原因。选项B中的\"Dressed\"是过去分词作定语,修饰\"she\",表示她被别人穿上红裙子。\"pick out\"是动词短语,表示挑选出来,符合句意。\n\n故选B。",
	"ragAnswerExp": "【答案】:B;【解析】:考查非谓语动词和动词短语辨析。句意:她穿着红色的裙子,在机场的大人群中很容易被找出来。选项A中的\"Being dressed\"表示\"被穿着\",语态不符合句意;选项C中的\"be picked out\"表示\"被挑选出\",语态不符合句意;选项D中的\"Having dressed\"表示\"已经穿好\",语态和时态都不符合句意。而选项B中的\"Dressed\"作为过去分词表示被动意义,\"pick out\"表示\"挑选出\",符合句意。故选B。",
	"ragDetailInfo": "根据以下已知信息:\n【题干】:<stem><p>---- You’re coughing badly, Martin.Why not give up smoking?</p><p>---- Give up smoking? Easier said than done, Amy.Once you _____ the habit of smoking, it is very hard for you to______.</p><og cols=\"2\"><op>keep up; break it away</op><op>take up; drop it out</op><op>pick up; get rid of it</op><op>build up; do away with it</op></og></stem>;【答案】:<ans><sq><an isop>3</an></sq></ans>;【解析】:<exps><general>试题分析: 考查动词短语辨析。句意是:“--马丁,你咳嗽得很厉害,为什么不戒烟呢?”“--戒烟?说起来容易做起来难,艾米。你一旦养成了这个习惯,就很难戒掉。” pick up在此句中表示“养成;形成”;keep up表示“保持”;take up表示“从事”;build up表示“发展,增大”;break away表示“脱离”;drop out表示“退出”;get rid of表示“摆脱,除去”;do away with表示“摆脱;废除,取消” ,故选C项。<p>考点 : 考查动词短语辨析</p></general></exps>\n【题干】:<stem><p>Everybody on the spot was deeply touched by the bravery of the young girl who took off her only blouse, _____ the burns and ______ the mouth-to-mouth method to save the man who was in a coma(昏迷) because of a bad electric shock.</p><og cols=\"2\"><op>wrapped; took advantage of</op><op>dressed; applied</op><op>did up; used</op><op>packed up; made use of</op></og></stem>;【答案】:<ans><sq><an isop>2</an></sq></ans>;【解析】:<exps><general>试题分析:考查单词意思,wrapped意思“包裹”,took advantage of意思“利用”,dressed意思“给某人穿衣”,applied意思“适用”,used意思“用”,packed up意思“打包”,made use of意思“利用”, did up意思“整修”,句子意思“在场的每一人都被那个脱掉仅有的衬衣给烧伤的穿上,适用人工呼吸的方法救那个因电击而昏迷的男人的女孩感动了”,所以选B<p>考点:考查单词意思</p><p>点评:句子用了两个定语从句,都是关系代词who引导的,翻译此句时要注意定语从句。Everybody on the spot意思“在场的每一个人”, was deeply touched by意思“被什么深深地感动了”。 because of意思“因为”,后跟名词;而because后跟句子。</p></general></exps>\n【题干】:<stem><p>--- I ____ so busily recently that I ____ no time to help you with your maths.</p><p>---That’s OK. I can manage it by myself.</p><og cols=\"2\"><op>had been working; had had</op><op>have been working; had</op><op>have been working; have</op><op>am working; will have</op></og></stem>;【答案】:<ans><sq><an isop>3</an></sq></ans>;【解析】:<exps><general>试题分析:句意:--我最近很忙,没有时间帮助你学习数学。--没关系,我自己能行。由recently 可知,第一个空用完成时态,排除A选项。完成时强调的是对现在的影响,从句意知道,最近很忙,一直忙到现在,而且还要继续忙,所以没有时间帮助你,所以用 现在完成 进行时 ,排除D现在进行时,第二空是现在没时间,排除B将来时。另外:have no time 就是没时间的意思,中间什么也不加。故选C。 <p>考点: 考查动词时态的用法。</p></general></exps>\n\n下面请解答试题:in a red dress, she was easy to in the big crowd at the airport. Being dressed; pick out Dressed; pick out Dressed; be picked out Having dressed; pick out,确保答案正确,输出最终的答案与解析,输出格式按照\n\"【答案】:xxx;【解析】:考查语法知识或词汇辨析xxx。句意:——xxx。\n解析的内容包含如下二个方面:翻译英文题目的中文释义;阐述错误选项的错误原因,说清正确选项在句子中作什么成分,解释选择正确选项的原因。结论统一写成“故选x”;\",\n\n语言需要简洁,突出重点,英文翻译要符合习惯和语法。注意,回答的内容不能让用户感知到已知信息的存在。\n",
	"stem": "<stem><p ><span word-font-size=\"14px\" word-font=\"Times New Roman\" u>  </span><span word-font-size=\"14px\" u>    </span><span word-font-size=\"14px\" word-font=\"Times New Roman\">in a red dress, she was easy to </span><span word-font-size=\"14px\" word-font=\"Times New Roman\" u>  </span><span word-font-size=\"14px\" u>    </span><span word-font-size=\"14px\" word-font=\"Times New Roman\">in the big crowd at the airport.</span></p><og cols=\"2\"><op><span word-font-size=\"14px\" word-font=\"Times New Roman\">Being dressed; pick out</span></op><op><span word-font-size=\"14px\" word-font=\"Times New Roman\">Dressed; pick out</span></op><op><span word-font-size=\"14px\" word-font=\"Times New Roman\">Dressed; be picked out</span></op><op><span word-font-size=\"14px\" word-font=\"Times New Roman\">Having dressed; pick out</span></op></og></stem>",
	"textStem": "in a red dress, she was easy to in the big crowd at the airport. Being dressed; pick out Dressed; pick out Dressed; be picked out Having dressed; pick out"
}

结果文件
result-json-511.txt
统计,召回内容可定位json查看

  • 100个高中英语单选,LLM解答正确79,解答错误21。
  • 100个高中英语单选,RAG + LLM 解答正确91,解答错误9。

BAD CASE使用向量检索测试

上面测试solr MLT的BAD CASE,重新从Milvus向量知识库召回然后辅助LLM解题,测试
1566879979937792
1566879979642880
1566879979577344
1566879845515264
1566879845285888
1566879741566976
1566879695732736
1566879569502208
1566879569485824

结果文件
result-json-milvus-511.txt

[
{"answer":"3","explanation":"考察定语从句关系代词及关系副词用法,根据前置词,The beautiful town,这个美丽的城镇,可知选C,在哪儿。","id":"1566879569485824","ragAnswerExp":"【答案】:C;\n【解析】:考查定语从句关系副词用法。句意:我们去年夏天度假的那个美丽的小镇位于山脚下。分析句子结构可知,空处引导定语从句,先行词为the beautiful town,在从句中作地点状语,故应用关系副词where引导。whose在定语从句中作定语,表示所属关系;which在定语从句中作主语或宾语;why在定语从句中作原因状语,均不符合语境。故选C。","ragDetailInfo":"根据以下已知信息:\n【题干】:The beautiful town, _ we spent our summer vacation last year , lies at the foot of a mountain. whose which where why;【答案】:3;【解析】:考察定语从句关系代词及关系副词用法,根据前置词,The beautiful town,这个美丽的城镇,可知选C,在哪儿。\n\n【题干】:They reached the top of the mountain_ they could see the highway wandering before them. which why whose where;【答案】:4;【解析】:试题分析:本题考查定语从句的用法。句意:他们到达山顶,在那里他们可以看到蜿蜒的公路。定语从句先行词the top of the mountain在从句中做状语,表示地点用where,故答案选D。 考点: 考查定语从句关系词的用法。\n\n【题干】:At the foot of the mountain . a village lies is lying a village does a village lie lies a village;【答案】:4;【解析】:考查倒装和时态。句意:在山脚下有一个村庄。表示地点的介词短语位于句首时,句子的主谓结构使用完全倒装语序,故排除A、C两项;根据句意可知此处为客观事实,应用一般现在时,故选D。 【名师点睛】 完全倒装(Full Inversion) 谓语部分完全放在主语之前的句子,便是完全倒装句。 1.副词、介词短语类:①表示地点的副词 here, there 置于句首, 且主语是名词(不是代词) , 需用完全倒装, 其形式为: There/Here+谓语+主语。 常用于此句型的谓语动词为 be, go, come, exist, follow, remain, lie等, 时态要用一般现在时。There goes the last bus.末班公共汽车开走了。Here you are.给你。 (代词作主语, 不倒装)②表示时间的副词(如: now, then 等) 、运动方向的副词(如:out, in, up, down, away 等) 及表示地点的介词短语置于句首, 且主语是名词(不是代词) , 需用完全倒装, 其形式为: 副词或介词短语+谓语+主语。 常用于此句型的谓语动词为 come, fall, follow,exist, lie, go, remain, run 等, 时态为一般现在时或一般过去时。Now comes your turn! 现在该你了!Behind the counter he stood. 他站在柜台后面。 (代词作主语, 不倒装) 2.表语类:为了保持句子平衡或强调表语部分等, 将作表语的形容词、分词、介词短语、such 置于句首时, 需用完全倒装, 其形式为: 形容词/现在分词/过去分词/介词短语/such+be+主语。Happy are those who are contented.知足者常乐。Inside the parcel was a letter.包裹里有封信。\n\n下面请解答试题:<stem><p>The beautiful town, _____ we spent our summer vacation last year , lies at the foot of a mountain.</p><og cols=\"4\"><op>whose</op><op>which</op><op>where</op><op>why</op></og></stem>,确保答案正确,输出最终的答案与解析,输出格式按照\n\"【答案】:xxx(只写正确答案对应的选项如A、B、C、D);【解析】:考查语法知识或词汇辨析xxx。句意:——xxx。\n解析的内容包含如下二个方面:翻译英文题目的中文释义;阐述错误选项的错误原因,说清正确选项在句子中作什么成分,解释选择正确选项的原因。结论统一写成“故选x”;\",\n\n语言需要简洁,突出重点,英文翻译要符合习惯和语法。注意,回答的内容不能让用户感知到已知信息的存在。\n","stem":"<stem><p>The beautiful town, _____ we spent our summer vacation last year , lies at the foot of a mountain.</p><og cols=\"4\"><op>whose</op><op>which</op><op>where</op><op>why</op></og></stem>","textStem":"The beautiful town, _ we spent our summer vacation last year , lies at the foot of a mountain. whose which where why"},
{"answer":"2","explanation":"这题考查代词的用法:one代指a country,句意是:我们都知道,中国是个发展中国家,一个吸引越来越多外国人的国家。选B。","id":"1566879569502208","ragAnswerExp":"【答案】:B;\n【解析】:考查代词用法。句意:众所周知,中国是一个发展中国家,一个吸引越来越多外国人的国家。one代指a developing country,表示泛指,符合句意。the one表示特指,it指代前文提到的同一事物,that引导定语从句,均不符合语境。故选B。","ragDetailInfo":"根据以下已知信息:\n【题干】:As we all know, China is a developing country, _ attracting more and more foreigners. the one one it that;【答案】:2;【解析】:这题考查代词的用法:one代指a country,句意是:我们都知道,中国是个发展中国家,一个吸引越来越多外国人的国家。选B。\n\n【题干】:More than 40 % of the population in that country _ young, and about two thirds of them _ know how to read and write. is; don’t are; doesn’t is; doesn’t are; don’t;【答案】:4;【解析】:考查主谓一致。句意:那个国家40%以上的人口是年轻人,其中大约三分之二的人不知道如何读写。当population作“人口”讲,作主语时谓语动词要用单数形式;当前面有分数或百分数时,population是指一个国家或地区的全体居民,作主语时,谓语动词用复数形式,所以第一空用are;由them(年轻人)可知,谓语动词应用复数形式。故选D。\n\n【题干】:The population of China _very large and about 80% of the population _ peasants. is; is are; are is; are are; is;【答案】:3;【解析】:考查主谓一致。句意:中国人口(数)非常多,且大约80%的人是农民。本句前一部分主语是The population of China,population表示“人口”时,谓语动词用单数;第二部分是分数作主语,“分数或百分数+of+名词”以及“a lot of/lots of/plenty of/half of/the rest of/ (a) part of+名词”构成的短语作主语时,其谓语动词形式要以of后面的名词而定,population表示“人,居民”时,谓语动词用复数。故选C。\n\n下面请解答试题:<stem><p>As we all know, China is a developing country, _____ attracting more and more foreigners.</p><og cols=\"4\"><op>the one</op><op>one</op><op>it</op><op>that</op></og></stem>,确保答案正确,输出最终的答案与解析,输出格式按照\n\"【答案】:xxx(只写正确答案对应的选项如A、B、C、D);【解析】:考查语法知识或词汇辨析xxx。句意:——xxx。\n解析的内容包含如下二个方面:翻译英文题目的中文释义;阐述错误选项的错误原因,说清正确选项在句子中作什么成分,解释选择正确选项的原因。结论统一写成“故选x”;\",\n\n语言需要简洁,突出重点,英文翻译要符合习惯和语法。注意,回答的内容不能让用户感知到已知信息的存在。\n","stem":"<stem><p>As we all know, China is a developing country, _____ attracting more and more foreigners.</p><og cols=\"4\"><op>the one</op><op>one</op><op>it</op><op>that</op></og></stem>","textStem":"As we all know, China is a developing country, _ attracting more and more foreigners. the one one it that"},
{"answer":"3","explanation":"考查固定句型。句意:——自从上次见到你已经很长时间了。——是的,真遗憾很长一段时间以后我们才又见面。It is a long time since…自从…以来已经很长时间了;it be+一段时间+before从句意为“一段时间以后某事才发生”。结合句意可知,故选C。","id":"1566879695732736","ragAnswerExp":"【答案】:C;\n【解析】:考查语法知识。句意:——我最后一次见你已经很久了。——是的,现在我们再次见面还要很久,真是遗憾。第一空,根据“It’s a long time”可知,此处表示“我最后一次见你已经很久了”,表示从过去某一时间点到现在的一段时间,用since引导时间状语从句,从句用一般过去时,主句用现在完成时或一般现在时;第二空,根据“it will be a long time”可知,此处表示“现在我们再次见面还要很久”,用固定句型“it will be a long time before+从句”,表示“还要……才……”,before引导时间状语从句,从句用一般现在时。故选C。","ragDetailInfo":"根据以下已知信息:\n【题干】:Ted told his father he _ his homework three hours before. finished has finished had finished was finishing;【答案】:3;【解析】:考查时态。句意:特德告诉他的父亲三个小时前他就完成了家庭作业。根据句中时间状语three hours before和动词told可知,用过去完成时,表示过去的过去。故选C。本题考查时态。句中包含的时间状语是解答此题的突破点。所以要做好此类题,一定要注意题中有没有明确的时间点,或者其他可以代替时间点的词,根据时间状语可以看出正确答案。本题的关键在于抓住题干中的时间状语three hours before,再抓住主句已用一般过去时,从而得出答案。\n\n【题干】:—It is a long time I saw you last time. —Yes. And it will be a long time we see each other again. when; before after; when since; before since; until;【答案】:3;【解析】:试题分析:考查状语从句。此题考查since和before引导的从句。第一空需要注意的是主从句的时态问题,主句是一般现在时,而从句是一般过去时。能满足这种用法的是since,since从句中用一般过去时,主句用现在完成时或一般现在时,故第一空选择since。第二空考查的是句型it will be a long time before+从句,意为:还要…才能…。故选择before,句意为:还要很久我们才能再次见面。所以选择C。 考点:考查状语从句\n\n【题干】:-We haven’t seen each other for ages. -No, I don’t remember how many years ago _ I last saw you. it was that was it that it was when was it when;【答案】:1;【解析】:试题分析:考查强调句式。It+was···that句式,对时间进行强调,而how many years ago表示时间的短语提前至it前面,不影响强调句语序,无需倒装。句意:我们好多年没有见到对方了。是啊,我都不记得我最后一次见你是在多少年前了,故选A。 考点:考查强调句式\n\n下面请解答试题:<stem><p align=\"left\"><span word-font=\"Times New Roman\">—It’s a long time </span><span word-font=\"Times New Roman\">________</span><span word-font=\"Times New Roman\"> I saw you last.</span></p><p align=\"left\"><span word-font=\"Times New Roman\">—Yes, and what a pity it is now that it will be a long time </span><span word-font=\"Times New Roman\">________</span><span word-font=\"Times New Roman\"> we see each other again.</span></p><og cols=\"4\"><op><span word-font=\"Times New Roman\">before; since</span></op><op><span word-font=\"Times New Roman\">since; when</span></op><op><span word-font=\"Times New Roman\">since; before</span></op><op><span word-font=\"Times New Roman\">when; before</span></op></og></stem>,确保答案正确,输出最终的答案与解析,输出格式按照\n\"【答案】:xxx(只写正确答案对应的选项如A、B、C、D);【解析】:考查语法知识或词汇辨析xxx。句意:——xxx。\n解析的内容包含如下二个方面:翻译英文题目的中文释义;阐述错误选项的错误原因,说清正确选项在句子中作什么成分,解释选择正确选项的原因。结论统一写成“故选x”;\",\n\n语言需要简洁,突出重点,英文翻译要符合习惯和语法。注意,回答的内容不能让用户感知到已知信息的存在。\n","stem":"<stem><p align=\"left\"><span word-font=\"Times New Roman\">—It’s a long time </span><span word-font=\"Times New Roman\">________</span><span word-font=\"Times New Roman\"> I saw you last.</span></p><p align=\"left\"><span word-font=\"Times New Roman\">—Yes, and what a pity it is now that it will be a long time </span><span word-font=\"Times New Roman\">________</span><span word-font=\"Times New Roman\"> we see each other again.</span></p><og cols=\"4\"><op><span word-font=\"Times New Roman\">before; since</span></op><op><span word-font=\"Times New Roman\">since; when</span></op><op><span word-font=\"Times New Roman\">since; before</span></op><op><span word-font=\"Times New Roman\">when; before</span></op></og></stem>","textStem":"—It’s a long time _ I saw you last. —Yes, and what a pity it is now that it will be a long time _ we see each other again. before; since since; when since; before when; before"},
{"answer":"4","explanation":"考查特殊句式。句意:——爸爸,你答应过的。——嗯,我是说过。但是是你首先不遵守诺言的。So+陈述句,表示“肯定,赞同前面说过的话”,指的是一件事。So+倒装句,表示“前面说的情况也适合于后面的人或物”,指的是两件事,并且助动词要与上文保持一致。结合语境可知选D。","id":"1566879741566976","ragAnswerExp":"【答案】:A;\n【解析】:考查语法知识。句意:——爸爸,你答应过的。——嗯,我是说过。但是是你首先不遵守诺言的。So+倒装句,表示“前面说的情况也适合于后面的人或物”,指的是两件事,并且助动词要与上文保持一致。根据题干中的“you promised”可知,此处应用“so+主语+助动词”的倒装结构,表示“我也说过”。因此,正确答案为A。选项B“so did I”表示“我也做了”,与句意不符;选项C“so I was”和选项D“so I did”均不符合语法规则,故排除。故选A。","ragDetailInfo":"根据以下已知信息:\n【题干】:—Father, you promised! —Well, _.But it was you who didn’t keep your word first. so was I so did I so I was so I did;【答案】:4;【解析】:考查特殊句式。句意:——爸爸,你答应过的。——嗯,我是说过。但是是你首先不遵守诺言的。So+陈述句,表示“肯定,赞同前面说过的话”,指的是一件事。So+倒装句,表示“前面说的情况也适合于后面的人或物”,指的是两件事,并且助动词要与上文保持一致。结合语境可知选D。\n\n【题干】:It was pouring outside then, so I _ you couldn’t come to my party. indicated protested spilled figured;【答案】:4;【解析】:考查动词。句意:当时外面正下着倾盆大雨,所以我以为你不能来参加我的聚会了。A. indicated表明;B. protested抗拒;C. spilled溢出;D. figured计算。故选D。\n\n【题干】:He left a _ saying that he would be a little late. word letter sentence message;【答案】:4;【解析】:考查名词词义辨析。句意:他留了个口信说他要晚一点。A. word话;B. letter信;C. sentence 句子;D. message消息,口信。故选D。\n\n下面请解答试题:<stem><p>—Father, you promised!  </p><p> —Well, _____.But it was you who didn’t keep your word first.</p><og cols=\"4\"><op>so was I</op><op>so did I</op><op>so I was</op><op>so I did</op></og></stem>,确保答案正确,输出最终的答案与解析,输出格式按照\n\"【答案】:xxx(只写正确答案对应的选项如A、B、C、D);【解析】:考查语法知识或词汇辨析xxx。句意:——xxx。\n解析的内容包含如下二个方面:翻译英文题目的中文释义;阐述错误选项的错误原因,说清正确选项在句子中作什么成分,解释选择正确选项的原因。结论统一写成“故选x”;\",\n\n语言需要简洁,突出重点,英文翻译要符合习惯和语法。注意,回答的内容不能让用户感知到已知信息的存在。\n","stem":"<stem><p>—Father, you promised!  </p><p> —Well, _____.But it was you who didn’t keep your word first.</p><og cols=\"4\"><op>so was I</op><op>so did I</op><op>so I was</op><op>so I did</op></og></stem>","textStem":"—Father, you promised! —Well, _.But it was you who didn’t keep your word first. so was I so did I so I was so I did"},
{"answer":"2","explanation":"这题考查冠词和代词,第一空填a,a better Yangzhou High School“一个更好的扬州中学,第二空填one,代指a school,选B。","id":"1566879845285888","ragAnswerExp":"【答案】:B;\n【解析】:考查冠词和代词的使用。句意:所有这些变化将带来一个更好的扬州中学,一个能够给所有校友带来惊喜和启发的学校。第一个空,泛指“一个更好的扬州中学”,用不定冠词a;第二个空,代指“一个学校”,用不定代词one,作主语。A选项“the one”表示特指,不符合句意;C、D选项“the”表示特指,也不符合句意。故选B。","ragDetailInfo":"根据以下已知信息:\n【题干】:All these changes will lead to_ better Yangzhou High School,_ that can surprise and inspire all the alumni. a; the one a; one the; one the; one;【答案】:2;【解析】:这题考查冠词和代词,第一空填a,a better Yangzhou High School“一个更好的扬州中学,第二空填one,代指a school,选B。\n\n【题干】:There are two high schools for you to choose. Which one would you like to_? join in join take part in attend;【答案】:4;【解析】:考查动词和动词短语的区别。句意:有两所高中供你选择。你想上哪一个。join in和take part in后面都是接表示活动的名词,join指加入某一组织或团体,所以A、B、C都不合适;attend school“上学”。符合句意。故D选项正确。join, join in, take part in和attend的用法比较 这几个词或短语都有“参加”的意思,但用法不同。 一,join有两个用法: (1)指加入某个党派,团体组织等,成为其成员之一,意为:“参军、入团、入党”等。如: When did your brother join the army? 你哥哥什么时候参军的? She joined the Young Pioneers. 她加入了少先队。 (2)和某人一道做某事,其结构为:join sb. in (doing) sth.,根据上下文,in (doing) sth. 也可以省去. Will you join us in the discussion? 你参加我们的讨论吗? 二 , join in多指参加小规模的活动如“球赛、游戏”等,常用于日常口语。如: Come along, and join in the ball game. 快,来参加球赛。 三 , take part in 指参加会议或群众性活动等,着重说明句子主语参加该项活动并在活动中发挥积极作用。 We often take part in physical labor. 我们经常参加体力劳动。 take part in是惯用词组,part前一般不用冠词,但part前有形容词修饰时,要用不定冠词。 Lincoln took an active part in polities and was strongly against slavery. 林肯积极参加政治活动,强烈反对奴隶制。 四 ,attend是正式用语,及物动词,指参加会议,婚礼,葬礼,典礼;去上课,上学,听报告等。句子的主语只是去听,去看,自己不一定起积极作用 根据本句句意可知,有两所高中供你选择。你想上哪一个。所以用attend school“上学”。故D选项正确。\n\n【题干】:-Miss Smith is patient but strict _ her students. -That’s why she is so popular _ the students. for; with in; for with; with with; in;【答案】:3;【解析】:考查固定词组。句意:斯密斯小姐很有耐心且对学生很严格,那就是她在学生中如此受欢迎的原因。第一个短语,be strict with,对﹍…是严格的;第二个短语be popular with sb,受﹍…的欢迎。故选C。\n\n下面请解答试题:<stem><p>All these changes will lead to____ better Yangzhou High School,____ that can surprise and inspire all the alumni.</p><og cols=\"4\"><op>a; the one</op><op>a; one</op><op>the; one</op><op>the; one</op></og></stem>,确保答案正确,输出最终的答案与解析,输出格式按照\n\"【答案】:xxx(只写正确答案对应的选项如A、B、C、D);【解析】:考查语法知识或词汇辨析xxx。句意:——xxx。\n解析的内容包含如下二个方面:翻译英文题目的中文释义;阐述错误选项的错误原因,说清正确选项在句子中作什么成分,解释选择正确选项的原因。结论统一写成“故选x”;\",\n\n语言需要简洁,突出重点,英文翻译要符合习惯和语法。注意,回答的内容不能让用户感知到已知信息的存在。\n","stem":"<stem><p>All these changes will lead to____ better Yangzhou High School,____ that can surprise and inspire all the alumni.</p><og cols=\"4\"><op>a; the one</op><op>a; one</op><op>the; one</op><op>the; one</op></og></stem>","textStem":"All these changes will lead to_ better Yangzhou High School,_ that can surprise and inspire all the alumni. a; the one a; one the; one the; one"},
{"answer":"2","explanation":"试题分析:句意:在日常办公会议上,校长坚决要求提出的问题应该特别关注。referred to是过去分词短语做定语修饰the problems,从句的谓语受主句谓语动词insisted(坚决要求)的影响,应该用should和动词原形做谓语,而should还可以省略。这里就是省略的情况。综上可知选B。 考点:考查虚拟语气的用法和对句子的理解。","id":"1566879845515264","ragAnswerExp":"【答案】:A;\n【解析】:考查虚拟语气和固定短语。句意:在例行的办公室会议上,校长坚持认为这些问题应该受到特别关注。insist表示“坚持认为”时,其后的宾语从句要使用虚拟语气,即“主语+should+动词原形”,should可以省略。refer to表示“提到,涉及”,此处是过去分词短语作后置定语,修饰the problems,表示“被提到的问题”,故referred to符合语境。referred to be结构错误,因为refer to没有被动语态;refer to being和refer to be都是动词原形,不符合虚拟语气的要求。故选A。","ragDetailInfo":"根据以下已知信息:\n【题干】:When entering the office, _. Winifred was found sitting at a desk Winifred was found sat at a desk we found Winifred seated at a desk we found Winifred seating at a desk;【答案】:3;【解析】:考查状语从句的省略和动词的用法。句意:当我们走进办公室时,我们发现Winifred坐在一张桌子旁。主从句主语一致,状语从句主语省略,seated表示“坐”的状态,,所以不能用seating,故选C。\n\n【题干】:I glanced sideways and noticed that the previous author was standing silently, with his eyes on me. fixing fixed to be fixing to be fixed;【答案】:2;【解析】:考查非谓语动词。句意为:我向旁边瞥了一眼,发现先前的作者默默地站在那,两眼紧盯着我。此处为with的复合结构,his eyes与fix之间是动宾关系,所以此处用过去分词表示被动,故选B。\n\n【题干】:_ the meeting gave us a great deal of encouragement last night. The headmaster attending The headmaster attended The headmaster’s attending The headmaster’s attended;【答案】:3;【解析】:试题分析:考查非谓语动词 。句意:昨晚校长来参加会议给了我们很大的鼓励, 动名词的复合结构在句中作主语,The headmaster’s为名词所有格,故选C项。 考点 : 考查非谓语动词\n\n下面请解答试题:<stem><p  left=\"14px\" align=\"left\"><span  word-font=\"宋体\">At the routine office meeting, the headmaster insisted that the problems ____________ paid special attention to.</span></p><og cols=\"2\"><op><span  word-font=\"宋体\">referred to</span></op><op><span  word-font=\"宋体\">referred to be</span></op><op><span  word-font=\"宋体\">refer to being</span></op><op><span  word-font=\"宋体\">refer to be</span></op></og></stem>,确保答案正确,输出最终的答案与解析,输出格式按照\n\"【答案】:xxx(只写正确答案对应的选项如A、B、C、D);【解析】:考查语法知识或词汇辨析xxx。句意:——xxx。\n解析的内容包含如下二个方面:翻译英文题目的中文释义;阐述错误选项的错误原因,说清正确选项在句子中作什么成分,解释选择正确选项的原因。结论统一写成“故选x”;\",\n\n语言需要简洁,突出重点,英文翻译要符合习惯和语法。注意,回答的内容不能让用户感知到已知信息的存在。\n","stem":"<stem><p  left=\"14px\" align=\"left\"><span  word-font=\"宋体\">At the routine office meeting, the headmaster insisted that the problems ____________ paid special attention to.</span></p><og cols=\"2\"><op><span  word-font=\"宋体\">referred to</span></op><op><span  word-font=\"宋体\">referred to be</span></op><op><span  word-font=\"宋体\">refer to being</span></op><op><span  word-font=\"宋体\">refer to be</span></op></og></stem>","textStem":"At the routine office meeting, the headmaster insisted that the problems _ paid special attention to. referred to referred to be refer to being refer to be"},
{"answer":"3","explanation":"句意:当Tom来的时候,请告诉我。When引导的时间状从用一般现在时表将来;Mary said when Tom_,just tell her about it是转述别人的话,因为主句用的是一般过去时态,said后面when引导的宾从也用过去时态的某种形式。所以选C。 。","id":"1566879979577344","ragAnswerExp":"【答案】:C;\n【解析】:考查时态。句意:——当汤姆来的时候,请让我知道。——玛丽说当汤姆来的时候,就告诉她。第一个空,when引导时间状语从句,根据主将从现的原则,从句用一般现在时,主语Tom是第三人称单数,所以谓语动词用comes;第二个空,when引导时间状语从句,根据just tell her about it可知,从句用一般过去时,主语Tom是第三人称单数,所以谓语动词用came。故选C。","ragDetailInfo":"根据以下已知信息:\n【题干】:Tom was deeply struck by the beauty of Mary _ he met her. at the first time the first time for the first time at the first time when;【答案】:2;【解析】:试题分析:考查状语从句连接词。本句中的名词短语the first time第一次…的时候,引导时间状语从句。句意:Tom第一次遇见Mary的时候,就对她的美丽留下了深刻印象。ACD三项都是介词短语,单独在句中作时间状语,不能引导时间状语从句。故B正确。 考点:考查状语从句连接词\n\n【题干】:Tom went back to his office again to see if he_ anything behind. left has left had left would leave;【答案】:3;【解析】:考查时态。句意:汤姆又回到他的办公室,看看他是否留下了什么东西。此处是if引导的宾语从句,从句的谓语动词明显先于主句的谓语动词的动作,所以用过去完成时态,故选C。\n\n【题干】:Luckily, Tom and Mary had a narrow _ when their car crashed on the highway yesterday. absence attendance appearance escape;【答案】:4;【解析】:试题分析:考查名词词义辨析。A. 缺席;B. 参加;C. 出现;D. 逃生。句意:幸运的是,昨天他们的车撞上高速公路的时候,汤姆和玛丽死里逃生。故选D。 考点:考查名词词义辨析\n\n下面请解答试题:<stem><p  align=\"left\"><span word-font=\"Times New Roman\">—When Tom________</span><span word-font=\"宋体\">,</span><span word-font=\"Times New Roman\"> please let me know.</span></p><p  align=\"left\"><span word-font=\"Times New Roman\">—Mary said when Tom________</span><span word-font=\"宋体\">,</span><span word-font=\"Times New Roman\"> just tell her about it.</span></p><og cols=\"2\"><op><span word-font=\"Times New Roman\">comes; comes</span></op><op><span word-font=\"Times New Roman\">came; came</span></op><op><span word-font=\"Times New Roman\">comes; came</span></op><op><span word-font=\"Times New Roman\">comes; coming</span></op></og></stem>,确保答案正确,输出最终的答案与解析,输出格式按照\n\"【答案】:xxx(只写正确答案对应的选项如A、B、C、D);【解析】:考查语法知识或词汇辨析xxx。句意:——xxx。\n解析的内容包含如下二个方面:翻译英文题目的中文释义;阐述错误选项的错误原因,说清正确选项在句子中作什么成分,解释选择正确选项的原因。结论统一写成“故选x”;\",\n\n语言需要简洁,突出重点,英文翻译要符合习惯和语法。注意,回答的内容不能让用户感知到已知信息的存在。\n","stem":"<stem><p  align=\"left\"><span word-font=\"Times New Roman\">—When Tom________</span><span word-font=\"宋体\">,</span><span word-font=\"Times New Roman\"> please let me know.</span></p><p  align=\"left\"><span word-font=\"Times New Roman\">—Mary said when Tom________</span><span word-font=\"宋体\">,</span><span word-font=\"Times New Roman\"> just tell her about it.</span></p><og cols=\"2\"><op><span word-font=\"Times New Roman\">comes; comes</span></op><op><span word-font=\"Times New Roman\">came; came</span></op><op><span word-font=\"Times New Roman\">comes; came</span></op><op><span word-font=\"Times New Roman\">comes; coming</span></op></og></stem>","textStem":"—When Tom_, please let me know. —Mary said when Tom_, just tell her about it. comes; comes came; came comes; came comes; coming"},
{"answer":"2","explanation":"考查定语从句。句意:他给出今天早上迟到的理由是因为今天早上睡过头了。第一空先行词是the reason,定语从句he gave for being late缺少gave的宾语,所以填that或which或省略关系代词。第二空填that,因为主语是the reason表语从句只能用that引导。故选B。","id":"1566879979642880","ragAnswerExp":"【答案】:A;\n【解析】:考查定语从句和表语从句。句意:他迟到给出的理由是今天早上他睡过头了。分析句子结构可知,he gave for being late是定语从句修饰the reason,the reason在从句中作gave的宾语,所以可以用which或that。Reason在从句中作状语时才用why。第二个空是引导表语从句的关系词,从句中什么也不缺少,故用that引导。第二个空可能会误选because,在正式文体中,“……的原因是因为……”时,一般用“the reason ……is that……”,而不用“the reason……is because……”。因此选A项。","ragDetailInfo":"根据以下已知信息:\n【题干】:The reason _ he was late was _ he missed the bus. that; that that; which why; that which; that;【答案】:3;【解析】:考查定语从句和表语从句。句意:他迟到的原因是他没赶上公共汽车。此处The reason作先行词,在后面的定语从句中作原因状语,第一空填why;reason作主语,后面的表语从句用that引导。故选C。reason理由(名词),reasonable合情合理的(形容词) 1. reason (1)the reason for sth. /doing sth.为某事或做某事的理由。the reason for his being late他迟到的理由 (2)reason理由(名词),在句中作主语,后面的表语从句用that引导。The reason was that he had little education. 理由是他受教育少。 (3)reason理由(名词),作先行词,在定语从句中作原因状语时用why引导定语从句。比如:The reason why he was late for class was that his mother was ill. 他上课迟到的理由是她的妈妈病了。reason理由(名词),作先行词,在定语从句中作主语或宾语时用that/which,比如:The reason that/which she gave me was that she had got up late. 他给我的理由是他起床晚了。 2. reasonable合情合理的(形容词),连系动词后面作表语。 What he said sounded reasonable. 他说的话听起来合情合理。\n\n【题干】:The reason _ he felt frustrated was _ he lost his MP4. why/that that/why why/because that / because;【答案】:1;【解析】:试题分析:句意:他郁闷的原因是他丢了他的MP4。The reason why…is/was that…意为:…….的原因是……。why he felt frustrated是定语从句修饰the reason,that he lost his MP4是表语从句。故选A。 考点: 考查名词性从句的用法。\n\n【题干】:The reason _ he gave for his being late was _ the traffic was held back by a car accident. why; that that; that which; whether why; because;【答案】:2;【解析】:考查名词性从句和定语从句。句意:他给出的迟到的原因是被车祸耽搁了。分析The reason _ he gave for his being late was _…可知the reason 后面是定语从句,the reason要从句中作gave的宾语,所以可以用which或that。Reason在从句中作状语时才用why。第二个空是引导表语从句的关系词,从句中什么也不缺少,故用that引导。第二个空可能会误选because,在正式文体中,“….的原因是因为….时”一般用“the reason …..is that….”,而不用“the reason…is because…”。因此选B项。1.在定语从句中Reason 是先行词时,用哪个关系词要视其在从句中所作的成份而定。如果在定语从句中作状语,可用why或for which,如果作主语或宾语时,可用that或which。 This is the reason why(=for which) he got angry. (在定语从句中作状语) 这就是他生气的原因。 He told us a reason that / which sounded reasonable. (在定语从句作主语) 他给我们讲了一个听起来合理的理由。 Can you remember the reason he told us last week? (作told的间接宾语,可省去that) 你还记得上周他告诉我们的理由吗? 2.在表语从句中,如果主句的主语是the reason时,表示“…原因是因为….的时候”时,用the reason(why ….) is that…. 。也就是说,表语从句的引导词一般用that,而不用because,而不是the reason…is because….。如: The reason why I was sad was that he didn’t understand me.我难过的原因是他不理解我。 The reason he told me is that he missed the first bus.他告诉我的原因就是他错过了早班车。\n\n下面请解答试题:<stem><p>The reason ______ he gave for being late was ______ he overslept this morning.</p><og cols=\"4\"><op>why; that</op><op>which; that</op><op>why; because</op><op>which; because</op></og></stem>,确保答案正确,输出最终的答案与解析,输出格式按照\n\"【答案】:xxx(只写正确答案对应的选项如A、B、C、D);【解析】:考查语法知识或词汇辨析xxx。句意:——xxx。\n解析的内容包含如下二个方面:翻译英文题目的中文释义;阐述错误选项的错误原因,说清正确选项在句子中作什么成分,解释选择正确选项的原因。结论统一写成“故选x”;\",\n\n语言需要简洁,突出重点,英文翻译要符合习惯和语法。注意,回答的内容不能让用户感知到已知信息的存在。\n","stem":"<stem><p>The reason ______ he gave for being late was ______ he overslept this morning.</p><og cols=\"4\"><op>why; that</op><op>which; that</op><op>why; because</op><op>which; because</op></og></stem>","textStem":"The reason _ he gave for being late was _ he overslept this morning. why; that which; that why; because which; because"},
{"answer":"2","explanation":"考查相似词相近词辨析。句意:你能相信在这样一个富有的国家竟然有如此多的穷人吗?此处such修饰名词,so修饰形容词和副词。故选B。","id":"1566879979937792","ragAnswerExp":"【答案】:B;\n【解析】:考查语法知识。句意:你能相信在这样一个富裕的国家里竟然有这么多穷人。such,意为“如此,这样的”,后面加名词;so,意为“如此,这么”,后面加形容词或副词。第一个空后面是a rich country,是名词短语,所以应该用such;第二个空后面是many people,many是形容词,所以应该用so。故选B。","ragDetailInfo":"根据以下已知信息:\n【题干】:【2018·海淀二模】This view is common _ all sections of the community. across above around along;【答案】:1;【解析】:考查介词。句意:这个观点在社会的各个阶层都非常普遍。across遍及,在……各处;above在……上方;around在……的周围;along沿着……。across all sections of the community意为“遍及各个阶层”,故A选项正确。\n\n【题干】:_ Nancy likes best about college is that she can meet people from all over the country. Where When That What;【答案】:4;【解析】:考查主语从句。句意:最让南茜喜欢大学的(地方)是她能遇到来自全国各地的人。本句中_ Nancy likes best about college主语从句,而主语从句中的谓语动词like缺少宾语,在名词多句中缺少宾语要用what。that在名词从句中不缺少成份时,只起引导词的作用时才用。A与B是副词,不能作宾语。因此选D。 【名师点睛】that与what引导名词从句的区别 that引导名词性从句只起连接作用,在从句中不作任何成分,无意义,在宾语从句通常省略,但在主语从句、表语从句和同位语从句中均不能省略;what除引导从句外,还在从句中作成分,意为“所……的(东西)”,在含义上等于“名词+that”。如: 1. 用that的例子 That she lacks experience is obvious. 她缺少经验,这是显然的。 He realized that she too was exhausted. 他意识到她也精疲力尽。 My idea is that you shouldn’t have left the country. 我的意见是你不应该离开那个国家。 Bob has the mistaken idea that tomorrow is a holiday. 鲍勃错误地认为明天是一个假日。 It was quite plain that he didn’t want to come. 很明显他不想来。 2. 用what的例子 What (=The thing that) he said was true. 他所讲的是事实。 What he had hoped at last came true. 他希望的事终于成为现实。 What she saw gave her a fright. 她看到的情况吓了她一跳。 What I want to say is this. 我想说的是这一点。 I’m sorry for what I said. 我为我说的话表示歉意。 That’s what I want to know. 这是我想知道的。 It was what he meant rather than what he said. 这是他的原意而不是他的原话。 There’s something in what he says. 他的话有些道理。 Her interest was roused by what he said. 他的话引起了她的兴趣。 H注:that 可引导同位语从句,what不能。如: Have you any idea what time it starts? 你知道什么时候开始吗?\n\n【题干】:John _ in the United States for decades, but in the last years he has already adapted to living in China. was living had lived has lived Lived;【答案】:4;【解析】:考查动词时态。句意:约翰在美国生活了很多年,但在最近这几年中他已经适应了在中国的生活。根据 living in China可知约翰现在在中国居住,再结合in the United States 中时间状语for decades可知是过去的事情,故选D项。\n\n下面请解答试题:<stem><p align=\"left\"><span word-font=\"Times New Roman\">Can you believe that in </span><span word-font=\"Times New Roman\">________</span><span word-font=\"Times New Roman\"> a rich country there should be </span><span word-font=\"Times New Roman\">________ </span><span word-font=\"Times New Roman\">many people.</span></p><og cols=\"4\"><op><span word-font=\"Times New Roman\">such, such</span></op><op><span word-font=\"Times New Roman\">such, so</span></op><op><span word-font=\"Times New Roman\">so, so</span></op><op><span word-font=\"Times New Roman\">so, such</span></op></og></stem>,确保答案正确,输出最终的答案与解析,输出格式按照\n\"【答案】:xxx(只写正确答案对应的选项如A、B、C、D);【解析】:考查语法知识或词汇辨析xxx。句意:——xxx。\n解析的内容包含如下二个方面:翻译英文题目的中文释义;阐述错误选项的错误原因,说清正确选项在句子中作什么成分,解释选择正确选项的原因。结论统一写成“故选x”;\",\n\n语言需要简洁,突出重点,英文翻译要符合习惯和语法。注意,回答的内容不能让用户感知到已知信息的存在。\n","stem":"<stem><p align=\"left\"><span word-font=\"Times New Roman\">Can you believe that in </span><span word-font=\"Times New Roman\">________</span><span word-font=\"Times New Roman\"> a rich country there should be </span><span word-font=\"Times New Roman\">________ </span><span word-font=\"Times New Roman\">many people.</span></p><og cols=\"4\"><op><span word-font=\"Times New Roman\">such, such</span></op><op><span word-font=\"Times New Roman\">such, so</span></op><op><span word-font=\"Times New Roman\">so, so</span></op><op><span word-font=\"Times New Roman\">so, such</span></op></og></stem>","textStem":"Can you believe that in _ a rich country there should be _ many people. such, such such, so so, so so, such"}
]

统计,召回内容可定位json查看

  • 9个高中英语单选RAG(Solr) + LLM 的 BAD CASE,RAG(Milvus) + LLM 解答正确6,解答错误3。

8、本地性能测试

测试1(1000知识召回)

以目前测试的高中英语单选题知识库collection为例,llm为Azure GPT4

集合名称 llm_rag_questions_28_2803,数据库量目前为1000左右,召回最大结果为3,最小得分0.6背景下,本地单元测水LLM解答试题耗时如下

  • recall 耗时 :1098 毫秒
  • 在 nput token:1030 和 output token:86 背景下,LLM 解答耗时:10415 毫秒

可以看出recall 耗时间大概是 answer的 1 / 10。

测试2(10000知识召回)

以目前测试的高中英语单选题知识库collection为例,llm为Azure GPT4

集合名称 llm_rag_questions_28_2803,数据库量目前为10000左右,召回最大结果为3,最小得分0.6背景下,本地单元测水LLM解答试题耗时如下

  • recall 耗时 :1194 毫秒
  • 在 nput token:1141 和 output token:145 背景下,LLM 解答耗时:10883 毫秒

可以看出recall 耗时间大概是 answer的 1 / 10。

参考