User question recommendation method and device, electronic equipment and readable storage medium

By preprocessing the knowledge base data and searching through multiple means, and combining generative big models to generate interest problems, the existing question-and-answer system is solved, and more accurate and personalized problem recommendations are achieved.

CN119719349APending Publication Date: 2025-03-28KANG JIAN INFORMATION TECH (SHENZHEN) CO LTD
View PDF 0 Cites 6 Cited by

Patent Information

Application Number
CN202411766289.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-03
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

When the existing question-and-answer system enters questions, the answers cannot meet the user's needs due to unclear expressions, insufficient information or lack of domain knowledge when users enter questions. It is difficult to deeply understand the user's true intentions in the face of a huge knowledge base, especially when facing a huge knowledge base, its response ability is limited.

Method used

By segmenting the knowledge base data, building a prefix tree and vectorized processing, searching through multiple means by combining the prefix tree, semantic similarity and keywords, matching problems are determined by using a multi-factor sorting method, and interest problems are generated using a generative big model, and finally recommending related problems based on semantic similarity.

Benefits of technology

It improves the accuracy and diversity of problem recommendations, can deeply understand user intentions, identify potential needs, provide more accurate and relevant recommendation results, significantly reduce users' frustration during the input process, and improve information acquisition efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119719349A_ABST
    Figure CN119719349A_ABST
Patent Text Reader

Abstract

The invention relates to the field of artificial intelligence natural language processing technology, financial technology and medical technology, and discloses a user question recommendation method and device, electronic equipment and a readable storage medium, and the method comprises the following steps: preprocessing data in a knowledge base; searching the user question in a knowledge base based on the prefix tree, the semantic similarity and the keyword to obtain a combined search result; based on a multi-factor sorting method, determining a plurality of similar questions from the joint search result as matching questions; and generating a plurality of interest questions by adopting a large generative model and taking answers of the user questions and the matched questions as input, and selecting a plurality of interest questions from the interest questions based on semantic similarity to serve as recommendation results. According to the method, diversified search and generation technologies are organically combined, a brand-new question recommendation method is provided, the question recommendation accuracy is improved, and the experience feeling and satisfaction degree of a user are improved; the application scene is wide, and the practicability is high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the fields of artificial intelligence natural language processing technology, financial technology, and medical technology, and specifically to a method, device, electronic device, and readable storage medium for recommending user questions. Background Art

[0002] With the booming development of online businesses such as online shopping malls and online diagnosis and treatment, the application of consulting scenarios such as user questions and machine answers is becoming more and more widespread. In the existing question-and-answer system, when users ask questions, the answers they get often fail to meet their needs due to unclear expressions, insufficient information, or lack of domain knowledge. When users enter questions, they may not be able to accurately express their intentions due to lack of relevant background knowledge, or they may feel confused due to information overload. At this time, the system recommends questions that users may be interested in or related to, which will greatly improve the user experience and information acquisition efficiency.

[0003] Most current user question recommendation solutions rely on data structures such as prefix trees for question matching. Although this method has its advantages in quickly matching user input, it is limited to matching text that begins with user input, making it difficult to deeply understand the user's true intentions. Moreover, when faced with a huge knowledge base, the prefix tree cannot effectively handle semantic-level matching, which limits the system's ability to respond to complex queries.

[0004] Therefore, how to improve the quality of question input and recommend questions that are of interest or related to users is a major challenge facing current question-answering systems. Summary of the invention

[0005] In response to the above problems, the embodiments of the present application provide a method, device, electronic device and readable storage medium for recommending user questions, aiming to better meet user needs, comprehensively improve the system of question recommendation accuracy and diversity, provide users with more personalized and intelligent recommendations, and help users obtain required information more efficiently, so as to overcome or partially overcome the shortcomings of the prior art.

[0006] In a first aspect, the present application provides a method for recommending user questions, comprising:

[0007] Preprocessing the data in the knowledge base, including: word segmentation, prefix tree construction, and vectorization processing;

[0008] Searching the user question in the knowledge base based on prefix tree, semantic similarity and keywords respectively to obtain joint search results, wherein the joint search results include multiple similar questions and corresponding answers;

[0009] Based on a multi-factor ranking method, a plurality of similar questions are determined from the joint search results as matching questions;

[0010] A generative large model is adopted to generate a number of interest questions with the user question and the answer to the matching question as input, and a number of interest questions are selected from the interest questions as recommendation results based on semantic similarity.

[0011] In a second aspect, the present application further provides a device for recommending user questions, the device comprising:

[0012] A preprocessing unit, used for preprocessing the data in the knowledge base, wherein the preprocessing includes: word segmentation, prefix tree construction, and vectorization processing;

[0013] A search unit, configured to search the user's question in the knowledge base based on a prefix tree, semantic similarity, and keywords, respectively, to obtain a joint search result, wherein the joint search result includes a plurality of similar questions and corresponding answers;

[0014] A sorting unit, configured to determine a plurality of similar questions as matching questions from the combined search results based on a multi-factor sorting method;

[0015] A generating unit is used for adopting a generative large model, taking the user question and the answer to the matching question as input, generating a plurality of interest questions, and selecting a plurality of interest questions as recommendation results based on semantic similarity.

[0016] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: a processor; and a memory arranged to store computer executable instructions, wherein when the executable instructions are executed, the processor executes any of the above-mentioned methods for recommending user questions.

[0017] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, which stores one or more programs, and when the one or more programs are executed by an electronic device including multiple applications, the electronic device executes any of the above-mentioned methods for recommending user questions.

[0018] At least one of the above technical solutions adopted in the embodiments of the present application can achieve the following beneficial effects:

[0019] The present application first pre-processes the data in the knowledge base by means of word segmentation, prefix tree construction, and vectorization, and then searches the user questions in the knowledge base by various means based on the prefix tree, semantic similarity and keywords to obtain a joint search result, which includes multiple similar questions and corresponding answers, and based on a multi-factor sorting method, multiple similar questions are determined from the joint search results as matching questions. Finally, a generative large model is used to generate a number of interest questions with user questions and answers to matching questions as input, and a number of questions with the best relevance are selected from the interest questions based on semantic similarity as recommendation results. This application provides a new question recommendation method by organically combining diversified search and generation technologies. First, this application improves the accuracy of question recommendation by deeply analyzing the questions input by users and automatically recommending related questions, which can significantly reduce the frustration of users in the input process and enable users to find the required information more quickly. Second, this application combines multiple technical means such as prefix trees, semantic similarity and keywords, which can not only match at the text level, but also understand user intentions at the semantic level. This deep understanding ability can identify the potential needs of user questions, thereby providing more accurate and relevant recommendation results; third, this application uses a generative large model to generate new potential questions as recommendation results based on the knowledge base and user questions. This innovative ability enriches the types of recommended questions, further improves the accuracy of question recommendations, and enhances user experience and satisfaction; and it has a wide range of application scenarios and strong practicality. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0021] Figure 1 A schematic diagram showing a flow chart of a method for recommending user questions according to an embodiment of the present application;

[0022] Figure 2 A schematic diagram showing the structure of a device for recommending user questions according to an embodiment of the present application is shown;

[0023] Figure 3 This is a schematic diagram of the structure of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION

[0024] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.

[0025] The technical solutions provided by various embodiments of the present application are described in detail below in conjunction with the accompanying drawings.

[0026] Question-answering systems can be widely used in online business systems in various industries. For example, in online medical scenarios, patients with abdominal pain can consult online or ask questions on their own. Due to the limited professional knowledge of patients, they cannot fully describe their symptoms clearly and accurately, and cannot ask accurate questions. In this case, the system can recommend questions to solve the user's troubles. Another example is an online shopping scenario. Users want to know the detailed parameters of a product or service. They may not be able to accurately describe the problem because they do not know the accurate fields of the parameters, or they just want to simply describe the problem. In this case, the system can recommend questions to reduce user operations and enable accurate questions to improve user experience.

[0027] Figure 1 A flowchart of a method for recommending user questions according to an embodiment of the present application is shown. Figure 1 It can be seen that this embodiment includes steps S110 to S140:

[0028] Step S110, preprocessing the data in the knowledge base, the preprocessing includes: word segmentation, prefix tree construction, and vectorization processing.

[0029] First, the scenario of this application is explained. When a user is using a question-and-answer system or a business system with an embedded question-and-answer system, he enters a question (referred to as a user question in this application) on the question page. The system uses the business logic of the method of this application, processes the user question, and recommends at least one question that the user may be interested in.

[0030] The knowledge base can be a database in a certain field or a universal database. The knowledge base contains a huge amount of data. In some embodiments of the present application, the data in the knowledge base is in the form of questions and answers, that is, it contains a large number of questions and the answers corresponding to each question. For example, the question: Which department should I go to for high blood sugar? The answer: Endocrinology. Such a question and answer constitutes a piece of data or a group of data. In this application, the original questions and added questions in the knowledge base are referred to as source questions.

[0031] First, the data in the knowledge base is preprocessed. In some embodiments of the present application, the preprocessing mainly includes but is not limited to: word segmentation, prefix tree construction, and vectorization processing.

[0032] Specifically, in some embodiments of the present application, the preprocessing of the data in the knowledge base includes: based on the dictionary of the word segmentation tool, incremental processing of the data in the knowledge base, and word segmentation processing of the data in the incremental knowledge base; constructing a prefix tree based on the word segmentation results of the knowledge base; using a word embedding model to vectorize each source question and the corresponding answer in the incremental knowledge base, wherein if the length of an answer exceeds a preset length, the answer is segmented and then vectorized.

[0033] The proprietary words in the knowledge base are added to the dictionary of any existing word segmentation tool to improve the accuracy of word segmentation, and then the word segmentation tool is used to segment all texts in the knowledge base for subsequent text search and similarity calculation. The word segmentation tool can be Jieba word segmentation tool, Jieba word segmentation tool, THULAC (Tsinghua University word segmentation tool), etc., which is not limited in this application.

[0034] According to the word segmentation results of questions in the knowledge base, a prefix tree is constructed to quickly match the text input by the user. Constructing a prefix tree (Trie) is an efficient way to manage and retrieve word segmentation results. The basic process of constructing a prefix tree is: define the prefix tree structure - create a Trie class - use the word segmentation results to construct a prefix tree.

[0035] Finally, vectorization is performed, and the word embedding model (Embedding model, such as GTE) is used to convert the questions in the knowledge base and the segmented answers into vector representations. These vectors can effectively express the characteristics of sentences, and the semantic relevance between texts can be reflected by calculating the cosine similarity of the vectors.

[0036] If an answer is too long and its length exceeds a preset length, the answer is defined as a "long answer". This long answer is first segmented and then converted into a vector representation.

[0037] Step S120, searching the user question in the knowledge base based on the prefix tree, semantic similarity and keywords respectively to obtain a joint search result, wherein the joint search result includes a plurality of similar questions and corresponding answers.

[0038] Then, by combining prefix trees, keywords (such as the BM25 algorithm), and semantic similarity search and other technical means, the system retrieves questions input by the user (recorded as user questions) in the knowledge base. The system not only matches at the text level, but also understands the user's intentions at the semantic level. This deep understanding ability enables the system to identify the potential needs of user questions, thereby providing more accurate and relevant recommendation results.

[0039] Specifically, in some embodiments, the user question is searched in the knowledge base based on the prefix tree, semantic similarity and keywords respectively to obtain a joint search result, including: segmenting and vectorizing the user question; based on the word segmentation result of the user question, searching in the prefix tree and arranging the texts in descending order according to the length, intercepting multiple texts ranked first as similar questions to form a first search result; determining the cosine similarity between the user question and each source question in the knowledge base, arranging them in descending order according to the relative size of the cosine similarity value, intercepting multiple source questions ranked first as similar questions to form a second search result; based on keywords, searching in the knowledge base to obtain a third search result; merging the first search result, the second search result and the third search result, and removing duplicates and historical recommendation questions to obtain a joint search result.

[0040] That is, the user questions are segmented and vectorized, and the method is the same as before. For example, in one embodiment, the jieba word segmentation tool is used to segment the user questions input by the user, and the Embedding model is used to convert the user input questions into vectors, which are subsequently used as the basis for search.

[0041] Then, the user question is searched in the knowledge base based on the prefix tree, semantic similarity and keywords respectively. These three search threads can be executed serially or in parallel, which is not limited in this application.

[0042] Among them, the search process based on the prefix tree: based on the word segmentation results of the user's question, search in the prefix tree and sort in descending order according to the length of the text, intercept multiple texts ranked first as similar questions, and constitute the first search result. That is, based on the word segmentation results of the user's question, quickly search for matching texts in the constructed prefix tree, for the searched text, select the shortest multiple results for output, record the searched questions as similar questions, and record the search results based on the prefix tree as the first search result.

[0043] Search process based on semantic similarity: determine the cosine similarity between the user question and each source question in the knowledge base, and arrange them in descending order according to the relative size of the cosine similarity value, intercept the multiple source questions ranked first as similar questions, and constitute the second search result. In some embodiments of the present application, cosine similarity is used to measure semantic similarity, and the top-K questions with the highest cosine similarity values ​​are found in the knowledge base through the vector representation of the user question, and the searched questions are recorded as similar questions, and the search results based on semantic similarity are recorded as the second search results.

[0044] The keyword-based search process: based on the word segmentation results of the knowledge base, the inverse document frequency of each word is calculated; based on the inverse document frequency, the BM25 algorithm is used to determine the relevance score between the user question and the source questions in the knowledge base; according to the relevance score, the source questions in the knowledge base are arranged in descending order; multiple source questions ranked first are intercepted as similar questions to form the third search result.

[0045] That is, use the BM25 algorithm to search the knowledge base for the Top-K questions similar to the user's question.

[0046] First, based on the word segmentation results, the inverse document frequency (IDF) of each word is calculated. The calculation formula is as follows:

[0047]

[0048] Where N is the total number of documents and DF(w) is the number of documents containing word w.

[0049] Calculate the relevance score (BM25 value) between the user question Q and each question D in the knowledge base. Specifically, for the user question Q and the question D in the knowledge base, the BM25 calculation formula is as follows:

[0050]

[0051] Among them, IDF(w i ) is the word w i The inverse document frequency of TF(w i ,D) is the word w i frequency in document D; |D| is the length of document D; avg dl is the average length of the document collection; k 1 and b are tuning parameters, usually set to k 1 ∈[1.2,2.0] and b∈[0,1].

[0052] According to the relevance score, the source questions in the knowledge base are arranged in descending order; and a plurality of source questions ranked first are intercepted as similar questions to form a third search result.

[0053] The above-mentioned question sets retrieved based on prefix tree, semantic relevance and keywords are merged, duplicates are removed, and questions that have been recommended or retrieved in historical conversations are eliminated to obtain joint search results.

[0054] Step S130: Based on a multi-factor ranking method, a plurality of similar questions are determined from the joint search results as matching questions.

[0055] A multi-factor sorting algorithm is used to reorder and select recalled similar questions from multiple angles or dimensions such as the relevance, importance and diversity of the questions to obtain multiple matching questions.

[0056] Specifically, in some embodiments, the multi-factor ranking method is used to determine multiple similar questions from the joint search results as matching questions, including: constructing a comprehensive scoring model based on vector cosine similarity, importance based on inverse document frequency, importance based on number of times, and maximum cosine similarity; determining a comprehensive score for each similar question based on the comprehensive scoring model, and arranging them in descending order according to the relative size of the comprehensive scores; and intercepting multiple similar questions ranked first as matching questions.

[0057] A comprehensive scoring model is constructed based on vector cosine similarity, importance based on inverse document frequency, importance based on number of times, and maximum cosine similarity. In some embodiments, the formula of the comprehensive scoring model is as shown in Formula 3:

[0058]

[0059] Among them, W i is the weight of each ranking factor;

[0060] Similarity(Q,D) represents the vector cosine similarity between user question Q and similar question D;

[0061] It is based on IDF to measure the importance of the question and uses To reduce the impact of text length, where avg dl is the average length of the text in the question set, |D| is the length of question D;

[0062] sigmoid(T D -avg T ) is the number of times a question is searched to measure its importance, where T D Indicates the number of times question D is searched, avg T is the average number of times the question was searched;

[0063] The sigmoid function is used to smooth the effect of frequency on the score. Its function expression is:

[0064]

[0065] Used to calculate the current similarity question D and the joint search result S D Other similar questions in D ′ The maximum cosine similarity between the two questions. When calculating the comprehensive score, subtracting this value can be used to reduce the scores of similar questions.

[0066] A comprehensive scoring model is used to determine the score of each similar question relative to the comprehensive score of the user question, and the similar questions are arranged in descending order according to the relative size of the comprehensive scores. Then, the top k (k≥1) similar questions are selected as matching questions.

[0067] Step S140, using a generative large model, taking the user question and the answer to the matching question as input, generating a number of interest questions, and selecting a number of interest questions as recommendation results based on semantic similarity.

[0068] The generative large model can be any one of the existing technologies, including but not limited to: GPT (Generative Pre-trained Transformer) series, T5 (Text-to-Text Transfer Transformer), BERT (Bidirectional Encoder Representations from Transformers), etc. In some embodiments of the present application, it is recommended to use Qwen-2.5-72B, which is a generative pre-trained language model and a member of the Qwen series. In terms of design, this model may adopt a new training method and optimization strategy to improve its performance in different application scenarios, such as dialogue coherence, information accuracy and response speed.

[0069] Taking the above-mentioned user questions and the answers to the matching questions as input, in some embodiments, a generative big model is adopted, taking the user questions and the answers to the matching questions as input, generating a number of interest questions, and selecting a number of interest questions as recommendation results based on semantic similarity, including: selecting a text segment with the highest semantic similarity to the user question from the answers to each of the matching questions; inputting the answer to the text segment together with the user question into the generative big model to generate a number of interest questions; determining the vector cosine similarity value between the user question and each of the interest questions, and arranging them in descending order according to the relative size of the vector cosine similarity values; and intercepting a number of interest questions whose vector cosine similarity values ​​are greater than a preset threshold as recommendation results.

[0070] Based on the vector representation of the user's question, the text segment with the closest semantics is matched from all the answer segments of the matching questions retrieved in the previous step. Specifically, the matching can be performed using vector cosine similarity.

[0071] The complete answer corresponding to the text fragment with the closest semantics is input into the generative large model together with the user's question to generate multiple new potential questions, which are recorded as interest questions.

[0072] Using vector cosine similarity, select the questions that are most semantically similar to the user's questions and whose similarity is greater than a threshold from the generated interest questions and recommend them to the user. That is, determine the vector cosine similarity value between the user's question and each interest question, and arrange them in descending order according to the relative size of the vector cosine similarity value, and intercept the interest questions whose vector cosine similarity value is greater than a preset threshold. The interest question can be one or more, and these one or more interest questions are recommended to the user as recommendation results.

[0073] Depend on Figure 1 It can be seen from the method shown that the present application first pre-processes the data in the knowledge base by means of word segmentation, prefix tree construction, and vectorization, and then searches the user questions in the knowledge base by various means based on the prefix tree, semantic similarity and keywords to obtain a joint search result, which includes multiple similar questions and corresponding answers, and based on a multi-factor sorting method, multiple similar questions are determined from the joint search results as matching questions. Finally, a generative large model is used to generate a number of interest questions with user questions and answers to matching questions as input, and a number of questions with the best relevance are selected from the interest questions based on semantic similarity as recommendation results. This application provides a new question recommendation method by organically combining diversified search and generation technologies. First, this application improves the accuracy of question recommendation by deeply analyzing the questions input by users and automatically recommending related questions, which can significantly reduce the frustration of users in the input process and enable users to find the required information more quickly. Second, this application combines multiple technical means such as prefix trees, semantic similarity and keywords, which can not only match at the text level, but also understand user intentions at the semantic level. This deep understanding ability can identify the potential needs of user questions, thereby providing more accurate and relevant recommendation results; third, this application uses a generative large model to generate new potential questions as recommendation results based on the knowledge base and user questions. This innovative ability enriches the types of recommended questions, further improves the accuracy of question recommendations, and enhances user experience and satisfaction; and it has a wide range of application scenarios and strong practicality.

[0074] Figure 2A schematic diagram showing the structure of a device for recommending user questions according to an embodiment of the present application is shown. Figure 2 It can be seen that the user question recommendation device 200 includes:

[0075] A preprocessing unit 210 is used to preprocess the data in the knowledge base, wherein the preprocessing includes: word segmentation, prefix tree construction, and vectorization processing;

[0076] A search unit 220, configured to search the user question in the knowledge base based on the prefix tree, the semantic similarity and the keyword, respectively, to obtain a joint search result, wherein the joint search result includes a plurality of similar questions and corresponding answers;

[0077] A sorting unit 230, configured to determine a plurality of similar questions as matching questions from the joint search results based on a multi-factor sorting method;

[0078] The generating unit 240 is used to adopt a generative large model, take the user question and the answer to the matching question as input, generate a plurality of interest questions, and select a plurality of interest questions as recommendation results based on semantic similarity.

[0079] In some embodiments of the present application, in the above-mentioned device, the preprocessing unit 210 is used to perform incremental processing on the data in the knowledge base based on the dictionary of the word segmentation tool, and to perform word segmentation on the data in the incremental knowledge base; to construct a prefix tree based on the word segmentation results of the knowledge base; and to use a word embedding model to vectorize each source question and the corresponding answer in the incremental knowledge base, wherein if the length of an answer exceeds a preset length, the answer is segmented and then vectorized.

[0080] In some embodiments of the present application, in the above-mentioned device, the search unit 220 is used to perform word segmentation and vectorization processing on the user question; based on the word segmentation result of the user question, search in the prefix tree and arrange in descending order according to the length of the text, intercept multiple texts ranked first as similar questions, and constitute a first search result; determine the cosine similarity between the user question and each source question in the knowledge base, and arrange in descending order according to the relative size of the cosine similarity value, intercept multiple source questions ranked first as similar questions, and constitute a second search result; based on keywords, search in the knowledge base to obtain a third search result; merge the first search result, the second search result and the third search result, and deduplicate and remove historical recommendation questions to obtain a joint search result.

[0081] In some embodiments of the present application, in the above-mentioned device, the search unit 220 is used to calculate the inverse document frequency of each word based on the word segmentation result of the knowledge base; based on the inverse document frequency, use the BM25 algorithm to determine the relevance score value between the user question and each source question in the knowledge base; according to the relevance score value, arrange the source questions in the knowledge base in descending order; intercept multiple source questions ranked first as similar questions to constitute a third search result.

[0082] In some embodiments of the present application, in the above-mentioned device, the sorting unit 230 is used to construct a comprehensive scoring model based on vector cosine similarity, importance based on inverse document frequency, importance based on number of times, and maximum cosine similarity; based on the comprehensive scoring model, determine the comprehensive score of each similar question, and arrange them in descending order according to the relative size of the comprehensive score; intercept multiple similar questions ranked first as matching questions.

[0083] In some embodiments of the present application, in the above device, the comprehensive scoring model is expressed as Formula 3:

[0084]

[0085] Among them, Score(D) represents the comprehensive score of similar questions D; W i is the weight of each ranking factor;

[0086] Similarity(Q,D) represents the vector cosine similarity between user question Q and similar question D; represents the importance based on inverse document frequency, where Used to reduce the impact of text length, where avg dl is the average length of the text in the question set, |D| is the length of similar question D;

[0087] sigmoid(T D -avg T ) represents the importance based on the number of times, T D Indicates the number of times similar question D is searched, avg T is the average number of times similar questions are searched;

[0088] Used to calculate the current similarity question D and joint search results S D Other similar questions in D ′ The maximum cosine similarity between .

[0089] In some embodiments of the present application, in the above-mentioned device, the generation unit 240 is used to select the text segment with the highest semantic similarity with the user question from the answers to each of the matching questions; input the answer to the text segment together with the user question into the generative large model to generate multiple interest questions; determine the vector cosine similarity value between the user question and each of the interest questions, and arrange them in descending order according to the relative size of the vector cosine similarity values; and intercept several interest questions whose vector cosine similarity values ​​are greater than a preset threshold as recommendation results.

[0090] It can be understood that the above-mentioned user question recommendation device can implement each step of the user question recommendation method provided in the aforementioned embodiment, and the relevant explanations on the user question recommendation method are applicable to the user question recommendation device, which will not be repeated here.

[0091] Figure 3 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. Figure 3 At the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and a memory. The memory may include a memory, such as a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage. Of course, the electronic device may also include hardware required for other services.

[0092] The processor, network interface and memory can be interconnected through an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0093] The memory is used to store the program. Specifically, the program may include a program code, and the program code includes a computer operation instruction. The memory may include a memory and a non-volatile memory, and provides instructions and data to the processor.

[0094] The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it, forming a recommendation device for the user's question at the logical level. The processor executes the program stored in the memory and is specifically used to perform the following operations:

[0095] Preprocessing the data in the knowledge base, including: word segmentation, prefix tree construction, and vectorization processing;

[0096] Searching the user question in the knowledge base based on prefix tree, semantic similarity and keywords respectively to obtain joint search results, wherein the joint search results include multiple similar questions and corresponding answers;

[0097] Based on a multi-factor ranking method, a plurality of similar questions are determined from the joint search results as matching questions;

[0098] A generative large model is adopted to generate a number of interest questions with the user question and the answer to the matching question as input, and a number of interest questions are selected from the interest questions as recommendation results based on semantic similarity.

[0099] It should be noted that the above-mentioned user question recommendation device can implement the above-mentioned user question recommendation method one by one, and will not be described in detail.

[0100] The above application Figure 2The method performed by the recommendation device for user problems disclosed in the illustrated embodiment can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor or an instruction in the form of software. The above processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as being executed by a hardware decoding processor, or being executed by a combination of hardware and software modules in a decoding processor. The software module can be located in a storage medium mature in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.

[0101] The electronic device may also perform Figure 2 A method for executing a recommendation device for user questions in a Figure 2 The functions of the illustrated embodiment will not be described in detail in the embodiments of the present application.

[0102] The present application also provides a computer-readable storage medium, which stores one or more programs, wherein the one or more programs include instructions, which, when executed by an electronic device including multiple application programs, enable the electronic device to execute Figure 2 The method performed by the user question recommendation device in the illustrated embodiment is specifically used to perform:

[0103] Preprocessing the data in the knowledge base, including: word segmentation, prefix tree construction, and vectorization processing;

[0104] Searching the user question in the knowledge base based on prefix tree, semantic similarity and keywords respectively to obtain joint search results, wherein the joint search results include multiple similar questions and corresponding answers;

[0105] Based on a multi-factor ranking method, a plurality of similar questions are determined from the joint search results as matching questions;

[0106] A generative large model is adopted to generate a number of interest questions with the user question and the answer to the matching question as input, and a number of interest questions are selected from the interest questions as recommendation results based on semantic similarity.

[0107] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0108] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes 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 processor, 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 1 A device that provides the functions specified in a block or multiple blocks.

[0109] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0110] 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 1A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0111] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0112] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0113] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0114] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0115] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0116] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims

1. A method for recommending user questions, characterized in that: include: Preprocessing the data in the knowledge base, including: word segmentation, prefix tree construction, and vectorization processing; Searching the user question in the knowledge base based on prefix tree, semantic similarity and keywords respectively to obtain joint search results, wherein the joint search results include multiple similar questions and corresponding answers; Based on a multi-factor ranking method, a plurality of similar questions are determined from the joint search results as matching questions; A generative large model is adopted to generate a number of interest questions with the user question and the answer to the matching question as input, and a number of interest questions are selected from the interest questions as recommendation results based on semantic similarity.

2. The method according to claim 1, characterized in that The preprocessing of the data in the knowledge base includes: Based on the dictionary of the word segmentation tool, incremental processing is performed on the data in the knowledge base, and word segmentation is performed on the data in the incremental knowledge base; Constructing a prefix tree based on the word segmentation results of the knowledge base; A word embedding model is used to vectorize each source question and the corresponding answer in the knowledge base increment. If the length of an answer exceeds a preset length, the answer is segmented and then vectorized.

3. The method according to claim 1, characterized in that The user question is searched in the knowledge base based on the prefix tree, semantic similarity and keywords respectively to obtain joint search results, including: Perform word segmentation and vectorization processing on the user question; Based on the word segmentation result of the user's question, searching in the prefix tree and sorting the texts in descending order according to the length of the texts, intercepting a plurality of texts ranked first as similar questions to form a first search result; Determine the cosine similarity between the user question and each source question in the knowledge base, and arrange them in descending order according to the relative size of the cosine similarity values, intercept the multiple source questions ranked first as similar questions, and constitute the second search result; Based on the keyword, searching the knowledge base to obtain a third search result; The first search result, the second search result and the third search result are combined, and duplicates and historical recommendation problems are removed to obtain a joint search result.

4. The method according to claim 1, characterized in that: The searching in the knowledge base based on the keyword to obtain the third search result includes: Based on the word segmentation results of the knowledge base, calculating the inverse document frequency of each word; Based on the inverse document frequency, a BM25 algorithm is used to determine a relevance score between the user question and each source question in the knowledge base; Arrange the source questions in the knowledge base in descending order according to the relevance score; A plurality of source questions ranked first are intercepted as similar questions to constitute the third search result.

5. The method according to any one of claims 1 to 4, characterized in that: The method of determining multiple similar questions as matching questions from the combined search results based on the multi-factor sorting method includes: A comprehensive scoring model is constructed based on vector cosine similarity, importance based on inverse document frequency, importance based on number of times, and maximum cosine similarity; Based on the comprehensive scoring model, determine the comprehensive score of each similar question, and arrange them in descending order according to the relative size of the comprehensive score; Select multiple similar questions that are ranked first as matching questions.

6. The method according to claim 5, characterized in that The comprehensive scoring model is expressed as formula 3: Among them, Score(D) represents the comprehensive score of similar questions D; W i is the weight of each ranking factor; Similarity(Q,D) represents the vector cosine similarity between user question Q and similar question D; represents the importance based on inverse document frequency, where Used to reduce the impact of text length, where avg dl is the average length of the text in the question set, |D| is the length of similar question D; sigmoid(T D -avg T ) represents the importance based on the number of times, T D Indicates the number of times similar question D is searched, avg T is the average number of times similar questions are searched; Used to calculate the current similarity question D and joint search results S D Other similar questions in D ′ The maximum cosine similarity between .

7. The method according to claim 1, characterized in that The generative big model is used to generate a number of interest questions using the user question and the answer to the matching question as input, and a number of recommendation results are selected from the interest questions based on semantic similarity, including: Selecting, from the answers to each of the matching questions, a text segment having the highest semantic similarity to the user's question; Inputting the answer to the text segment together with the user question into the generative big model to generate a plurality of interest questions; Determine the vector cosine similarity value between the user question and each of the interest questions, and arrange them in descending order according to the relative magnitude of the vector cosine similarity values; Several interesting questions whose vector cosine similarity values ​​are greater than a preset threshold are selected as recommendation results.

8. A user question recommendation device, characterized in that: The device comprises: A preprocessing unit, used for preprocessing the data in the knowledge base, wherein the preprocessing includes: word segmentation, prefix tree construction, and vectorization processing; A search unit, configured to search the user's question in the knowledge base based on a prefix tree, semantic similarity, and keywords, respectively, to obtain a joint search result, wherein the joint search result includes a plurality of similar questions and corresponding answers; A sorting unit, configured to determine a plurality of similar questions as matching questions from the combined search results based on a multi-factor sorting method; A generating unit is used for adopting a generative large model, taking the user question and the answer to the matching question as input, generating a plurality of interest questions, and selecting a plurality of interest questions as recommendation results based on semantic similarity.

9. An electronic device, comprising: processor; And a memory arranged to store computer executable instructions, characterized in that when the executable instructions are executed, the processor executes the recommendation method for user problems described in any one of 1 to 7.

10. A computer-readable storage medium storing one or more programs, characterized in that: When the one or more programs are executed by an electronic device including a plurality of application programs, the electronic device executes the method for recommending user questions as claimed in any one of claims 1 to 7.

Citation Information

Cited By

  • Question guiding method, server and storage medium

    CN120146859A

  • Urban governance data search method and device based on large model technology

    CN121188267A

  • A city governance data search method and device based on large model technology

    CN121188267B

  • Recommendation question generation method and system, electronic equipment and storage medium

    CN121434373A

  • A recommended question generation method, system, electronic device and storage medium

    CN121434373B