Question recommendation method, program product and related device
By combining semantic similarity and structured matching degree into a comprehensive ranking method, the problem of insufficient accuracy and coverage of personalized question recommendation in existing technologies is solved, and the accurate matching of personalized question recommendation and intelligent improvement of learning system are achieved.
Patent Information
- Application Number
- CN202610510309.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-17
- Publication Date
- 2026-07-24
Smart Images

Figure CN122451133A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a recommended method, apparatus, computer device, computer-readable storage medium, and computer program product. Background Technology
[0002] In the field of knowledge training related to learning and exam questions, knowledge acquisition and learning assessment typically rely on question banks, standard clauses, and case data stored in structured databases, or natural language queries using the semantic retrieval functions provided by large language models. Structured databases perform well in information organization, field filtering, and precise matching, but lack semantic understanding capabilities when faced with natural language input or complex question expressions, resulting in limited retrieval coverage. Embedded vector retrieval provided by large models possesses strong semantic awareness and fuzzy matching capabilities, supporting more natural human-computer interaction methods; however, due to its inability to recognize the structural attributes of data, it has significant shortcomings in result control, accuracy positioning, and scenario adaptability.
[0003] Most current systems for personalized learning recommendations or test question generation tasks typically employ a single-path query, relying either solely on semantic similarity for content matching or only on structural field filtering, failing to balance semantic richness and structural accuracy. When faced with highly specialized domain requirements, complex learning scenarios, or multi-dimensional evaluation tasks, existing methods struggle to meet users' comprehensive demands for accuracy, personalization, and broad coverage. Summary of the Invention
[0004] Therefore, it is necessary to provide a method, apparatus, computer device, computer-readable storage medium, and computer program product that can accurately recommend questions based on the user's own characteristics and learning needs, in order to address the above-mentioned technical problems.
[0005] Firstly, this application provides a method for recommending topics, including:
[0006] Obtain the query text and personalized condition set used to represent the user's learning needs;
[0007] The query text is input into a pre-trained language model, which then performs embedding encoding on the query text to obtain a query vector.
[0008] Calculate the semantic similarity between the query vector and each embedded vector in the vector database; the embedded vector is a vector obtained by embedding and encoding each historical question through the language model, and each historical question corresponds to a structured field;
[0009] The first few embedding vectors corresponding to the semantic similarity are selected in descending order, and the historical questions corresponding to the selected embedding vectors are determined as candidate questions.
[0010] For each candidate question, calculate the matching degree between the personalized condition set and each structured field.
[0011] Based on the semantic similarity and matching degree, the candidate questions are sorted in descending order, and the top few candidate questions are identified as recommended questions and recommended.
[0012] In one embodiment, calculating the matching degree between the personalized condition set and each of the structured fields includes:
[0013] Get the preset matching function;
[0014] Input the personalized condition set and the structured field of each candidate question into the matching function respectively;
[0015] The matching function is used to match the personalized condition set with each of the structured fields to obtain the matching degree of the candidate questions corresponding to each structured field.
[0016] In one embodiment, the structured field includes at least one pre-configured core field and at least one non-core field. The matching function matches the personalized condition set with each of the structured fields to obtain the matching degree of the candidate questions corresponding to each structured field, including:
[0017] If the personalized condition set completely matches the core field, and the number of matches for the non-core field is greater than or equal to the first preset value, the matching degree of the corresponding candidate question will be mapped to the first value.
[0018] If the personalized condition set completely matches the core field, and the number of matches for the non-core field is less than the first preset value, the matching degree of the corresponding candidate question will be mapped to the second value.
[0019] If at least one of the personalized conditions does not match the core field, the matching degree of the corresponding candidate question will be mapped to a third value, where the first value is greater than the second value and the third value is greater than the third value.
[0020] In one embodiment, the process of sorting the candidate questions in descending order based on the semantic similarity and the matching degree includes:
[0021] Obtain a preset first weight coefficient corresponding to the semantic similarity and a preset second weight coefficient corresponding to the matching degree, wherein the sum of the first weight coefficient and the second weight coefficient is 1;
[0022] The first weight coefficient, the semantic similarity, the second weight coefficient, and the matching degree are weighted and summed to obtain the total score for the corresponding question.
[0023] The candidate questions are sorted in descending order based on the total score.
[0024] The method also includes:
[0025] Upon receiving a command to modify the weight coefficients, obtain the modified first weight coefficient and the modified second weight coefficient;
[0026] The first weight coefficient is updated based on the modified first weight coefficient, and the second weight coefficient is updated based on the modified second weight coefficient.
[0027] In one embodiment, recommending the recommended topic includes:
[0028] Obtain the recommendation reason for each recommended topic, which includes at least one of the following: the total score of the recommended topic, the structured fields of the recommended topic, and the pre-stored source of the recommended topic;
[0029] The recommended topic and its corresponding reasons will be displayed simultaneously.
[0030] In one embodiment, calculating the semantic similarity between the query vector and each embedded vector in the vector database includes:
[0031] The semantic similarity between the query vector and each of the embedded vectors is calculated using the following formula:
[0032]
[0033] in, This represents the query vector. Indicates the first The aforementioned embedding vectors, Represents the dot product of vectors. The Euclidean norm of a vector;
[0034] The semantic similarity of each embedding vector is sorted in descending order based on the calculation results.
[0035] Secondly, this application also provides a topic recommendation device, comprising:
[0036] The query module is used to obtain query text and personalized condition sets that represent the user's learning needs;
[0037] The encoding module is used to input the query text into a pre-trained language model, and then use the language model to embed and encode the query text to obtain a query vector.
[0038] The sorting module is used to calculate the semantic similarity between the query vector and each embedded vector in the vector database; the embedded vector is a vector obtained by embedding and encoding each historical question through the language model, and the historical question corresponds to a structured field.
[0039] The question selection module is used to select the first few embedding vectors corresponding to the semantic similarity in descending order, and determine the historical questions corresponding to the selected embedding vectors as candidate questions.
[0040] The calculation module is used to calculate the matching degree between the personalized condition set and each structured field corresponding to each candidate question.
[0041] The recommendation module is used to sort the candidate questions in descending order based on the semantic similarity and the matching degree, and to identify the top few candidate questions as recommended questions and make recommendations.
[0042] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0043] Obtain the query text and personalized condition set used to represent the user's learning needs;
[0044] The query text is input into a pre-trained language model, which then performs embedding encoding on the query text to obtain a query vector.
[0045] Calculate the semantic similarity between the query vector and each embedded vector in the vector database; the embedded vector is a vector obtained by embedding and encoding each historical question through the language model, and each historical question corresponds to a structured field;
[0046] The first few embedding vectors corresponding to the semantic similarity are selected in descending order, and the historical questions corresponding to the selected embedding vectors are determined as candidate questions.
[0047] For each candidate question, calculate the matching degree between the personalized condition set and each structured field.
[0048] Based on the semantic similarity and matching degree, the candidate questions are sorted in descending order, and the top few candidate questions are identified as recommended questions and recommended.
[0049] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:
[0050] Obtain the query text and personalized condition set used to represent the user's learning needs;
[0051] The query text is input into a pre-trained language model, which then performs embedding encoding on the query text to obtain a query vector.
[0052] Calculate the semantic similarity between the query vector and each embedded vector in the vector database; the embedded vector is a vector obtained by embedding and encoding each historical question through the language model, and each historical question corresponds to a structured field;
[0053] The first few embedding vectors corresponding to the semantic similarity are selected in descending order, and the historical questions corresponding to the selected embedding vectors are determined as candidate questions.
[0054] For each candidate question, calculate the matching degree between the personalized condition set and each structured field.
[0055] Based on the semantic similarity and matching degree, the candidate questions are sorted in descending order, and the top few candidate questions are identified as recommended questions and recommended.
[0056] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:
[0057] Obtain the query text and personalized condition set used to represent the user's learning needs;
[0058] The query text is input into a pre-trained language model, which then performs embedding encoding on the query text to obtain a query vector.
[0059] Calculate the semantic similarity between the query vector and each embedded vector in the vector database; the embedded vector is a vector obtained by embedding and encoding each historical question through the language model, and each historical question corresponds to a structured field;
[0060] The first few embedding vectors corresponding to the semantic similarity are selected in descending order, and the historical questions corresponding to the selected embedding vectors are determined as candidate questions.
[0061] For each candidate question, calculate the matching degree between the personalized condition set and each structured field.
[0062] Based on the semantic similarity and matching degree, the candidate questions are sorted in descending order, and the top few candidate questions are identified as recommended questions and recommended.
[0063] The aforementioned method, apparatus, computer device, computer-readable storage medium, and computer program product for recommending questions obtain query text representing the user's learning needs and a set of personalized conditions. They then use a language model to embed and encode the query text to obtain a query vector. Next, they calculate the semantic similarity between the query vector and the embedding vectors of each historical question, initially filtering out candidate questions with high semantic similarity. This ensures that the final recommended questions best match the user's learning needs. Then, they use the user's personalized condition set to match the structured fields of the candidate questions, identifying highly matched candidate questions as recommended questions. Finally, they further filter these candidate questions using personalized conditions, ensuring that the final recommended questions also best match the user's personality traits. This achieves the effect of accurately matching the recommended questions with the user's characteristics and learning needs. Attached Figure Description
[0064] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0065] Figure 1 This is a flowchart illustrating the method for recommending questions in one embodiment;
[0066] Figure 2 To achieve the above Figure 1 A flowchart illustrating step 105 in the embodiment;
[0067] Figure 3 This is a structural block diagram of the device for recommending the title in one embodiment;
[0068] Figure 4 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0069] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0070] It should be noted that the terms "first," "second," etc., used in this application may be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more.
[0071] In one embodiment, such as Figure 1 As shown, a method for recommending questions is provided. This embodiment illustrates the method by applying it to a terminal. It is understood that this method can also be applied to a server, and to a system including both a terminal and a server, and implemented through interaction between the terminal and the server. In this embodiment, the method includes steps 101 to 106. Wherein:
[0072] Step 101: Obtain the query text and personalized condition set used to represent the user's learning needs.
[0073] Optionally, user input representing user learning needs may include, but is not limited to, the following forms:
[0074] Questions described in natural language, such as "Please recommend practice questions about transformer protection";
[0075] The system identifies knowledge gaps, such as "common mistakes in intermediate frequency grounding fault questions";
[0076] Analysis results of historical incorrect answers, such as "the knowledge points with the highest error rate in the three most recent mock exams";
[0077] Teaching task-driven objectives, such as "advanced exercises corresponding to the content of Chapter 4".
[0078] In this embodiment, after receiving the above-mentioned learning requirements, the system integrates the above-mentioned multi-source learning requirements information into a standardized query text. The integration method is, for example, to extract keywords from the whole text. For example, the keywords "transformer" and "protection" are extracted from "Please recommend practice questions about transformer protection". Then, the extracted keywords are combined to obtain the above-mentioned standardized query text.
[0079] The method for obtaining a user's personalized condition set can be extracted from the user's personalized learning needs. The sources of this personalized learning status include, but are not limited to, the following three types of information:
[0080] (1) User-defined filtering criteria, including one or more of the following: difficulty level, question type, standard version, device type, knowledge point tags, and release time;
[0081] (2) The system automatically generates recommendation criteria based on user profile, historical answer records, distribution of wrong answers, course completion progress, and learning stage tags;
[0082] (3) Scope conditions set based on teaching tasks or training objectives, including teaching chapters, assessment scope, and exercise types.
[0083] Similarly, this set of personalized conditions can also be obtained by extracting at least one keyword from the above personalized learning status and then combining the keywords. For example, extract at least one of the keywords "difficulty level, question type, standard version, device type, knowledge point tag, assessment scope, practice type, ...".
[0084] Step 102: Input the query text into the pre-trained language model, and use the language model to embed and encode the query text to obtain the query vector.
[0085] Alternatively, the language model can be Google's BERT (Bidirectional Encoder Representations from Transformers) language model, OpenAI's text-embedding-ada-002 text embedding model, Baidu's ERNIE (Enhanced Representation through kNowledge Integration) language model, or a locally deployed lightweight model. Known language models of this type can be used to embed and encode the query text to obtain the semantic vector of the sentence, which corresponds to the query vector in this case.
[0086] In this embodiment, the aforementioned multi-source demand information can be integrated into a personalized condition set. Through the embedding function in the language model Encode the query vector to obtain the query vector. :
[0087]
[0088] in, This represents a mapping, which serves to map discrete, high-dimensional raw data (such as different texts) to a low-dimensional, continuous vector space, thereby capturing their semantic or structural features and facilitating subsequent mathematical calculations and similarity analysis in the model. This vector... It represents the embedding features of the user's current learning target in the semantic space and is a key input in the entire semantic query stage. This represents the embedded vector space.
[0089] Step 103: Calculate the semantic similarity between the query vector and each embedded vector in the vector database; the embedded vector is a vector obtained by embedding and encoding each historical question through the language model, and the historical question corresponds to a structured field.
[0090] To lay the foundation for subsequent semantic and structural fusion retrieval, the question bank data in this embodiment includes textbook questions, past exam questions, and simulation case questions. Each question is modeled as a structured text record in the system, which mainly contains the following two categories of fields:
[0091] Text fields: These include the question stem, options, standard answer, and explanations, used to express the semantics of the question;
[0092] Structured fields, such as difficulty level, standard version, device type, question type, and release time, are used for fine-grained filtering and selection.
[0093] To achieve semantic understanding capabilities of natural language, for the aforementioned text fields of each history question, a pre-trained language model is used to embed and encode the text fields, resulting in the embedding vector. During embedding and encoding, the embedding function... ,in: Represents the natural language text space; Representing the embedding vector space, typical dimensions .
[0094] According to one implementation scenario of this embodiment, for example: for the first The input text for this history question is:
[0095]
[0096] in, This indicates tensor splicing. Operations are used to concatenate two or more tensors along a certain dimension to generate a larger tensor.
[0097] The embedding vector of this historical question can be represented as:
[0098]
[0099] in, This represents a mapping, which serves to map discrete, high-dimensional raw data (such as different texts) to a low-dimensional, continuous vector space, thereby capturing their semantic or structural features and facilitating subsequent mathematical calculations and similarity analysis in the model. Optionally, this vector... They are stored in high-performance vector databases, such as the FAISS (Facebook AI Similarity Search) vector database or the Milvus vector database, to support subsequent efficient Approximate Nearest Neighbor (ANN) queries.
[0100] Optionally, in this embodiment, each embedded vector record is bound to structured field information corresponding to a historical question, and a bidirectional mapping table between the embedded vector and the structured field is established in the database.
[0101] This mapping mechanism ensures that each semantic vector can be traced back to its structured attributes, providing a data foundation for subsequent multidimensional queries, fusion scoring, and fine-grained filtering. Furthermore, the system supports periodic batch recoding of the question bank text content to adapt to updates to the embedding model or changes in the question bank content, ensuring the consistency and timeliness of the semantic vector representation.
[0102] In an exemplary embodiment, for evaluating embedding vectors With query vector The semantic similarity between the query vector and each embedded vector in the vector database is calculated, including:
[0103] The semantic similarity between the query vector and each of the embedded vectors is calculated using the following formula:
[0104]
[0105] in, This represents the query vector. Indicates the first The aforementioned embedding vectors, Represents the dot product of vectors. The Euclidean norm of a vector;
[0106] The semantic similarity of each embedding vector is sorted in descending order based on the calculation results.
[0107] It is understandable that calculating the semantic similarity between the query vector and each embedded vector in the vector database is not limited to using the cosine similarity mentioned above as a metric; the Jaccard similarity coefficient can also be used as a metric.
[0108] Step 104: Select the first few embedding vectors corresponding to the semantic similarity in descending order, and determine the historical questions corresponding to the selected embedding vectors as candidate questions.
[0109] Specifically, it can be based on the calculation results. The corresponding historical questions are sorted in descending order, and the top N most relevant questions are extracted as candidate questions based on the sorting results, forming a preliminary set of candidate questions for semantic matching. This set represents the "coarse selection result set" that is semantically related to the user's learning intention. It completes the focus and convergence from a large-scale question bank to the fine screening step in the semantic dimension, preparing for the next step of screening based on structured conditions.
[0110] Based on the vectorization of the question bank described above, the system constructs query vectors according to the user's current learning needs, achieving preliminary semantic matching with the semantic vector library. The purpose of this step is to quickly filter out a set of candidate questions highly relevant to the user's intent from a massive number of questions, laying the foundation for subsequent structured screening and fusion ranking.
[0111] Step 105: For each candidate question, calculate the matching degree between the personalized condition set and each structured field.
[0112] Since semantic matching has a certain generalization characteristic, it may select questions that are weakly related to the user's learning goals into the candidate questions. Therefore, based on the candidate questions obtained from the initial semantic screening result set, this embodiment further introduces a structured condition filtering mechanism to improve the accuracy and personalization of the search results.
[0113] In one exemplary embodiment, such as Figure 2 As shown, step 105 above includes steps 201 to 203. Wherein:
[0114] Step 201: Obtain the preset matching function.
[0115] Step 202: Input the personalized condition set and the structured field of each candidate question into the matching function.
[0116] Step 203: Use the matching function to match the personalized condition set with each structured field to obtain the matching degree of the candidate questions corresponding to each structured field.
[0117] The matching function for calculating the matching degree between the personalized condition set and each structured field can be based on the matching results of functions such as WUP (Wu & Palmer) similarity, CNKI semantic similarity, and pinyin similarity. However, in this embodiment, in order to achieve the effect of accurate matching between the user's own characteristics and learning needs, this embodiment uses the following method to achieve accurate matching between the personalized condition set and each structured field.
[0118] Preferably, the structured fields include at least one pre-configured core field and at least one non-core field. The structured fields may include knowledge point tags, question type categories, standard versions, device types, difficulty levels, and release dates. Furthermore, fields with stronger constraints on the results, such as "question type category, difficulty level, and knowledge point tags," can be set as core conditions, while other fields like "standard version, device type, and release date" can be set as non-core conditions. The distinction between core and non-core conditions can be pre-configured by the system or dynamically adjusted according to the current search task.
[0119] The matching function is used to match the personalized condition set with each structured field to obtain the matching degree of the candidate questions corresponding to each structured field, including:
[0120] If the personalized condition set completely matches the core field, and the number of matches for the non-core field is greater than or equal to the first preset value, the matching degree of the corresponding candidate question will be mapped to the first value.
[0121] If the personalized condition set completely matches the core field, and the number of matches for the non-core field is less than the first preset value, the matching degree of the corresponding candidate question will be mapped to the second value.
[0122] If at least one of the personalized conditions does not match the core field, the matching degree of the corresponding candidate question will be mapped to a third value, where the first value is greater than the second value and the third value is greater than the third value.
[0123] In one implementation scenario of this embodiment, for example: the matching score of the structured fields is calculated. The first, second, and third values are set to 1, 0.5, and 0 respectively, and the determination rules are as follows:
[0124] (1) When the first A record is considered complete when it meets all core conditions and all non-core conditions, or when it meets at least a preset threshold number of non-core conditions. ;
[0125] (2) When the first If a record satisfies all core conditions, but the number of non-core conditions satisfied is less than the preset threshold, then the record is deleted. ;
[0126] (3) When the first If a record does not meet at least one of the core conditions, the record... .
[0127] In this implementation, the core conditions include knowledge point tags, question type categories, and standard versions, while the non-core conditions include device type, difficulty level, and release time. If a candidate question simultaneously meets the knowledge point tags, question type categories, and standard versions, and also meets at least a preset threshold number of conditions in device type, difficulty level, and release time, then the structured matching score is determined to be 1. If a candidate question meets all the core conditions, but only meets some of the non-core conditions and is below the preset threshold, then the structured matching score is determined to be 0.5. If a candidate question does not meet at least one core condition, then the structured matching score is determined to be 0.
[0128] The system is based on the structured matching score Candidate item set obtained from the initial semantic screening results Filter the candidate questions in the list, for example, you can keep The candidate topics are used to form a structured screening set obtained by structured screening. , can be represented as:
[0129]
[0130] in, Indicates the first One candidate topic, This represents the set of candidate topics. This represents the calculated matching degree.
[0131] Through the aforementioned structured conditional filtering mechanism, the system, while maintaining semantic relevance, further imposes structural attribute constraints on candidate test questions, such as difficulty, question type, standard version, and device type, thereby eliminating candidate content that does not meet the requirements of the user's learning status or teaching task, and improving the accuracy, controllability, and personalization of the recommendation results.
[0132] Step 106: Sort the candidate questions in descending order based on the semantic similarity and the matching degree, and determine the top few candidate questions as recommended questions and make recommendations.
[0133] Specifically, in this embodiment, the total score is calculated based on the semantic similarity and the matching degree for all candidate questions in the candidate question set. Sort in descending order and select the top... The records serve as the final set of personalized recommended questions in the output, where... The value can be set according to user configuration or default strategy, or it can be dynamically adjusted during multiple rounds of interactive training to meet the result scale requirements of different recommendation scenarios.
[0134] Recommendation results can be presented in various ways, including but not limited to the following three:
[0135] (1) Web front-end display mode: used to graphically display recommended topics and their reasons for recommendation, supporting sorting and filtering;
[0136] (2) Adaptive training generation module: Automatically integrates recommended questions into personalized practice sets, suitable for scenarios such as mock exams and self-assessment;
[0137] (3) Push-based learning interface: The recommended results are proactively pushed to users through message reminders, learning plans and other means to improve learning stickiness and completion rate.
[0138] This embodiment completes the final output of the fusion query process, ensuring the relevance and accuracy of the recommended content, while also possessing high interpretability and system interaction capabilities, thus providing effective support for the intelligent construction of the relay protection learning system.
[0139] This invention proposes a relational data and embedded vector fusion query method for the relay protection learning field. By deeply fusing structured fields and semantic vector information, it solves the problems of inaccurate personalized matching, insufficient semantic understanding, and lack of structured filtering in existing learning systems. In the implementation of this invention, the system first performs structured modeling of the relay protection question bank and generates embedded vectors based on a large language model to achieve deep representation and vectorized indexing of the semantic information of the questions. By constructing a semantic vector library and establishing a mapping relationship with structured fields, the system has the dual capabilities of semantic approximate retrieval and fine-grained structural control.
[0140] The question recommendation method proposed in this embodiment can be applied to the field of power technology training, such as relay protection. This method belongs to a query and generation fusion mechanism. Based on the user's proposed training target query, it generates personalized test question response results, improving the intelligence level of the relay protection learning system. The question recommendation method proposed in this embodiment is oriented towards the fusion query of relational data and embedded vectors in the relay protection learning field. It aims to improve the quality of test question recommendation in the relay protection professional field through dual-mode fusion technology, enabling it to have both semantic understanding capabilities and achieve structured and accurate matching based on the individual status of trainees.
[0141] In an exemplary embodiment, the process of sorting the candidate questions in descending order based on the semantic similarity and the matching degree includes:
[0142] Obtain a preset first weight coefficient corresponding to the semantic similarity and a preset second weight coefficient corresponding to the matching degree, wherein the sum of the first weight coefficient and the second weight coefficient is 1;
[0143] The first weight coefficient, the semantic similarity, the second weight coefficient, and the matching degree are weighted and summed to obtain the total score for the corresponding question.
[0144] The candidate questions are sorted in descending order based on the total score.
[0145] According to one implementation scenario of this embodiment, in order to achieve an effective balance between semantic relevance and structural matching, the system, after completing the initial semantic screening and the refined structured screening, further introduces a fusion scoring mechanism to comprehensively evaluate and rank the candidate test question records in order to output the optimal set of personalized results.
[0146] Structured fine screening set Each candidate topic Two scoring indicators were assigned respectively:
[0147] (1) Semantic similarity score The cosine similarity result, calculated based on the embedding vector, represents the degree of fit between the query vector and the semantic content of the record. Its value typically ranges from [value range missing]. ;
[0148] (2) Matching score of structured fields The result returned by the matching function of the structured fields reflects the degree to which the corresponding question meets the user's filtering conditions at the structured field level, and the value is... .
[0149] The system calculates the total score for each candidate question by weighting and combining the scores from the two categories mentioned above. The calculation formula is as follows:
[0150]
[0151] in, , The weighting coefficients satisfy the constraints. .
[0152] This embodiment incorporates a scoring mechanism, which ensures semantic relevance while maintaining precise control over structural attributes, adapting to personalized ranking needs across different user types, learning tasks, and teaching stages. Furthermore, the recommendation method for this question systematically provides a robust interpretability foundation, supporting the tracing of the source of ranking results and feedback adjustments, further enhancing the intelligence level and user satisfaction of the recommendation system.
[0153] As a preferred option, the recommended method for this question also includes:
[0154] Upon receiving a command to modify the weight coefficients, obtain the modified first weight coefficient and the modified second weight coefficient;
[0155] The first weight coefficient is updated based on the modified first weight coefficient, and the second weight coefficient is updated based on the modified second weight coefficient.
[0156] The weight coefficients in the question recommendation method proposed in this embodiment can be adjusted according to user needs, allowing users to set the weights based on their experience in actual application scenarios. For example, in tasks that emphasize precise assessment matching, the weight of structural score can be increased, and in scenarios that emphasize the breadth of content and the divergence of connections, the weight of semantic similarity can be increased. The weight coefficients can also be dynamically adjusted through online learning, adaptive optimization, and other methods.
[0157] In one exemplary embodiment, recommending the recommended topics includes:
[0158] Obtain the recommendation reason for each recommended topic, which includes at least one of the following: the total score of the recommended topic, the structured fields of the recommended topic, and the pre-stored source of the recommended topic;
[0159] The recommended topic and its corresponding reasons will be displayed simultaneously.
[0160] To enhance the transparency and explainability of the recommended content, the system outputs each recommended question along with corresponding reasoning information, including but not limited to:
[0161] (1) Semantic similarity score: i.e. This is used to reflect the degree to which the question content matches the semantics of the query;
[0162] (2) Structured matching tags: Display the structured filtering conditions that the question meets;
[0163] (3) Recommendation source identifier: Mark whether the questions are from user error expansion, knowledge point reinforcement, teaching task push, etc.;
[0164] (4) Supporting information links: such as the source of the original question, textbook chapter jump, related questions and other hyperlink information, to improve the coherence and traceability of the learning path.
[0165] The query processing method proposed in this embodiment, based on the user's input of natural language requirements or learning status information, generates a query vector and performs similarity retrieval in a vector database, enabling rapid location of semantically relevant content. Building upon this, the system further introduces a structured condition filtering mechanism. Based on user profiles, incorrect question records, learning objectives, and other multi-source data, it automatically generates structured constraints to finely screen the candidate set, ensuring that the search results are semantically relevant while also meeting structural attribute requirements.
[0166] The question recommendation method proposed in this embodiment uses a fusion scoring approach based on semantic similarity and structural matching scores to construct a comprehensive ranking model. An adjustable weighting coefficient dynamically controls the contribution ratio of the two types of scores, thereby achieving flexible adaptation to different learning task scenarios (such as precision practice or extended learning). In the final output stage, the system sorts the results according to the fusion score, outputting a personalized set of recommended questions, along with recommendation reasons, structural tags, and knowledge point annotations, providing users with clear and interpretable learning path support.
[0167] Through the aforementioned technical means, this invention effectively solves the problem of structural missingness and semantic drift coexisting in traditional personalized recommendation methods, significantly improving the query accuracy and intelligent response capability of the relay protection learning system in complex scenarios. The question recommendation method not only enhances the personalization and professional adaptability of question recommendations but also provides a general technical solution for structural-semantic fusion retrieval in intelligent education systems, possessing good engineering feasibility and promotional value.
[0168] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.
[0169] Based on the same inventive concept, this application also provides a problem recommendation apparatus for implementing the problem recommendation method described above. The problem-solving solution provided by this apparatus is similar to the implementation solution described in the above method; therefore, the specific limitations in one or more problem recommendation apparatus embodiments provided below can be found in the limitations of the problem recommendation method described above, and will not be repeated here.
[0170] In one exemplary embodiment, such as Figure 3 As shown, a question recommendation device 100 is provided, including: a query module 11, an encoding module 12, a sorting module 13, a question selection module 14, a calculation module 15, and a recommendation module 16, wherein:
[0171] The query module 11 is used to obtain the query text and personalized condition set that represent the user's learning needs;
[0172] Encoding module 12 is used to input the query text into a pre-trained language model, and to embed and encode the query text through the language model to obtain a query vector;
[0173] The sorting module 13 is used to calculate the semantic similarity between the query vector and each embedded vector in the vector database; the embedded vector is a vector obtained by embedding and encoding each historical question through the language model, and the historical question corresponds to a structured field.
[0174] The question selection module 14 is used to select the first few embedding vectors corresponding to the semantic similarity in descending order, and determine the historical questions corresponding to the selected embedding vectors as candidate questions.
[0175] The calculation module 15 is used to calculate the matching degree between the personalized condition set and each structured field corresponding to each candidate question.
[0176] The recommendation module 16 is used to sort the candidate questions in descending order based on the semantic similarity and the matching degree, and to determine the top few candidate questions as recommended questions and make recommendations.
[0177] In one embodiment, the calculation module 15 specifically includes a matching function acquisition unit, an input unit, and a matching unit, wherein:
[0178] The matching function acquisition unit is used to acquire a preset matching function;
[0179] The input unit is used to input the personalized condition set and the structured field of each candidate question into the matching function respectively;
[0180] The matching unit is used to match the personalized condition set with each of the structured fields using the matching function, and obtain the matching degree of the candidate questions corresponding to each structured field.
[0181] Furthermore, the structured field includes at least one pre-configured core field and at least one non-core field, and the matching unit is specifically used for:
[0182] If the personalized condition set completely matches the core field, and the number of matches for the non-core field is greater than or equal to the first preset value, the matching degree of the corresponding candidate question will be mapped to the first value.
[0183] If the personalized condition set completely matches the core field, and the number of matches for the non-core field is less than the first preset value, the matching degree of the corresponding candidate question will be mapped to the second value.
[0184] If at least one of the personalized conditions does not match the core field, the matching degree of the corresponding candidate question will be mapped to a third value, where the first value is greater than the second value and the third value is greater than the third value.
[0185] In one embodiment, the recommendation module 16 specifically includes a coefficient acquisition unit, a first calculation unit, and a first sorting unit, wherein:
[0186] The coefficient acquisition unit is used to acquire a preset first weight coefficient corresponding to the semantic similarity and a preset second weight coefficient corresponding to the matching degree, wherein the sum of the first weight coefficient and the second weight coefficient is 1;
[0187] The first calculation unit is used to perform a weighted summation of the first weight coefficient, the semantic similarity, the second weight coefficient, and the matching degree to obtain the total score of the corresponding question.
[0188] The first sorting unit is used to sort the corresponding candidate questions in descending order based on the total score.
[0189] The recommendation device 100 for this problem also includes an instruction receiving module and a coefficient update module, wherein:
[0190] The instruction receiving module is used to obtain the modified first weight coefficient and the modified second weight coefficient when a modification instruction for the weight coefficient is received.
[0191] The coefficient update module is used to update the first weight coefficient based on the modified first weight coefficient, and to update the second weight coefficient based on the modified second weight coefficient.
[0192] In one embodiment, the recommendation module 16 further includes a reason acquisition unit and a realization unit, wherein:
[0193] The reason acquisition unit is used to acquire the reason for recommending each recommended topic. The reason for recommending includes at least one of the following: the total score of the recommended topic, the structured fields of the recommended topic, and the source of the recommended topic stored in advance.
[0194] The display unit is used to simultaneously display the recommended topic and the corresponding reasons for recommendation.
[0195] Preferably, the sorting module 13 specifically includes a second calculation unit and a second sorting unit, wherein:
[0196] The second calculation unit is used to calculate the semantic similarity between the query vector and each of the embedded vectors using the following formula:
[0197]
[0198] in, This represents the query vector. Indicates the first The aforementioned embedding vectors, Represents the dot product of vectors. The Euclidean norm of a vector;
[0199] The second sorting unit is used to sort the semantic similarity of each embedded vector in descending order based on the calculation results.
[0200] The topic recommendation device proposed in this embodiment obtains the query text representing the user's learning needs and a personalized condition set. It then uses a language model to embed and encode the query text to obtain a query vector. Next, it calculates the semantic similarity between the query vector and the embedding vectors of each historical topic, initially screening out candidate topics with high semantic similarity. This ensures that the final recommended topics best match the user's learning needs. Then, it uses the user's personalized condition set to match the structured fields of the candidate topics, identifying the candidate topics with high matching degrees as recommended topics. Finally, it further filters the candidate topics using personalized conditions, ensuring that the final recommended topics also best match the user's personality characteristics. This achieves the effect of accurately matching the recommended topics with the user's own characteristics and learning needs.
[0201] The modules in the recommended device for the above questions can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in the computer device in hardware form, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0202] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 4As shown, the computer device includes a processor, memory, input / output interface, communication interface, display unit, and input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interface. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The input / output interface is used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When the computer program is executed by the processor, it implements a recommended method for a given problem. The display unit is used to form a visually visible image and can be a display screen, projection device, or virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.
[0203] Those skilled in the art will understand that Figure 4 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0204] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0205] Obtain the query text and personalized condition set used to represent the user's learning needs;
[0206] The query text is input into a pre-trained language model, which then performs embedding encoding on the query text to obtain a query vector.
[0207] Calculate the semantic similarity between the query vector and each embedded vector in the vector database; the embedded vector is a vector obtained by embedding and encoding each historical question through the language model, and each historical question corresponds to a structured field;
[0208] The first few embedding vectors corresponding to the semantic similarity are selected in descending order, and the historical questions corresponding to the selected embedding vectors are determined as candidate questions.
[0209] For each candidate question, calculate the matching degree between the personalized condition set and each structured field.
[0210] Based on the semantic similarity and matching degree, the candidate questions are sorted in descending order, and the top few candidate questions are identified as recommended questions and recommended.
[0211] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0212] Obtain the query text and personalized condition set used to represent the user's learning needs;
[0213] The query text is input into a pre-trained language model, which then performs embedding encoding on the query text to obtain a query vector.
[0214] Calculate the semantic similarity between the query vector and each embedded vector in the vector database; the embedded vector is a vector obtained by embedding and encoding each historical question through the language model, and each historical question corresponds to a structured field;
[0215] The first few embedding vectors corresponding to the semantic similarity are selected in descending order, and the historical questions corresponding to the selected embedding vectors are determined as candidate questions.
[0216] For each candidate question, calculate the matching degree between the personalized condition set and each structured field.
[0217] Based on the semantic similarity and matching degree, the candidate questions are sorted in descending order, and the top few candidate questions are identified as recommended questions and recommended.
[0218] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:
[0219] Obtain the query text and personalized condition set used to represent the user's learning needs;
[0220] The query text is input into a pre-trained language model, which then performs embedding encoding on the query text to obtain a query vector.
[0221] Calculate the semantic similarity between the query vector and each embedded vector in the vector database; the embedded vector is a vector obtained by embedding and encoding each historical question through the language model, and each historical question corresponds to a structured field;
[0222] The first few embedding vectors corresponding to the semantic similarity are selected in descending order, and the historical questions corresponding to the selected embedding vectors are determined as candidate questions.
[0223] For each candidate question, calculate the matching degree between the personalized condition set and each structured field.
[0224] Based on the semantic similarity and matching degree, the candidate questions are sorted in descending order, and the top few candidate questions are identified as recommended questions and recommended.
[0225] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0226] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0227] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0228] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for recommending questions, characterized in that, The method includes: Obtain the query text and personalized condition set used to represent the user's learning needs; The query text is input into a pre-trained language model, and the query text is embedded and encoded by the language model to obtain a query vector; Calculate the semantic similarity between the query vector and each embedded vector in the vector database; the embedded vector is a vector obtained by embedding and encoding each historical question through the language model, and the historical question corresponds to a structured field; The first few embedding vectors corresponding to the semantic similarity are selected in descending order, and the historical questions corresponding to the selected embedding vectors are determined as candidate questions. For each of the candidate questions, the matching degree between the personalized condition set and each of the structured fields is calculated. The candidate questions are sorted in descending order based on the semantic similarity and the matching degree, and the top few candidate questions are identified as recommended questions and recommended.
2. The method according to claim 1, characterized in that, The calculation of the matching degree between the personalized condition set and each of the structured fields includes: Get the preset matching function; The personalized condition set and the structured fields of each candidate question are respectively input into the matching function; The matching function is used to match the personalized condition set with each of the structured fields to obtain the matching degree of the candidate questions corresponding to each structured field.
3. The method according to claim 2, characterized in that, The structured fields include at least one pre-configured core field and at least one non-core field. The matching function is used to match the personalized condition set with each of the structured fields to obtain the matching degree of the candidate questions corresponding to each structured field, including: If the personalized condition set completely matches the core field, and the number of matches of the non-core field is greater than or equal to the first preset value, the matching degree of the corresponding candidate question is mapped to the first value. If the personalized condition set completely matches the core field and the number of matches for the non-core field is less than the first preset value, the matching degree of the corresponding candidate question is mapped to the second value. If at least one of the personalized conditions does not match the core field, the matching degree of the corresponding candidate question is mapped to a third value, wherein the first value is greater than the second value and the third value.
4. The method according to claim 1, characterized in that, The step of sorting the candidate questions in descending order based on the semantic similarity and the matching degree includes: Obtain a preset first weight coefficient corresponding to the semantic similarity and a preset second weight coefficient corresponding to the matching degree, wherein the sum of the first weight coefficient and the second weight coefficient is 1; The first weight coefficient, the semantic similarity, the second weight coefficient, and the matching degree are weighted and summed to obtain the total score for the corresponding question. The candidate questions are sorted in descending order based on the total score. The method further includes: Upon receiving a command to modify the weight coefficients, obtain the modified first weight coefficient and the modified second weight coefficient; The first weight coefficient is updated based on the modified first weight coefficient, and the second weight coefficient is updated based on the modified second weight coefficient.
5. The method according to claim 4, characterized in that, The recommended topics are recommended, including: Obtain the recommendation reason for each of the recommended topics, wherein the recommendation reason includes at least one of the following: the total score of the recommended topic, the structured fields of the recommended topic, and the pre-stored source of the recommended topic; The recommended topics and their corresponding reasons for recommendation will be displayed simultaneously.
6. The method according to any one of claims 1 to 5, characterized in that, The calculation of the semantic similarity between the query vector and each embedded vector in the vector database includes: The semantic similarity between the query vector and each of the embedded vectors is calculated using the following formula: in, This represents the query vector. Indicates the first The aforementioned embedding vectors, Represents the dot product of vectors. The Euclidean norm of a vector; The semantic similarity of each embedding vector is sorted in descending order based on the calculation results.
7. A device for recommending questions, characterized in that, The device includes: The query module is used to obtain query text and personalized condition sets that represent the user's learning needs; The encoding module is used to input the query text into a pre-trained language model, and to embed and encode the query text through the language model to obtain a query vector; The sorting module is used to calculate the semantic similarity between the query vector and each embedded vector in the vector database; the embedded vector is a vector obtained by embedding and encoding each historical question through the language model, and the historical question corresponds to a structured field; The question selection module is used to select the first few embedding vectors corresponding to the semantic similarity in descending order, and determine the historical questions corresponding to the selected embedding vectors as candidate questions. The calculation module is used to calculate the matching degree between the personalized condition set and each of the structured fields corresponding to each candidate question; The recommendation module is used to sort the candidate questions in descending order based on the semantic similarity and the matching degree, and to determine the top few candidate questions as recommended questions and make recommendations.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.