Test question retrieval method and system based on large model
By introducing large models to the test question search system for semantic understanding and intent recognition, combined with the Elasticsearch library and the BM25 algorithm, the problems of inaccurate search results and slow response speed in the existing technology are solved, and efficient and accurate test question search and sorting are achieved.
Patent Information
- Application Number
- CN202411791292.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-06
- Publication Date
- 2025-04-25
AI Technical Summary
The existing test question search system relies on keyword matching and cannot accurately understand user intentions, resulting in the search results deviating from user needs, and the response speed in front of large-scale data is slow, the sorting is inaccurate, making it difficult to meet the needs of efficient retrieval and precise sorting.
The big model-based test question search method is adopted to NER parse and intent recognition of natural language queries through the big model, extract query features and obtain user's query intent, and search and sort with the Elasticsearch library and BM25 algorithm to achieve correlation sorting and efficient search.
It significantly improves the accuracy and efficiency of the search results, can accurately extract key information in the query, quickly process massive data, ensures rapid response to user queries and return related test questions, reducing the risk of manual intervention and errors.
Smart Images

Figure CN119884336A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a test question retrieval method, system, electronic device and non-transitory computer-readable storage medium based on a large model. Background Art
[0002] At present, traditional test question retrieval systems mainly rely on keyword matching to find relevant test questions. The query entered by the user is matched with the test questions in the question bank through keywords, which can provide basic retrieval functions in simple scenarios.
[0003] However, keyword matching cannot accurately understand the user's query intent, resulting in retrieval results that deviate from user needs. Secondly, traditional test question classification and feature extraction mostly rely on manual annotation, which is inefficient and prone to errors, especially when the scale of the question bank is expanded. Finally, existing retrieval technology has a slow response speed and inaccurate sorting in the face of large-scale data, making it difficult to meet the needs of efficient retrieval and accurate sorting. Summary of the invention
[0004] In view of the technical problems existing in the prior art, the present invention provides a large-model-based test question retrieval method, system, electronic device and non-transitory computer-readable storage medium that can improve the accuracy and efficiency of test question retrieval.
[0005] The technical solution of the present invention to solve the above technical problems is as follows:
[0006] The present invention provides a test question retrieval method based on a large model, the method comprising:
[0007] receiving a natural language query input by a user;
[0008] Performing NER analysis and intent recognition on the natural language query through a large model, extracting corresponding query features and obtaining the user's query intent, wherein the query intent indicates the type of resource data queried by the user;
[0009] According to the extracted query features, the Elasticsearch library is used as a scheduling tool, and the large model Agent calls the Elasticsearch library for retrieval to locate multiple target test questions related to the query features;
[0010] Using a joint search of BM25 search and embedding search, the multiple target test questions are sorted by relevance in combination with the user's query intent to obtain a sorted test question list;
[0011] The sorted test question list is returned to the user as a search result.
[0012] Optionally, the method further includes:
[0013] Determine whether the natural language query input by the user is correct by using the large model, and if the natural language query is incorrect, generate corresponding query information;
[0014] Conduct multiple rounds of dialogue with the user according to the inquiry information;
[0015] According to the context information accumulated in the multiple rounds of conversations, the user's actual search intention is identified, and retrieval is performed based on the actual search intention and the natural language query.
[0016] Optionally, judging whether the natural language query input by the user is correct by using the large model, and if the natural language query is incorrect, generating corresponding query information includes:
[0017] When it is identified that the natural language query has an ambiguous or unclear expression, determining that the natural language query is incorrect;
[0018] generating a confirmation question corresponding to the first natural language query as first inquiry information;
[0019] interacting with the user through the first inquiry information, and receiving feedback information from the user;
[0020] A generation strategy for generating the first query information is dynamically adjusted based on the user's feedback information, and second query information that meets the requirements is generated based on the generation strategy.
[0021] Optionally, the natural language query is subjected to NER parsing and intent recognition by a large model to extract corresponding query features, wherein the query intent indicates the type of resource data queried by the user, including:
[0022] Performing NER analysis on the natural language query through a large model to obtain at least one of grade information, subject information, question type information, and difficulty information;
[0023] According to the grade information, subject information, question type information and difficulty information of the natural language query, corresponding grade features, subject features, question type features and difficulty features are respectively extracted to obtain the initial query features;
[0024] When the requirement information input by the user is parsed, the initial query feature is optimized to obtain the query feature by combining the knowledge graph and the test questions in the Elasticsearch library; if the requirement information is not parsed, the initial query feature is determined as the query feature;
[0025] The natural language query is subjected to intent recognition through a large model to obtain the query intent of the user.
[0026] Optionally, the method further includes updating the test questions in the Elasticsearch library by offline parsing, and the offline parsing step includes:
[0027] Receiving the test document uploaded by the user;
[0028] Analyze the structure of the test document and extract the test content of the test document;
[0029] Structuring the question stem, options, answers, and analysis in the test content to obtain analyzed test content;
[0030] Performing semantic understanding and analysis on the parsed test content through the large model to extract feature labels of the test content;
[0031] The test question content and the corresponding feature tags are stored in the Elasticsearch library.
[0032] Optionally, the combined search using BM25 search and embedding search is used to sort the multiple target test questions by relevance in combination with the user's query intent to obtain a sorted test question list, including:
[0033] Performing an in-depth analysis on the test content of the target test question by using the large model, and converting the target test question into a first semantic vector;
[0034] Calculating the similarity between the first semantic vector and the second semantic vector of the natural language query, and recalling the target test questions based on the similarity to obtain a plurality of recalled test questions;
[0035] According to the BM25 algorithm, the multiple recalled test questions are sorted by relevance in combination with the user's query intention to obtain the sorted test question list.
[0036] Optionally, the method further includes:
[0037] Acquire and analyze the user's historical query information and the user's historical interaction behavior with the Elasticsearch library to obtain the user's first demand;
[0038] Analyze the user's portrait information to obtain the user's second demand;
[0039] The query intention of the user is determined by combining the large model with the first requirement, the second requirement and the language query input by the user.
[0040] Optionally, based on the extracted query features, using the Elasticsearch library as a scheduling tool, calling the Elasticsearch library through the large model Agent for retrieval, and locating multiple target test questions related to the query features, including:
[0041] Extracting corresponding key information from the query features;
[0042] According to the key information, the natural language query is converted into structured search conditions, the Elasticsearch library is used as a scheduling tool, and the Elasticsearch library is called by the large model Agent based on the search conditions to perform retrieval to obtain the target test questions.
[0043] Optionally, the method further includes:
[0044] Use the large model to construct a knowledge point relationship map for each test question in the Elasticsearch library;
[0045] According to the knowledge point relationship map of each of the test questions, identifying the hierarchical knowledge association information between the test questions;
[0046] Based on the hierarchical knowledge association information between the test questions, obtaining associated test questions that have knowledge point associations with the target test question;
[0047] Add the related test questions to the test question list.
[0048] The present invention also provides a test question retrieval system based on a large model, the system comprising:
[0049] A data receiving module, used for receiving a natural language query input by a user;
[0050] A feature extraction module, used to perform NER analysis and intent recognition on the natural language query through a large model, extract corresponding query features and obtain the user's query intent, wherein the query intent indicates the type of resource data queried by the user;
[0051] A test question retrieval module is used to locate multiple target test questions related to the query features by calling the Elasticsearch library through the large model Agent based on the extracted query features and using the Elasticsearch library as a scheduling tool;
[0052] A test question ranking module is used to use a joint search of BM25 search and embedding search to sort the relevance of the plurality of target test questions in combination with the user's query intent, and obtain a sorted test question list;
[0053] The result push module is used to return the sorted test question list as the search result to the user.
[0054] In addition, to achieve the above-mentioned purpose, the present invention also proposes an electronic device, comprising: a memory for storing a computer software program; a processor for reading and executing the computer software program, thereby implementing a large model-based test question retrieval method as described above.
[0055] In addition, to achieve the above-mentioned purpose, the present invention also proposes a non-transitory computer-readable storage medium, in which a computer software program is stored. When the computer software program is executed by a processor, it implements a test question retrieval method based on a large model as described above.
[0056] The beneficial effects of the present invention are:
[0057] (1) The present invention introduces a large model to understand the semantics of user natural language queries, and can accurately extract key information in the query, such as grade, subject, question type, difficulty, etc., significantly improving the accuracy of the search results. At the same time, combined with the Elasticsearch (ES) library and the BM25 algorithm, it can quickly process massive data, ensure rapid response to user queries and return relevant test questions, and significantly improve the search efficiency.
[0058] (2) The present invention can automatically extract the characteristic labels of test questions, such as grade, subject, question type, difficulty, etc., through a large model, which can avoid the problem of traditional question banks relying on manual labeling. Automated classification and feature extraction not only improves the efficiency of question bank management, but also supports the dynamic expansion and update of the question bank, reducing manual intervention and error risks.
[0059] (3) The present invention can understand the user's natural language query and automatically generate structured search conditions, without the need for the user to manually enter specific keywords. Through intelligent semantic understanding, it can more accurately identify the user's search intent and improve the user experience. In addition, personalized recommendations can be made based on the user's historical queries and behaviors to further optimize the learning effect.
[0060] (4) The present invention supports real-time updating and expansion of the question bank. New questions can be automatically added to the ES library through the offline parsing module and feature tags are generated. The dynamic expansion capability ensures that the question bank can adapt to the growing amount of data and ensures that the question bank content is always up to date.
[0061] (5) The present invention can utilize the distributed architecture and powerful search capabilities of Elasticsearch, and can efficiently store and retrieve large-scale test data. While ensuring the accuracy of retrieval, it can quickly respond to user queries and meet the needs of high performance.
[0062] In summary, the present invention can improve the accuracy and efficiency of test question retrieval, provide users with an intelligent retrieval experience, and the corresponding retrieval system also has strong scalability and performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] Figure 1 A flowchart of a test question retrieval method based on a large model provided by the present invention;
[0064] Figure 2 It is a schematic diagram of the interaction between the terminals when executing the method provided by the present invention;
[0065] Figure 3 It is a schematic diagram of the system provided by the present invention executing the online process and the offline process respectively;
[0066] Figure 4 A schematic diagram of the structure of a test question retrieval system based on a large model provided by the present invention;
[0067] Figure 5 A schematic diagram of the hardware structure of a possible electronic device provided by the present invention;
[0068] Figure 6 A schematic diagram of the hardware structure of a possible computer-readable storage medium provided by the present invention. DETAILED DESCRIPTION
[0069] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0070] In the description of the present invention, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0071] In the description of the present invention, the term "for example" is used to mean "used as an example, illustration or explanation". Any embodiment described as "for example" in the present invention is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is given to enable any technician in the field to implement and use the present invention. In the following description, details are listed for the purpose of explanation. It should be understood that a person of ordinary skill in the art can recognize that the present invention can be implemented without using these specific details. In other examples, well-known structures and processes will not be elaborated in detail to avoid obscuring the description of the present invention with unnecessary details. Therefore, the present invention is not intended to be limited to the embodiments shown, but is consistent with the widest scope consistent with the principles and features disclosed in the present invention.
[0072] See also Figure 1 and Figure 2 , Figure 1 A flowchart of a test question retrieval method based on a large model of the present invention is provided. Figure 2 It is a schematic diagram of the interaction between the terminals when executing the method provided by the present invention;
[0073] like Figure 1 The present invention shown may include the following steps:
[0074] Step 201: Receive a natural language query input by a user.
[0075] The natural language query input by the user refers to the user describing his / her requirements for test questions through simple text or sentences. Specifically, the user can input the test question requirements in the form of natural language, usually in the form of a sentence or a short sentence. For example, the user may input queries similar to the following: "Please help me find chemistry multiple-choice questions for the second grade of junior high school, which are more difficult", "I need some English cloze questions with lower difficulty", "Can you find physics multiple-choice questions suitable for third grade students".
[0076] In the present invention, receiving natural language queries input by users is one of the core links. Relying on a large model for deep semantic understanding, it is possible to extract rich query features from the user's simple language description. In this way, the system can bypass the limitations of traditional keyword-based retrieval processes and achieve a more flexible and accurate retrieval process, greatly improving user experience and retrieval efficiency.
[0077] In some embodiments, the method of the present invention may further include:
[0078] Determine whether the natural language query input by the user is correct by using the large model, and if the natural language query is incorrect, generate corresponding query information;
[0079] Conduct multiple rounds of dialogue with the user according to the inquiry information;
[0080] According to the context information accumulated in the multiple rounds of conversations, the user's actual search intention is identified, and retrieval is performed based on the actual search intention and the natural language query.
[0081] In some embodiments, a large model can be used to determine whether the natural language query input by the user is correct, and when the query is unclear or erroneous, corresponding inquiry information is generated, multiple rounds of dialogue are conducted with the user, and the user's true search intention is finally identified. This process aims to improve the intelligence level of the system so that it can more accurately understand and meet user needs.
[0082] The big model can understand the natural language queries entered by the user and determine whether the query conforms to certain specifications or logic. If the user's query is semantically ambiguous, key information is missing, or the expression is unclear, the system will automatically detect these problems. For example, the query is unclear, and the user enters "I want to find a difficult question" but does not specify the grade, subject, or question type. For example, if the query is ambiguous, the user enters "find a challenging math problem", the system may not be able to determine the meaning of "challenging" in a specific subject or question type. In these cases, the system can use the natural language understanding capabilities of the big model to determine that the query is inaccurate, unclear, or incomplete.
[0083] In some embodiments, when the large model determines that the user's query is unclear or incorrect, the system can automatically generate an inquiry message to ask the user to clarify the query content. The purpose of these inquiry messages is to help users supplement the missing key information so that the system can understand the user's needs more accurately. Common examples of inquiry messages are as follows: "Which year's test questions do you need? Grade 8 or Grade 9?" "Do you need math, physics, or chemistry questions?" "Do you mean difficult multiple-choice questions, or other types of questions?".
[0084] At this point, the system can gradually refine the user's query intent through multiple rounds of dialogue with the user. For example, the system first asks about the grade, then the subject, and finally the question type and difficulty. In this way, the system can "guide" the user to gradually clarify their needs.
[0085] During multiple rounds of dialogue, the system will continue to accumulate and save user feedback information (such as grade, subject, question type, difficulty, etc.). This information is analyzed and combined through a large model to form a complete context. Through the accumulated context information, the system can identify the user's true search intention, that is, to clarify the type and characteristics of test questions required by the user in a specific situation.
[0086] For example, after a round of inquiries, the system learns that the user needs chemistry multiple-choice questions for the third grade of junior high school, which are of high difficulty. At this time, the system can more accurately understand the user's needs through contextual information, and use it as a query condition to perform accurate test question retrieval.
[0087] When the system recognizes the user's true intention through multiple rounds of dialogue and accumulated context information, it can combine this information with the original natural language query to form a complete and accurate search condition. For example, if after the dialogue, the system recognizes that the user needs "high-difficulty multiple-choice questions for junior high school chemistry", then the system will query the question bank based on this key information and retrieve questions that meet the conditions.
[0088] The entire retrieval process not only relies on key information extracted from natural language (such as grade, subject, question type, difficulty, etc.), but also takes into account the user's intention and context to ensure the relevance and accuracy of the retrieval results.
[0089] The present invention uses the semantic understanding ability of the large model to judge the accuracy of natural language queries when users enter them, and generates inquiry information through multiple rounds of dialogue when the query is unclear, helping users to supplement key information. Through these accumulated contextual information, the system can identify the user's true search intention, and finally perform accurate searches in the database to ensure that the system can efficiently and accurately return test questions that meet user needs. This process makes the user experience more natural and smooth, and can effectively avoid retrieval errors caused by inaccurate keyword matching in traditional systems.
[0090] In some embodiments, the step of "determining whether the natural language query input by the user is correct by using the large model, and generating corresponding query information if the natural language query is incorrect" includes:
[0091] When it is identified that the natural language query has an ambiguous or unclear expression, determining that the natural language query is incorrect;
[0092] generating a confirmation question corresponding to the first natural language query as first inquiry information;
[0093] interacting with the user through the first inquiry information, and receiving feedback information from the user;
[0094] A generation strategy for generating the first query information is dynamically adjusted based on the user's feedback information, and second query information that meets the requirements is generated based on the generation strategy.
[0095] In this solution, when the system recognizes that the natural language query entered by the user is ambiguous or unclear, the system will determine that the query is incorrect and interact with the user by generating confirmatory questions to clarify the query content. The following is a detailed explanation of this process:
[0096] In some embodiments, the system can perform semantic analysis on the natural language query input by the user through the big model. When the user's query is ambiguous or unclear, the big model can detect this inaccuracy. For example, the user inputs "find a difficult question" but does not clearly specify the standard, grade, subject or question type of "difficult", or the user inputs "find a math question" but does not further specify whether it is a multiple-choice question, a fill-in-the-blank question or a problem-solving question.
[0097] The natural language queries at the above distances are all vague or ambiguous expressions. The system uses its semantic understanding capabilities to determine that these queries lack sufficient contextual information or key information, resulting in the inability to directly perform effective retrieval. Therefore, the system determines that the natural language query is "incorrect".
[0098] Once the system determines that the query is incorrect, it will generate a confirmation question as the first inquiry information. The purpose of this question is to help the system obtain key information that the user is not clear about. Confirmation questions usually include: grade information: such as "What grade do you need the test questions for?", subject information: such as "Is it a math question? Or another subject?", question type information: such as "Do you need multiple-choice questions or fill-in-the-blank questions?", difficulty requirements: such as "When you mentioned difficult questions, do you mean medium difficulty or high difficulty?" In this way, the system can further clarify the specific requirements of the query, thereby ensuring that subsequent retrieval can more accurately meet user needs.
[0099] In some embodiments, after the system asks the user the first query information, the user can provide feedback information based on the question. The feedback information can help the system supplement or correct the deficiencies in the original query. For example, the user answers: "I want the math multiple-choice questions for the third grade of junior high school, which are more difficult." At this point, the system has obtained more specific information and can correct the initial query.
[0100] In multiple rounds of interaction, the system will dynamically update its understanding based on user feedback and gradually clarify the real needs of the query. The feedback information provided by the user (such as grade, subject, question type, etc.) will be used as supplementary query information to ensure that the final search conditions are more accurate.
[0101] In some embodiments, the system can dynamically adjust the strategy of generating confirmatory questions based on the feedback information provided by the user. For example, in the first query, the system may only ask about the grade or subject, but after the user answers, the system will recognize that there are still other ambiguous parts (such as question type or difficulty) in the current query, and thus adjust the subsequent query strategy to continue to ask the user more specific questions.
[0102] The dynamic adjustment strategy ensures that the system continuously optimizes the query content during the conversation and gradually refines the user's needs. For example, if the user first answers "find a difficult question", the system may continue to ask "What is the definition of difficult? Is it a question as difficult as the college entrance examination or a simpler question?" to ensure that the second round of questions can help the user further clarify their needs.
[0103] In these adjusted queries, the system can generate a second query information that meets the user's needs based on the user's feedback information. This second round of queries will be more refined, targeting the deficiencies in the previous round of answers, further refining the user's needs, and ultimately forming accurate search conditions.
[0104] The present invention can continuously approach the user's real search intention and ultimately achieve accurate test question retrieval through clear query conditions. This intelligent interaction method effectively improves the user experience and avoids erroneous or irrelevant search results caused by inaccurate keyword matching in traditional search methods.
[0105] Step 202: Perform NER analysis and intent recognition on the natural language query through the big model, extract the corresponding query features and obtain the query intent of the user, wherein the query intent indicates the type of resource data queried by the user, and NER analysis refers to named entity recognition. By analyzing the natural language query through the big model, the named entities in the natural language query can be identified and the entities can be classified. The user's query intent can be used to determine what type of resource data the user needs to query, for example, the resource data can be test papers, lesson plans, test questions, etc.
[0106] In some embodiments, step 202 may include:
[0107] Performing NER analysis on the natural language query through a large model to obtain at least one of grade information, subject information, question type information, and difficulty information;
[0108] According to the grade information, subject information, question type information and difficulty information of the natural language query, corresponding grade features, subject features, question type features and difficulty features are respectively extracted to obtain the initial query features;
[0109] When the requirement information input by the user is parsed, the initial query feature is optimized to obtain the query feature by combining the knowledge graph and the test questions in the Elasticsearch library; if the requirement information is not parsed, the initial query feature is determined as the query feature;
[0110] The natural language query is subjected to intent recognition through a large model to obtain the query intent of the user.
[0111] According to this scheme, the following is a detailed explanation of the relevant process:
[0112] In some embodiments, when a user inputs a natural language query, the system uses a large model to perform semantic analysis on the query and extract key information. Specifically, the system will identify the following information: Grade information: For example, the user may mention grades such as "junior high school", "senior high school", etc. These are key information that the system needs to parse out. Subject information: For example, the query may contain subject names such as "mathematics", "English", and "physics". Question type information: Users may mention specific question types such as "multiple choice questions", "fill in the blanks", and "answer questions". Difficulty information: Such as "simple", "medium", "high difficulty", etc., users may express their requirements for the difficulty of the test questions.
[0113] This information is often ambiguous in natural language queries, so the task of the large model is to extract this key information from the input natural language, at least one of them, such as grade, subject, question type or difficulty information.
[0114] Once the grade, subject, question type or difficulty information is parsed, the system will extract features respectively. These features are the most critical components of user queries and represent different dimensions of user needs. Grade features: Extract features such as teaching content or knowledge points of a specific grade based on grade information (such as "junior high school grade 9" or "senior high school grade 11") to help screen test questions suitable for that grade. Subject features: Extract test question features of a specific subject based on subject information (such as "mathematics" or "physics"). Question type features: Identify question type information (such as "multiple choice questions" or "fill in the blank questions") and extract features of the corresponding question type to match user needs. Difficulty features: Extract features of difficulty levels through difficulty requirements (such as "medium difficulty" or "high difficulty") to ensure that recommended test questions meet the user's difficulty requirements. Based on the extracted features, the system combines these features into initial query features. These features help the system roughly determine the initial direction of the query and provide a basis for subsequent retrieval.
[0115] After parsing the key information of user needs and forming the initial query features, the system will further optimize the query features in the following ways: Combination of knowledge graphs: The system can use pre-built knowledge graphs, which are graph structures based on multi-dimensional relationships such as knowledge points, subjects, and difficulty. The knowledge graph helps the system understand the intrinsic connections between different query features. For example, the knowledge points of certain subjects may be learned from a certain grade, or a certain question type is more common within a certain difficulty range.
[0116] The system can optimize query features by analyzing the query features and the associated information in the knowledge graph. For example, if a user mentions "high school physics multiple choice questions", the system can determine the knowledge point association between "high school" and "physics" through the knowledge graph and further refine the query features.
[0117] After extracting the initial query features, the system will also use the data in the Elasticsearch library for retrieval. As a powerful search engine, Elasticsearch can quickly match based on features and return relevant test information. The system compares the query features with the test data stored in the library to find the test questions that best meet the user's needs. The Elasticsearch library can not only help retrieve relevant test questions, but also sort the search results according to the query features and return the most relevant test questions.
[0118] Accordingly, if the system fails to clearly parse the user's required information (such as grade, subject, question type or difficulty) in a natural language query, the system will default to using the initial query features as the final query features for subsequent retrieval.
[0119] This usually happens when the user's query is relatively simple or the information is incomplete. For example, the user only enters "math questions" or "difficult" without specifying the grade or question type. The system will then perform a search based on some of the extracted features (such as subject and difficulty).
[0120] The present invention gradually optimizes query features by combining natural language query analysis, feature extraction, knowledge graphs and Elasticsearch libraries. This method ensures that even if the query information is incomplete or unclear, the system can ensure that it matches the user's needs as accurately as possible through dynamic optimization, thereby providing more accurate test question recommendations or retrieval results. This optimization process improves the intelligence level of the system and effectively solves the fuzzy, inefficient and irrelevant retrieval problems that may occur in traditional retrieval methods.
[0121] In some embodiments, the test questions in the Elasticsearch library may be updated by offline parsing, wherein the offline parsing steps include:
[0122] Receiving the test document uploaded by the user;
[0123] Analyze the structure of the test document and extract the test content of the test document;
[0124] Structuring the question stem, options, answers, and analysis in the test content to obtain analyzed test content;
[0125] Performing semantic understanding and analysis on the parsed test content through the large model to extract feature labels of the test content;
[0126] The test question content and the corresponding feature tags are stored in the Elasticsearch library.
[0127] like Figure 3 As shown, it can be seen that the system of the present invention performs the difference between the online process and the offline process. According to this solution, the following is a detailed explanation of the relevant process:
[0128] It can be understood that the online process in the present invention adopts the BM25 algorithm for retrieval, while the offline process adopts the embedding retrieval method, so that the present invention can realize the joint retrieval of BM25 retrieval and embedding retrieval, which is specifically explained below.
[0129] During system initialization or daily updates, the system can process all retrieved texts (such as test content, analysis, knowledge points, etc.) and store them in the ES library. The specific process includes:
[0130] First, the retrieval text is semantically analyzed through a pre-trained large model (such as BERT, GPT, etc.) to generate the corresponding embedding vector. The embedding vector is a numerical representation of the text that can capture the semantic features of the text. The embedding vector of each text is then stored in the ES library together with its original text. Vector data is usually stored in a specific field of ES to facilitate subsequent retrieval and matching. This approach ensures that the system can use semantic vectors for efficient similarity calculations, rather than relying solely on keyword or string matching.
[0131] When a user enters a natural language query, the system can process the user's query. The user's query is processed by the same large model to generate an embedding vector to represent the semantic information of the query. The model performs deep semantic analysis on the user's query to ensure that the generated vector is in the same semantic space as the pre-stored text vector, which can ensure the accuracy of the similarity calculation.
[0132] When searching in ES, the system can calculate the cosine similarity between the embedding vector of the user's query and the pre-stored text embedding vector. The similarity value range is between [-1,1]. The closer the value is to 1, the more consistent the direction of the vector is, that is, the more similar the semantics of the two are. ES can sort the search results according to the cosine similarity value, and give priority to returning the text that is closest to the user's query semantics.
[0133] By matching embedding vectors and cosine similarity, not only can texts with semantic consistency with user queries be found, but also retrieval omissions caused by different words in traditional keyword matching can be avoided. Due to the high efficiency of vector calculation, the system can process large-scale text data and return results quickly. After the user enters the query, the system can instantly generate vectors and complete the match to ensure a smooth search experience. This method can significantly improve the semantic understanding ability and accuracy of the search, and is suitable for complex natural language query scenarios, such as test question retrieval and intelligent question and answer.
[0134] In the specific implementation scenario, when processing the test document, the structure of the test document needs to be parsed first. The test document may be stored in different formats (such as PDF, Word, Excel, etc.), containing multiple elements such as text, images, tables, etc. The purpose of parsing is to extract these elements and obtain the core content of the test. The main steps include: identifying the test structure in the document, such as the stem, options, answers, and analysis. Extract relevant information of the test from the document, which may include the text description of the question, answer options (such as single-choice questions, fill-in-the-blank options), correct answers, analysis parts, etc. For example, if the document contains a multiple-choice question, the system needs to identify the stem part, options (such as A, B, C, D), the correct answer (such as C), and the analysis part (such as the analysis or solution process of the question).
[0135] After extracting the elements of the test questions, these elements can be structured. Structuring means converting the test question content, which was originally plain text, into a standardized, unified format structure for further processing, storage, and retrieval. Specifically, it includes:
[0136] The main part of the question, i.e. the stem, can be extracted from the test document. For example, the main content of a multiple-choice question, a true-or-false question, or a fill-in-the-blank question. Then extract and mark all the options, especially for multiple-choice questions (such as A, B, C, D), extract each option independently to facilitate subsequent analysis. Then mark the correct answer to the question (such as "Option C") to provide a basis for subsequent retrieval or teaching analysis. If the test question contains a solution process or analysis part, the system will extract and mark the analysis content, which helps provide detailed problem-solving ideas and steps.
[0137] Through structured processing, the various components of the test questions can be clearly divided into independent data fields, which is convenient for subsequent processing and analysis.
[0138] After the structural processing is completed, the test content can be semantically understood and analyzed through a large model (such as a natural language processing model). The task of the large model is to identify the key information in the test questions and assign feature labels to the test questions. These labels can help the system understand the nature, classification and scope of application of the test questions. Feature labels may include: grade labels, subject labels, question type labels, difficulty labels, and knowledge point labels.
[0139] Through semantic analysis of the big model, the system can deeply understand the connotation of the question stem, options, answers and explanations, and automatically extract feature tags related to the test questions. This process can improve the level of automatic annotation of test questions, avoid manual intervention, and be more efficient and accurate.
[0140] Finally, the system can store the extracted test content and corresponding feature tags in the Elasticsearch library. Elasticsearch is a powerful search engine used to store, search and analyze large amounts of text data. The main steps of storing in the Elasticsearch library include: Storing test content: Store the structured test content (such as questions, options, answers, and analysis) in Elasticsearch in the form of documents. Storing feature tags: Store the feature tags extracted from the large model (such as grade, subject, question type, difficulty, knowledge points, etc.) as metadata in the test document.
[0141] By storing the test content and tags in the Elasticsearch library, the system can efficiently retrieve and manage a large amount of test data. When users make queries, the system can perform accurate searches based on feature tags and quickly return relevant test results.
[0142] The present invention realizes automatic processing and efficient management of test questions by parsing test question documents, processing test question contents in a structured manner, using a large model for semantic analysis and extracting feature tags, and storing the test question contents and tags in the Elasticsearch library. This process greatly improves the processing efficiency, accuracy and searchability of test question data, and can effectively support the construction of a large-scale question bank and efficient retrieval.
[0143] Step 203: Based on the extracted query features, the Elasticsearch library is used as a scheduling tool, and the large model Agent calls the Elasticsearch library for retrieval to locate multiple target test questions related to the query features. The query based on the Elasticsearch library is implemented by the large model Agent. The json of the schedulable tool generated by the large model is used to use the Elasticsearch library as a scheduling tool. The large model independently determines whether the scheduling tool is needed, or only enters the chat mode, etc.
[0144] In some embodiments, step 203 may further include:
[0145] Extracting corresponding key information from the query features;
[0146] According to the key information, the natural language query is converted into structured search conditions, the Elasticsearch library is used as a scheduling tool, and the Elasticsearch library is called by the large model Agent based on the search conditions to perform retrieval to obtain the target test questions.
[0147] After the user enters a natural language query, the query can be feature extracted. These query features include information such as grade, subject, question type, difficulty, etc. In this step, the system extracts "key information" related to test question retrieval from the query entered by the user.
[0148] Through the analysis of the large model, the system can accurately extract these key information from natural language queries. This information provides basic data for subsequent retrieval.
[0149] After extracting key information, the system converts this information into structured search conditions. Structured search conditions are a formatted data representation that converts fuzzy information in natural language into structured queries that can be accurately searched in search engines. For example, the structured search conditions that a user may query for "high school math multiple choice questions" are: grade: high school, subject: math, question type: multiple choice questions.
[0150] By converting natural language queries into this structured format, the system can effectively reduce ambiguity and ensure the accuracy of subsequent retrieval.
[0151] After being converted into structured search conditions, the system can search in the Elasticsearch library. Elasticsearch is an efficient full-text search engine that can quickly return matching results from massive data based on query conditions. The specific process includes:
[0152] The system can construct a query request that conforms to the Elasticsearch format based on the user's search conditions. For example, the query may be filtered or matched based on fields such as "grade", "subject", "question type", and "difficulty".
[0153] Elasticsearch searches for test documents that match the search criteria in the index through query requests. These documents contain information such as the content of the test questions and feature tags.
[0154] Elasticsearch returns relevant test questions based on the matching degree of the search criteria. During this process, Elasticsearch will sort the test questions according to relevance to ensure that the most relevant test questions are ranked first.
[0155] In this way, the system can accurately filter out target test questions that meet the requirements from a large number of test questions based on the user's natural language query, which can significantly improve the accuracy and efficiency of test question retrieval and ensure that users can quickly find test questions that meet their needs.
[0156] Step 204: Use a joint search of BM25 search and embedding search to sort the relevance of the plurality of target test questions in combination with the user's query intent, and obtain a sorted test question list.
[0157] In some embodiments, step 204 may include:
[0158] Performing an in-depth analysis on the test content of the target test question by using the large model, and converting the target test question into a first semantic vector;
[0159] Calculating the similarity between the first semantic vector and the second semantic vector of the natural language query, and recalling the target test questions based on the similarity to obtain a plurality of recalled test questions;
[0160] According to the BM25 algorithm, the multiple recalled test questions are sorted by relevance in combination with the user's query intention to obtain the sorted test question list.
[0161] In the specific implementation, after retrieving the target test questions that meet the conditions, the big model will conduct an in-depth analysis of the content of each test question. Specifically, the big model will semantically understand the text content of the test question (such as the question stem, options, answers, etc.) and convert it into a semantic vector. The semantic vector is a way of expressing text information in numerical form. It can retain the important semantic features of the test question and facilitate subsequent calculations.
[0162] The semantic vector represents the deep meaning of the test content. It is not just a simple match of the literal content, but also takes into account the semantic relationship behind the sentence. For example, "solving equations" in the test content may have a similar representation in the semantic vector space as "solving algebraic expressions", even if they are different in words. The purpose is to convert the test content into a vector that can reflect its deep semantics, making the subsequent matching and sorting process more accurate.
[0163] Next, the system can analyze the user's natural language query through the big model to obtain a second semantic vector. Similar to the processing of the target test question, the second semantic vector represents the semantic features of the user's query, which can cover the user's query intention, such as grade, subject, difficulty, etc.
[0164] Then, the similarity between the first semantic vector (the semantic representation of the target test question) and the second semantic vector (the semantic representation of the user query) can be calculated. This similarity value measures the degree of semantic matching between the query and the test question. Common calculation methods include cosine similarity, Euclidean distance, etc. High similarity means that the content of the target test question is semantically very compatible with the user's query intent. Low similarity indicates that the test question has a low match with the query and may require further screening. By calculating semantic similarity, the system can quantitatively evaluate the relationship between the test question and the query, thereby providing a basis for subsequent recall and sorting.
[0165] Based on the calculated similarity, the system can recall the target questions that are most relevant to the user's query according to the set threshold. The recall process actually selects the questions that have a high degree of match with the query intent from all the retrieved questions. The recall process is not just a simple selection of matching questions from the query conditions, but further optimizes the recall results based on semantic similarity. This process ensures that the most semantically relevant questions are extracted, not just based on traditional keyword matching.
[0166] It can be understood that the recalled test questions are the batch of test questions that are semantically closest to the query intent, and usually include multiple candidate test questions, which are ranked based on their similarity to the user query.
[0167] After the recall phase is completed, the system can use the BM25 algorithm to sort the recalled questions by relevance. BM25 is a classic sorting algorithm that is widely used in the field of information retrieval. It can perform weighted sorting on the recalled questions based on factors such as word frequency and document length to ensure that the sorting results are most relevant to the user's query.
[0168] In some embodiments, the BM25 algorithm can sort the questions based on factors such as the keyword match between each question and the query, word frequency, etc. For example, the more frequently the keywords mentioned in the query appear in the question, the higher the relevance score of the question. When sorting, other factors such as the difficulty of the question, the subject type, etc. can also be considered to ensure that the sorted question list meets the actual needs of the user.
[0169] Finally, the list of test questions sorted by BM25 will be sorted according to the user's query intent to ensure that users can see the most relevant test questions that best match their query intent.
[0170] The method of the present invention based on semantic vector and BM25 sorting makes the test question retrieval not only more accurate but also able to flexibly adapt to the needs of different users, thereby improving the retrieval efficiency and the relevance of the results.
[0171] In some embodiments, the method of the present invention may further include:
[0172] Acquire and analyze the user's historical query information and the user's historical interaction behavior with the Elasticsearch library to obtain the user's first demand;
[0173] Analyze the user's portrait information to obtain the user's second demand;
[0174] The query intention of the user is determined by combining the large model with the first requirement, the second requirement and the language query input by the user.
[0175] In the specific implementation, the system can first obtain and analyze the user's historical query information and historical interaction behavior with the Elasticsearch library. This information includes the user's previous search history, the type of test questions queried, frequently searched subjects, difficulty and other data, as well as the user's interaction process with the system, such as which test questions the user clicked on and which detailed information of the questions he viewed.
[0176] Among them, historical query information refers to all query records entered by users when using the system. These queries can reflect the interests and needs of users, such as test questions of a certain subject, grade, or a specific difficulty level. Historical interaction behavior refers to how users interact with the system after querying test questions. For example, users click on certain test questions, view the answers or explanations of certain test questions, and even select which test questions to collect or download. These behaviors can help the system further understand the content and fields preferred by users.
[0177] After analyzing this information, the system can extract the first demand, that is, the user's past demand preferences. Through this historical data, the system can infer the user's most frequently searched content, specific points of interest or query patterns, etc. For example, if a user has frequently searched for test questions about "math, algebra, medium difficulty" in the past, the system can infer that his first demand is related to these elements.
[0178] In some embodiments, based on obtaining and analyzing historical query information and interaction behaviors, the system can also analyze user portrait information to obtain a second demand.
[0179] Among them, user portrait is a user feature model built by collecting user personal information, behavior data, points of interest, etc. For example, user age, subject preference, historical grades and other data.
[0180] In some embodiments, based on the user portrait, the system can infer the user's long-term demand trend or potential demand. For example, if the user is a high school student and his subject preference is "physics", the system can infer that the user's second demand is more "physics-related test questions" or "higher difficulty physics test questions".
[0181] The system analyzes the user's profile information to understand the user's learning background, knowledge structure, subject interests, etc., and further obtains the user's long-term needs or potential query preferences. This demand may be a learning feature accumulated over a long period of time, or it may be a behavioral pattern exhibited by the user in a specific period of time.
[0182] Finally, the system can determine the user's query intention by combining the first requirement (historical query information and interaction behavior), the second requirement (user portrait information) and the natural language query input by the user through a large model.
[0183] The big model is a powerful natural language processing model that can understand and analyze the user's query intent. The big model can dynamically generate the query interpretation that best meets the user's needs based on the query content entered by the user, combined with the user's historical interest preferences and information in the user profile.
[0184] For example, a user enters a query: "Please give me some geometry questions of moderate difficulty suitable for junior high school students." In this case, the big model will combine the following information: the first requirement may be that the user has frequently searched for math questions of moderate difficulty in the past; the second requirement may be that the user's profile shows that he is a junior high school student and may be inclined to subject areas such as geometry; the natural language query clearly expresses "geometry questions suitable for junior high school students." After combining the above information, the big model will comprehensively judge the user's query intention and ultimately determine that the user needs "geometry questions of moderate difficulty suitable for junior high school students."
[0185] The present invention can dynamically adjust the user's query intention while combining the user's historical data and personalized characteristics to provide test question recommendations that better meet the user's needs.
[0186] In some embodiments, the method of the present invention may further include:
[0187] Use the large model to construct a knowledge point relationship map for each test question in the Elasticsearch library;
[0188] According to the knowledge point relationship map of each of the test questions, identifying the hierarchical knowledge association information between the test questions;
[0189] Based on the hierarchical knowledge association information between the test questions, obtaining associated test questions that have knowledge point associations with the target test question;
[0190] Add the related test questions to the test question list.
[0191] In the specific implementation, the big model can be used to analyze and understand the knowledge point information of all test questions in the Elasticsearch library. The knowledge point relationship graph is a structured data model that represents the interrelationships between test questions, describing how the various knowledge points of the test questions are related to and influence each other. Each test question involves certain knowledge points, which usually belong to a certain topic in a certain subject. For example, in a math test question, the knowledge point may be "application of algebraic formulas", "geometry knowledge points" or "statistical principles".
[0192] Through the big model, we conduct in-depth semantic analysis on the content of each test question, identify the knowledge points involved, and construct a knowledge point relationship map based on the logical relationship between these knowledge points (such as the difficulty level from basic to in-depth, the interdependence of different knowledge points, etc.).
[0193] The relationship map connects the knowledge points in the test questions in a hierarchical manner, helping the system understand which knowledge points are closely related and which knowledge points may be the basis or prerequisite for subsequent knowledge points.
[0194] It can be understood that once the knowledge point relationship map is constructed, the system will be able to analyze each test question and its corresponding knowledge point in the map and identify the hierarchical knowledge relationship information between the test questions.
[0195] There may be a certain hierarchical structure between the knowledge points involved in different test questions. For example, some test questions may be based on basic knowledge points (such as basic algebraic operations), while other test questions may rely on more advanced knowledge points (such as calculus or geometry theorems). The system can identify these hierarchical knowledge associations through the structure of the graph.
[0196] For example, a math question involves the knowledge point of "solution of linear equations", while another question involves the knowledge point of "solution of quadratic equations". There may be some hierarchical relationship between the two questions, because linear equations are a basic knowledge point of quadratic equations. By analyzing the relationship graph of these knowledge points, the system can identify which questions have knowledge relationships and can sort or classify these questions according to the knowledge hierarchy.
[0197] Based on the identified hierarchical knowledge association information, the system can determine which questions are related to the target question in terms of knowledge points. These related questions are usually questions that are directly related to one or more knowledge points of the target question.
[0198] By analyzing the knowledge point relationship map, the system can identify questions with similar or adjacent knowledge points to the target question. For example, if the target question involves "derivative of function", the system may identify related questions such as "application of derivative" or "limit and derivative".
[0199] These "related questions" not only match the knowledge points of the target questions, but may also involve the same difficulty, subjects or teaching objectives.
[0200] Finally, the system adds the identified related questions to the question list and displays them together with the target questions. In this way, when users query and retrieve target questions, they can not only get questions directly related to the target questions, but also see other questions that are related to the target questions at the knowledge point level. For example, assuming that the user is querying questions related to "linear algebra", the system may add questions related to linear algebra knowledge points to the result list, such as "methods for solving linear equations" and "matrix operations".
[0201] The related test questions of the present invention can help users understand the broader knowledge field involved in the target test questions and promote users' learning of related knowledge through hierarchical analysis of the knowledge point relationship map.
[0202] Step 205: Return the sorted test question list to the user as a search result.
[0203] Specifically, according to this solution, the following is a detailed explanation of "returning the sorted test question list to the user as a search result":
[0204] In the present invention, the retrieval process of test questions includes multiple steps, especially semantic understanding through a large model, sorting test questions based on the BM25 algorithm, and relevance sorting based on the user's query intent. Finally, these test questions are sorted to generate a list of test questions, and the position of each test question in the list is determined according to its relevance to the user's query.
[0205] Through the large model, the content of the target test questions is deeply analyzed, the test questions are converted into semantic vectors, and the similarity is compared with the query entered by the user to obtain a set of preliminary recalled test questions. Relevance sorting is based on the BM25 algorithm, query intent, historical interaction data, etc., to sort these recalled test questions to ensure that the top questions are the most in line with the user's query intent. Optimized sorting means that the sorted test question list not only relies on keyword matching, but also optimizes through multiple rounds of dialogue, query context and other factors to ensure the relevance and accuracy of the test question list.
[0206] When the sorting is completed, the sorted list of questions becomes the search result. According to this solution, these question lists will be returned to the user to help the user obtain the required question content. The returned question list contains the questions most relevant to the user's query, and these questions have been optimized and sorted by the system to meet the user's needs as much as possible.
[0207] The user interface is that the user enters the system through natural language query. After comprehensive analysis based on the user's input, historical behavior, and personalized needs, the system returns the retrieved test question list to the user for review and selection. Due to the combination of the large model and the BM25 algorithm, the order in which these test question lists are presented usually reflects their relevance to the user's query. This ensures that users can quickly find the test questions that best meet their needs.
[0208] The returned sorted list of questions is not just a simple list of questions, but a result of multiple optimizations and screenings, usually displayed in a clear and easy-to-read form on the user interface, including: Question information: Each question may include information such as the question stem, options, answers, and analysis, so that users can directly obtain detailed content when viewing the results. It also includes related information: If there are related questions, the system may also display some other questions or knowledge points related to the current query to expand the user's query vision and help users learn in depth.
[0209] In summary, the core logic of the sorted test list of the present invention as a search result returned to the user is to ensure that the returned test questions best meet the user's query intention and learning intention through precise semantic analysis and sorting algorithms. When the user enters a natural language query, the system not only retrieves relevant test questions, but also sorts these test questions according to relevance, user needs and query context, thereby improving the accuracy of the search results and user experience.
[0210] See also Figure 4 , Figure 4 A schematic diagram of the structure of a test question retrieval system based on a large model provided by the present invention.
[0211] like Figure 4 As shown, a test question retrieval system based on a large model proposed in an embodiment of the present invention includes:
[0212] See also Figure 5 , Figure 5 Schematic diagram of an electronic device provided by an embodiment of the present invention. Figure 5 As shown, an embodiment of the present invention provides an electronic device 400, including a memory 410, a processor 420, and a computer program 411 stored in the memory 410 and executable on the processor 420. When the processor 420 executes the computer program 411, the following steps are implemented:
[0213] receiving a natural language query input by a user;
[0214] Performing NER analysis and intent recognition on the natural language query through a large model, extracting corresponding query features and obtaining the user's query intent, wherein the query intent indicates the type of resource data queried by the user;
[0215] According to the extracted query features, the Elasticsearch library is used as a scheduling tool, and the large model Agent calls the Elasticsearch library for retrieval to locate multiple target test questions related to the query features;
[0216] Using a joint search of BM25 search and embedding search, the multiple target test questions are sorted by relevance in combination with the user's query intent to obtain a sorted test question list;
[0217] The sorted test question list is returned to the user as a search result.
[0218] See also Figure 6 , Figure 6 A schematic diagram of an embodiment of a computer-readable storage medium provided in an embodiment of the present invention. Figure 6As shown, this embodiment provides a computer-readable storage medium 500, on which a computer program 411 is stored. When the computer program 411 is executed by a processor, the following steps are implemented:
[0219] receiving a natural language query input by a user;
[0220] Performing NER analysis and intent recognition on the natural language query through a large model, extracting corresponding query features and obtaining the user's query intent, wherein the query intent indicates the type of resource data queried by the user;
[0221] According to the extracted query features, the Elasticsearch library is used as a scheduling tool, and the large model Agent calls the Elasticsearch library for retrieval to locate multiple target test questions related to the query features;
[0222] Using a joint search of BM25 search and embedding search, the multiple target test questions are sorted by relevance in combination with the user's query intent to obtain a sorted test question list;
[0223] The sorted test question list is returned to the user as a search result.
[0224] It should be noted that in the above embodiments, the description of each embodiment has its own emphasis, and for parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0225] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CDROM, optical storage, etc.) containing computer-usable program code.
[0226] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded computer, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1A system that specifies the functions of a box or multiple boxes.
[0227] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction system, which is implemented in the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0228] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0229] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0230] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A test question retrieval method based on a large model, characterized in that: The method comprises: receiving a natural language query input by a user; Performing NER analysis and intent recognition on the natural language query through a large model, extracting corresponding query features and obtaining the user's query intent, wherein the query intent indicates the type of resource data queried by the user; According to the extracted query features, the Elasticsearch library is used as a scheduling tool, and the large model Agent calls the Elasticsearch library for retrieval to locate multiple target test questions related to the query features; Using a joint search of BM25 search and embedding search, the multiple target test questions are sorted by relevance in combination with the user's query intent to obtain a sorted test question list; The sorted test question list is returned to the user as a search result.
2. The test question retrieval method based on a large model according to claim 1 is characterized in that: The method further comprises: Determine whether the natural language query input by the user is correct by using the large model, and if the natural language query is incorrect, generate corresponding query information; Conduct multiple rounds of dialogue with the user according to the inquiry information; According to the context information accumulated in the multiple rounds of conversations, the user's actual search intention is identified, and retrieval is performed based on the actual search intention and the natural language query.
3. The test question retrieval method based on a large model according to claim 2 is characterized in that: The large model is used to determine whether the natural language query input by the user is correct. If the natural language query is incorrect, corresponding query information is generated, including: When it is identified that the natural language query has an ambiguous or unclear expression, determining that the natural language query is incorrect; generating a confirmation question corresponding to the first natural language query as first inquiry information; interacting with the user through the first inquiry information, and receiving feedback information from the user; A generation strategy for generating the first query information is dynamically adjusted based on the feedback information of the user, and second query information that meets the requirements is generated based on the generation strategy.
4. The test question retrieval method based on a large model according to claim 3 is characterized in that: The method of performing NER analysis and intent recognition on the natural language query by using a large model, extracting corresponding query features and obtaining the query intent of the user includes: Performing NER analysis on the natural language query through a large model to obtain at least one of grade information, subject information, question type information, and difficulty information; According to the grade information, subject information, question type information and difficulty information of the natural language query, corresponding grade features, subject features, question type features and difficulty features are respectively extracted to obtain initial query features; When the requirement information input by the user is parsed, the initial query feature is optimized to obtain the query feature by combining the knowledge graph and the test questions in the Elasticsearch library; if the requirement information is not parsed, the initial query feature is determined as the query feature; The natural language query is subjected to intent recognition through a large model to obtain the query intent of the user.
5. The test question retrieval method based on a large model according to claim 4 is characterized in that: The method further includes updating the test questions in the Elasticsearch library by offline parsing, wherein the offline parsing step includes: Receiving the test document uploaded by the user; Analyze the structure of the test document and extract the test content of the test document; Structuring the question stem, options, answers, and analysis in the test content to obtain analyzed test content; Performing semantic understanding and analysis on the parsed test content through the large model to extract feature labels of the test content; The test question content and the corresponding feature tags are stored in the Elasticsearch library.
6. The test question retrieval method based on a large model according to claim 1 is characterized in that: The combined search using BM25 search and embedding search is used to sort the multiple target test questions by relevance in combination with the user's query intent, and a sorted test question list is obtained, including: Performing an in-depth analysis on the test content of the target test question by using the large model, and converting the target test question into a first semantic vector; Calculating the similarity between the first semantic vector and the second semantic vector of the natural language query, and recalling the target test questions based on the similarity to obtain a plurality of recalled test questions; According to the BM25 algorithm, the multiple recalled test questions are sorted by relevance in combination with the user's query intention to obtain the sorted test question list.
7. The test question retrieval method based on a large model according to claim 6 is characterized in that: The method further comprises: Acquire and analyze the user's historical query information and the user's historical interaction behavior with the Elasticsearch library to obtain the user's first demand; Analyze the user's portrait information to obtain the user's second demand; The query intention of the user is determined by combining the large model with the first requirement, the second requirement and the language query input by the user.
8. The test question retrieval method based on a large model according to claim 1 is characterized in that: According to the extracted query features, the Elasticsearch library is used as a scheduling tool, and the large model Agent calls the Elasticsearch library for retrieval to locate multiple target test questions related to the query features, including: Extracting corresponding key information from the query features; According to the key information, the natural language query is converted into structured search conditions, the Elasticsearch library is used as a scheduling tool, and the Elasticsearch library is called by the large model Agent based on the search conditions to perform retrieval to obtain the target test questions.
9. The test question retrieval method based on a large model according to claim 1, characterized in that: The method further comprises: Use the large model to construct a knowledge point relationship map for each test question in the Elasticsearch library; According to the knowledge point relationship map of each of the test questions, identifying the hierarchical knowledge association information between the test questions; Based on the hierarchical knowledge association information between the test questions, obtaining associated test questions that have knowledge point associations with the target test question; Add the related test questions to the test question list.
10. A test question retrieval system based on a large model, characterized in that: The system comprises: A data receiving module, used for receiving a natural language query input by a user; A feature extraction module, used to perform NER analysis and intent recognition on the natural language query through a large model, extract corresponding query features and obtain the user's query intent, wherein the query intent indicates the type of resource data queried by the user; A test question retrieval module is used to locate multiple target test questions related to the query features by calling the Elasticsearch library through the large model Agent based on the extracted query features and using the Elasticsearch library as a scheduling tool; A test question ranking module is used to use a joint search of BM25 search and embedding search to sort the relevance of the plurality of target test questions in combination with the user's query intent, and obtain a sorted test question list; The result push module is used to return the sorted test question list as the search result to the user.
Citation Information
Cited By
Test question processing method and device based on artificial intelligence and intelligent agent
CN120973934A