Case recommendation method and device, electronic equipment, storage medium and program product

Through vectorization processing and the attention algorithm of the large language model LLM, the difference vector between the problem vector and the target case vector is calculated, which solves the problem of low case recommendation accuracy in the operation and maintenance system and achieves higher recommendation accuracy.

CN120429428APending Publication Date: 2025-08-05CHINA MOBILE GROUP DESIGN INST +1
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202510529600.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-25
Publication Date
2025-08-05

AI Technical Summary

Technical Problem

In the prior art, the operation and maintenance system cannot identify the differences between similar cases when recommending cases, resulting in a low accuracy of case recommendations.

Method used

By receiving the problem information input by the user and performing vectorization processing, the big language model LLM and attention algorithm are used to calculate the difference vector between the problem vector and each target case vector, and convert it into probability, and output the case text corresponding to M target case vectors. The probability of M target case vectors is higher than the probability of the remaining target cases.

Benefits of technology

Improves the accuracy of case recommendations and ensures that the output case text is more accurately matched with user problems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120429428A_ABST
    Figure CN120429428A_ABST
Patent Text Reader

Abstract

The invention provides a case recommendation method and device, electronic equipment, a storage medium and a program product, and relates to the technical field of communication, the method comprises the following steps: receiving question information input by a user; retrieving in a preset database based on the question information to obtain N target case vectors, N being a positive integer greater than 1; vectorizing the question information to obtain a question vector and a first cue word corresponding to the question information; calling an LLM (Large Language Model) to calculate a distinguishing vector between the problem vector and each target case vector based on the first cue word, and converting the distinguishing vector between the problem vector and each target case vector into a probability based on an attention algorithm in the LLM; case texts corresponding to the M target case vectors are output, the probability of the M target case vectors is higher than the probability of other target cases, and M is a positive integer larger than 1. According to the invention, the accuracy of case recommendation can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technology, and in particular to a case recommendation method, device, electronic device, storage medium and program product. Background Art

[0002] Operations and maintenance systems are crucial for maintaining the normal operation of equipment in the communications technology field. In related technologies, operations and maintenance personnel send maintenance issues they encounter to the system, which then recommends relevant cases to facilitate their resolution. However, these systems typically recommend related cases based on the similarity between the cases and the maintenance issues. This means that two similar cases may address different problems, but the system cannot distinguish between them. Consequently, a recommended case may not resolve the maintenance issue, resulting in low case recommendation accuracy.

[0003] It can be seen that the related technology has the problem of low accuracy of case recommendation. Summary of the Invention

[0004] Embodiments of the present invention provide a case recommendation method, device, electronic device, storage medium, and program product to solve the problem of low accuracy of case recommendation in related technologies.

[0005] To solve the above problems, the present invention is achieved as follows:

[0006] In a first aspect, an embodiment of the present invention provides a case recommendation method, comprising:

[0007] Receive question information entered by the user;

[0008] Based on the problem information, a search is performed in a preset database to obtain N target case vectors, where N is a positive integer greater than 1;

[0009] Performing vectorization processing on the question information to obtain a question vector and a first prompt word corresponding to the question information;

[0010] Calling a large language model (LLM) to calculate a difference vector between the question vector and each target case vector based on the first prompt word, and converting the difference vector between the question vector and each target case vector into a probability based on an attention algorithm in the LLM;

[0011] Output case texts corresponding to M target case vectors, where the probabilities of the M target case vectors are higher than the probabilities of the remaining target cases, where M is a positive integer greater than 1.

[0012] In a second aspect, an embodiment of the present invention further provides a case recommendation device, comprising:

[0013] A first receiving module is used to receive question information input by a user;

[0014] A retrieval module, configured to search a preset database based on the problem information to obtain N target case vectors, where N is a positive integer greater than 1;

[0015] a processing module, configured to perform vectorization processing on the question information to obtain a question vector and a first prompt word corresponding to the question information;

[0016] A calling module is configured to call a large language model (LLM) to calculate a difference vector between the question vector and each target case vector based on the first prompt word, and convert the difference vector between the question vector and each target case vector into a probability based on an attention algorithm in the LLM;

[0017] The first output module is used to output case texts corresponding to M target case vectors, where the probabilities of the M target case vectors are higher than the probabilities of the remaining target cases, and M is a positive integer greater than 1.

[0018] In a third aspect, an embodiment of the present invention further provides an electronic device, including a transceiver and a processor.

[0019] The transceiver is used to receive question information input by the user;

[0020] The processor is configured to search a preset database based on the problem information to obtain N target case vectors, where N is a positive integer greater than 1;

[0021] The processor is further configured to perform vectorization processing on the question information to obtain a question vector and a first prompt word corresponding to the question information;

[0022] The processor is further configured to call a large language model (LLM) to calculate a difference vector between the question vector and each target case vector based on the first prompt word, and convert the difference vector between the question vector and each target case vector into a probability based on an attention algorithm in the LLM;

[0023] The transceiver is further configured to output case texts corresponding to M target case vectors, where the probabilities of the M target case vectors are higher than the probabilities of the remaining target cases, and M is a positive integer greater than 1.

[0024] In a fourth aspect, an embodiment of the present invention provides an electronic device comprising: a processor, a memory, and a program stored in the memory and executable on the processor, wherein the program, when executed by the processor, implements the steps of the case recommendation method described in the first aspect above.

[0025] In a fifth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the case recommendation method described in the first aspect are implemented.

[0026] In a sixth aspect, the present invention further provides a computer program product comprising computer instructions, which, when executed by a processor, implement the steps of the case recommendation method as described in the first aspect above.

[0027] In an embodiment of the present invention, a question information input by a user is received; a search is performed in a preset database based on the question information to obtain N target case vectors, where N is a positive integer greater than 1; the question information is vectorized to obtain a question vector and a first prompt word corresponding to the question information; a large language model (LLM) is called to calculate a difference vector between the question vector and each target case vector based on the first prompt word, and the difference vector between the question vector and each target case vector is converted into a probability based on the attention algorithm in the LLM; and case texts corresponding to M target case vectors are output, where the probability of the M target case vectors is higher than the probability of the remaining target cases, where M is a positive integer greater than 1. In this way, by calculating the difference vector between the question vector and each target case vector based on the first prompt word by the LLM, the difference between different target case vectors can be more accurately distinguished, and then the difference vector between the question vector and each target case vector is converted into a probability based on the attention algorithm in the LLM. The target case vector close to the question vector can be more accurately determined by the probability, and finally, the case texts corresponding to the M target case vectors are output, thereby improving the accuracy of case recommendation. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments of the present invention. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0029] Figure 1 is a flowchart of a case recommendation method provided by an embodiment of the present invention;

[0030] Figure 2 is a schematic diagram of a case recommendation provided by an embodiment of the present invention;

[0031] Figure 3 is a case text schematic diagram of outputting a target case vector provided by an embodiment of the present invention;

[0032] Figure 4This is one of the schematic diagrams for configuring LLM provided in an embodiment of the present invention;

[0033] Figure 5 This is the second schematic diagram of configuring LLM provided by an embodiment of the present invention;

[0034] Figure 6 This is the third schematic diagram of configuring LLM provided by an embodiment of the present invention;

[0035] Figure 7 This is the fourth schematic diagram of configuring LLM provided by an embodiment of the present invention;

[0036] Figure 8 This is the fifth schematic diagram of configuring LLM provided by an embodiment of the present invention;

[0037] Figure 9 This is the sixth schematic diagram of configuring LLM provided by an embodiment of the present invention;

[0038] Figure 10 This is the seventh schematic diagram of configuring LLM provided by an embodiment of the present invention;

[0039] Figure 11 This is the eighth schematic diagram of configuring LLM provided by an embodiment of the present invention;

[0040] Figure 12 is a structural diagram of a case recommendation device provided by an embodiment of the present invention;

[0041] Figure 13 This is a structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0042] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0043] In an embodiment of the present invention, a case recommendation method, apparatus, electronic device, storage medium, and program product are provided to solve the problem of low accuracy of case recommendation in related technologies.

[0044] For details, see Figure 1 , Figure 1 is a flow chart of a case recommendation method provided by an embodiment of the present invention, such as Figure 1 As shown, the following steps are included:

[0045] Step 101: Receive question information input by the user.

[0046] The above problem information is used to represent the problems encountered by users during the system operation and maintenance process. For example, when a user encounters an unsolvable problem while handling a system exception and needs to know related cases of the problem, the user sends a description of the problem to the server, that is, the above problem information. After receiving the problem information, the server outputs related cases to the user.

[0047] Among them, the server is a server that executes the case recommendation method. A preset database is set in the server, and the preset database includes cases to be recommended. After the server receives the question information, it verifies the validity of the question information. If the test is passed, it selects a case from the preset database and recommends it to the user.

[0048] Step 102: Search a preset database based on the problem information to obtain N target case vectors, where N is a positive integer greater than 1.

[0049] The preset database includes multiple preset case vectors, including vectors of case studies for solving different problems in the system operation and maintenance process. The preset database can be obtained through the professional knowledge of business experts and relevant technical personnel, or obtained from the Internet.

[0050] The target case vector is a case vector associated with the problem information. It should be noted that the preset database includes multiple case vectors, covering different areas of the system operation and maintenance process, while the problem information only targets issues in one area. To improve the accuracy of case recommendations, this embodiment of the present invention determines N target case vectors in the preset database that are potentially associated with the problem information. The closest case vector is then determined from these N case vectors for output, thereby improving both recommendation accuracy and efficiency.

[0051] In one embodiment, the construction of the preset database can adopt a structured storage method. The structured knowledge base is easier to expand and maintain, and new data fields and types can be flexibly added to adapt to the continuous changes in the actual operation and maintenance process. The construction of the preset database is mainly divided into data model design, number formatting, data storage and index establishment. The specific process is as follows:

[0052] Data model design: Design an appropriate data model based on the characteristics of operational knowledge. This includes defining data tables, fields, and relationships to ensure that all necessary element information can be stored and that the logical relationships between different elements are reflected. This data model allows for complex queries, including multi-condition queries, range queries, and join queries.

[0053] Data formatting: Converting extracted elements into a format that conforms to the data model. This includes converting text into records in the database, mapping keywords to specific fields, and parsing and storing structured information about operation and maintenance cases.

[0054] Data storage: Formatted data is stored in a system. This can be a relational database, a document database, or another type of data storage system. The key is to ensure data integrity and consistency, as well as the stability and security of the storage system.

[0055] Index creation: In order to improve retrieval speed, indexes will be created for stored data to improve retrieval speed.

[0056] The default database uses the JSON format, including two fields: prompt and completion. This allows large models to easily identify them as "questions" and "answers." The alert content is abstracted into a simple and clear question and stored in the prompt field. The completion field can record detailed information such as the error message, cause, and solution of the problem, as shown in the following example:

[0057] {

[0058] "prompt":"Redis memory usage is high",

[0059] "completion":"High Redis memory usage may be caused by the growth of data storage or the non-expiration of unused data. You need to regularly clean up unnecessary data and optimize memory configuration to reduce memory usage."

[0060] }

[0061] Step 103: perform vectorization processing on the question information to obtain a question vector and a first prompt word (prompt) corresponding to the question information.

[0062] The question vector is obtained by vectorizing the text content of the question information. The question content of the question information can be converted using a preset vectorization model to obtain the corresponding question vector. It should be noted that by vectorizing the question information to obtain the question vector, the question vector can be compared with the target case vector to determine the closest target case vector for recommendation.

[0063] The first prompt word is generated based on the text content of the question information. Specifically, it can be obtained by processing the text content of the question information using a preset prompt word engineering algorithm. The first prompt word is used to indicate the role played by the large language model, allowing the large language model to filter and obtain a more accurate target case vector based on the first prompt word.

[0064] Step 104: Call a large language model (LLM) to calculate a difference vector between the question vector and each target case vector based on the first prompt word, and convert the difference vector between the question vector and each target case vector into a probability based on the attention algorithm in the LLM.

[0065] The LLM is used to parse questions from operators and extract key information, such as case descriptions, references to relevant operations knowledge, and similarity matching. In some implementations, the large model can be fine-tuned using the case knowledge base based on GPT3.5, improving the accuracy of recommended case solutions through continuous training.

[0066] The case knowledge base is based on the knowledge documents of operation and maintenance personnel or is obtained from the Internet, where public operation and maintenance knowledge, public security knowledge, and public information technology (IT) knowledge can be obtained through the Internet.

[0067] The above call LLM is as follows Figure 2 As shown, the LLM is obtained by calling the LLM interface, and then the difference vector between the question vector and each target case vector is calculated based on the first prompt word through the LLM, and the difference vector between the question vector and each target case vector is converted into a probability based on the attention algorithm in the LLM.

[0068] The difference vector between the question vector and each target case vector is calculated based on the first prompt word. Specifically, the large model determines its role based on the first prompt word and then analyzes the question vector and each target case vector to determine the difference vector between them. For example, if the first prompt word is "I am currently an operations and maintenance expert, mainly handling important alarms," the large model will play the role of an operations and maintenance expert and analyze the question vector and each target case vector.

[0069] The above-mentioned attention algorithm is an algorithm combined with the attention mechanism. The algorithm is deployed in LLM. Through the attention algorithm in LLM, different weights are assigned to different parts (i.e., difference vectors) between the question vector and the target case vector to highlight important information, thereby determining the target case vector that is closer to the question vector.

[0070] Specifically, the conversion of the difference vector between the question vector and each target case vector into a probability based on the attention algorithm in the LLM can be expressed by the following formula:

[0071] attention_score(q,d)=softmax(q·d)

[0072] The formula is the attention_score() attention algorithm, q is the question vector, d is the target case vector, and softmax() is the activation function. The activation function is used to convert the vector into a probability.

[0073] In one embodiment, the LLM is obtained through training and can be evaluated by a cross-entropy loss function, which is expressed as follows:

[0074] L=-Σ(ylog(p))

[0075] In the formula, L is the loss value, y is the true identification type of the case, and p is the probability corresponding to the case predicted by LLM. When L is less than the preset loss threshold, the training is considered to meet the requirements.

[0076] Furthermore, the number of training rounds can be selected based on the amount of training data and model complexity. A validation set can be used to evaluate the performance of the model, and training can be stopped based on the validation set loss function value to avoid overfitting.

[0077] In one embodiment, the case knowledge base can be continuously improved by adding new cases and updating old cases, for example, by updating the case knowledge base based on user feedback. After the case knowledge base is updated, the parameters of the LLM can be further optimized using a policy gradient algorithm, as specifically expressed by the following formula:

[0078]

[0079] Among them, θ represents the parameters of LLM, α represents the learning rate, and Adam represents the Adam optimizer. represents the gradient of the loss function L with respect to the parameter θ.

[0080] Step 105: Output case texts corresponding to M target case vectors, where the probabilities of the M target case vectors are higher than the probabilities of the remaining target cases, and M is a positive integer greater than 1.

[0081] The output result is as follows: Figure 3As shown, M target case vectors are displayed in the output interface, and the user can provide feedback such as evaluation on the M target case vectors. After receiving the user's feedback, the server optimizes the recommended target cases. See the subsequent embodiments for details.

[0082] In an embodiment of the present invention, a question information input by a user is received; a search is performed in a preset database based on the question information to obtain N target case vectors, where N is a positive integer greater than 1; the question information is vectorized to obtain a question vector and a first prompt word corresponding to the question information; a large language model (LLM) is called to calculate a difference vector between the question vector and each target case vector based on the first prompt word, and the difference vector between the question vector and each target case vector is converted into a probability based on the attention algorithm in the LLM; and case texts corresponding to M target case vectors are output, where the probability of the M target case vectors is higher than the probability of the remaining target cases, where M is a positive integer greater than 1. In this way, by calculating the difference vector between the question vector and each target case vector based on the first prompt word by the LLM, the difference between different target case vectors can be more accurately distinguished, and then the difference vector between the question vector and each target case vector is converted into a probability based on the attention algorithm in the LLM. The target case vector close to the question vector can be more accurately determined by the probability, and finally, the case texts corresponding to the M target case vectors are output, thereby improving the accuracy of case recommendation.

[0083] In one embodiment, before receiving the problem information sent by the user, it is necessary to configure LLM to perform case recommendation. For example, Figure 4 As shown, select the LLM parameters that need to be configured in the configuration interface, including selecting a large language model, a vectorized database for knowledge storage in the large model, and the context memory capability of the large model. Figure 5 As shown, select a specific LLM model, such as GPT3.5, and set the Application Programming Interface (API) to facilitate calling the LLM.

[0084] Further, if Figure 6 As shown, configure the preset database, create an index, and obtain the API key. The parameters of the preset data include:

[0085] Configuration parameters:

[0086] Document: represents the knowledge source input into the knowledge base, which can be one or a batch of files (pdf, json, word, markdown), etc. Flowise includes various operators for parsing such files.

[0087] Embeddings: It is an algorithm that vectorizes the text after converting it into text, and converts the text in the document into quantitative processing.

[0088] Connection Credential: This is the API key parameter used to configure the connection to the default database.

[0089] Index (Pinecone index): used to configure the index of the preset database. Select the working index (workindex) here.

[0090] Further, if Figure 7 As shown, import the case through text. After importing the case, as shown Figure 8 As shown, select the text segmentation method to segment the text into multiple independent cases and store them in the preset database. For example, select the separator as "{", the chunk size as 300, and the chunk overlap as 200. After the text is segmented and multiple independent cases are obtained, Figure 9 As shown, the LLM API is called to convert the case into a vector through the embedding algorithm.

[0091] Further, if Figure 10 As shown, select context memory capability, select chat history for Memory Key, and select user input for Input Key.

[0092] After the configuration is completed, verify the configured LLM, such as Figure 11 As shown in the figure, after entering "abnormal CPU utilization", LLM outputs the expected cases from the preset case library and confirms that there are no abnormalities in the configuration.

[0093] In one embodiment, the preset database includes a plurality of initial case vectors, and the search is performed in the preset database based on the question information to obtain N target case vectors, including:

[0094] Calculating a first similarity between the question vector and each initial case vector;

[0095] The N initial case vectors with the largest first similarities among the multiple initial case vectors are set as the N target case vectors.

[0096] The aforementioned initial cases are collected from various pre-determined data sources, such as publicly available operational knowledge, security knowledge, IT knowledge, and operational knowledge documents of operational personnel. The initial case vectors can be used to identify and download knowledge documents through automated crawler technology, and then perform preliminary formatting. After this initial formatting, the data is cleaned, and the text is formatted using regular expressions and text normalization techniques. For example, various irregular text formats, such as excess spaces, special symbols, and incorrect line breaks, are removed through data cleaning to normalize the case library. Furthermore, the preset data can be self-updated based on the operational personnel's scoring and solution updates.

[0097] It should be noted that the preset database includes multiple case vectors covering different areas of the system operation and maintenance process, while the problem information only addresses issues in one area. To improve the efficiency of case recommendation, in this embodiment of the present invention, N target case vectors are determined from multiple initial cases, and M target case vectors are then determined from the N target case vectors to improve the efficiency of case recommendation.

[0098] The first similarity is the similarity between the initial case vector and the question vector, and is used to quickly and initially screen the initial case vector. Specifically, the first similarity can be obtained using cosine similarity, semantic similarity, and / or a nearest neighbor algorithm (e.g., a K-Nearest Neighbor (KNN) algorithm), and is calculated using one or more similarity algorithms.

[0099] In one embodiment, calculating the first similarity between the question vector and each initial case vector includes:

[0100] Calculating a first intermediate similarity between the question vector and the plurality of initial case vectors based on a cosine similarity algorithm;

[0101] Calculating a second intermediate similarity between the question vector and a plurality of first intermediate case vectors based on a word embedding algorithm, wherein the plurality of first intermediate case vectors are case vectors whose first intermediate similarity is greater than a first set similarity threshold among the plurality of initial case vectors;

[0102] Calculating the first similarity between the question vector and a plurality of second intermediate case vectors based on a nearest neighbor algorithm, wherein the plurality of second intermediate case vectors are case vectors whose first intermediate similarity is greater than a second set similarity threshold among the plurality of first intermediate case vectors;

[0103] The step of setting the N initial case vectors having the largest first similarities among the multiple initial case vectors as the N target case vectors includes:

[0104] The N second intermediate cases with the largest first similarities among the multiple second intermediate case vectors are set as the N target case vectors.

[0105] The above cosine similarity algorithm is used to calculate the cosine similarity (ie, first intermediate similarity) between the question vector and the initial case vector. The multiple initial case vectors are first filtered using the first intermediate similarity to obtain multiple first intermediate case vectors.

[0106] The first intermediate similarity between the question vector and the multiple initial case vectors calculated based on the cosine similarity algorithm can be expressed by the following formula:

[0107] Similarity1=cos(theta)=dot(query_vector,doc_vector) / (||query_vector||*||doc_vector||)

[0108] In the formula, dot represents the vector dot product, |||| represents the vector modulus, Similarity1 is the first intermediate similarity, query_vector is the question vector, and doc_vector is the initial case vector.

[0109] The above-mentioned word embedding algorithm is used to calculate the semantic similarity (i.e., second intermediate similarity) between multiple first intermediate case vectors and the question vector, and further filter the multiple first intermediate case vectors through the second intermediate similarity to obtain multiple second intermediate case vectors.

[0110] Among them, the words embedded by the word embedding algorithm can be obtained through a preset dictionary, which includes multiple words, and the words to be embedded are selected from the preset dictionary.

[0111] The aforementioned nearest neighbor algorithm is used to calculate the first similarity between the plurality of second intermediate case vectors and the question vector, and to determine N target case vectors from the plurality of second intermediate case vectors through the first similarity.

[0112] The calculation of the first similarity between the question vector and the plurality of second intermediate case vectors based on the nearest neighbor algorithm is specifically expressed by the following formula:

[0113] Similarity3=exp(-||query_vector-doc_vector||^2 / (2*sigma^2))

[0114] In the formula, Similarity3 is the first similarity, |||| represents the Euclidean distance of the vector, and sigma represents the standard deviation of the Gaussian distribution.

[0115] In an embodiment of the present invention, a first intermediate similarity between the question vector and the multiple initial case vectors is calculated based on a cosine similarity algorithm; a second intermediate similarity between the question vector and multiple first intermediate case vectors is calculated based on a word embedding algorithm, wherein the multiple first intermediate case vectors are case vectors among the multiple initial case vectors whose first intermediate similarity is greater than a first set similarity threshold; and a first similarity between the question vector and multiple second intermediate case vectors is calculated based on a nearest neighbor algorithm, wherein the multiple second intermediate case vectors are case vectors among the multiple first intermediate case vectors whose first intermediate similarity is greater than a second set similarity threshold. In this way, multiple filtering of the initial case vectors is achieved through the first intermediate similarity, the second intermediate similarity, and the first similarity, so that the resulting N target case vectors have a higher similarity with the question vector, and thus M target case vectors with a higher accuracy can be obtained from the N target case vectors.

[0116] For example, in an embodiment of the present invention, the problem information is "abnormal CPU usage", and the problem information is first vectorized to obtain a problem vector. The cosine similarity is used to calculate the first intermediate similarity between the text vector and each text vector in the database to obtain an initial sorting result. For the texts ranked high in the initial sorting result (i.e., multiple first intermediate case vectors), a similarity calculation method based on word embedding is used to perform semantic matching to further adjust the sorting result. For the texts ranked high in the further adjusted sorting result (i.e., multiple second intermediate case vectors), the KNN algorithm is used to find the N target case vectors closest to the problem vector.

[0117] In one embodiment, setting the N second intermediate cases with the largest first similarities among the plurality of second intermediate case vectors as the N target case vectors includes:

[0118] Acquiring historical feedback information of the user, wherein the historical feedback information includes at least one of historical ratings, historical preferences, historical personalized information, and historical keywords;

[0119] filtering the plurality of second intermediate case vectors based on the historical feedback information to obtain a plurality of third intermediate case vectors;

[0120] The N second intermediate cases with the largest first similarities among the multiple third intermediate case vectors are set as the N target case vectors.

[0121] It should be noted that, in addition to the above method of determining N target case vectors by the first intermediate similarity, the second intermediate similarity and the first similarity, N target case vectors can also be determined based on the user's previous historical feedback information to improve the accuracy of the obtained N target case vectors.

[0122] The historical feedback information mentioned above is the feedback provided by the user on the case text after receiving the output case text. The historical feedback information can reflect the user's preference for the case. The N target case vectors are filtered by the historical feedback information to improve the accuracy of the obtained N target case vectors.

[0123] The historical feedback information includes at least one of historical ratings, historical preferences, historical personalized information, and historical keywords. The filtering of the plurality of second intermediate case vectors based on the historical feedback information to obtain the plurality of third intermediate case vectors includes at least one of the following:

[0124] Filtering based on historical scores so that the filtered plurality of third intermediate case vectors are case vectors with higher historical scores;

[0125] Filtering based on historical preferences ensures that the multiple third intermediate case vectors obtained by filtering are case vectors consistent with the user's preferences, and filters out case vectors that do not meet the user's needs, thereby reducing the interference of irrelevant information;

[0126] Filtering based on historical personalized information, where historical personalized information includes the user's historical query records, browsing history, preferences, etc., so that the multiple third intermediate case vectors obtained by filtering meet the user's personalized needs, thereby improving the relevance and effectiveness of the search results;

[0127] Filtering based on historical keywords achieves semantic expansion, thereby improving the coverage of search results.

[0128] In this embodiment of the present invention, historical feedback information from a user is obtained, the historical feedback information including at least one of historical ratings, historical preferences, historical personalized information, and historical keywords. Multiple second intermediate case vectors are filtered based on the historical feedback information to obtain multiple third intermediate case vectors. The N second intermediate cases with the highest first similarity among the multiple third intermediate case vectors are set as the N target case vectors. In this way, the N target case vectors are obtained based on the historical feedback information, thereby improving the accuracy of the retrieved N target case vectors.

[0129] In one embodiment, the calling of the large language model (LLM) to calculate a difference vector between the question vector and each target case vector based on the first prompt word includes:

[0130] Invoking the LLM to calculate the difference vector between the question vector and each target case vector based on the first prompt word and a target learning algorithm in the LLM;

[0131] The target learning algorithm is obtained as follows:

[0132] Acquire sample data, where the sample data includes at least one of text data, image data, and video data;

[0133] Training the initial algorithm based on the text data to obtain a first intermediate algorithm; and / or training the initial algorithm based on the image data to obtain a second intermediate algorithm; and / or training the initial algorithm based on the video data to obtain a third intermediate algorithm;

[0134] The first intermediate algorithm, the second intermediate algorithm and / or the third intermediate algorithm are integrated to obtain the target learning algorithm.

[0135] In an embodiment of the present invention, the initial algorithm is trained based on the text data to obtain a first intermediate algorithm; and / or, the initial algorithm is trained based on the image data to obtain a second intermediate algorithm; and / or, the initial algorithm is trained based on the video data to obtain a third intermediate algorithm; the first intermediate algorithm, the second intermediate algorithm, and / or the third intermediate algorithm are fused to obtain the target learning algorithm. In this way, the target learning algorithm can distinguish and identify different types of data; then, by calling the LLM, the difference vector between the question vector and each target case vector is calculated based on the first prompt word and the target learning algorithm in the LLM, thereby improving the accuracy of distinguishing different case vectors, and then improving the accuracy of the output M target case vectors.

[0136] The sample data can be obtained from a pre-set case library, which includes multimodal data such as text, image, and video data, such as images of equipment failures and videos of troubleshooting processes. In an embodiment of the present invention, a target learning algorithm is used to learn the relationships between cases and use them in case recommendations, thereby improving the accuracy of recommendation results. The target learning algorithm is a multimodal deep learning algorithm. Learning the relationships between cases through the multimodal deep learning algorithm allows the multimodal data to more comprehensively describe the cases, improve the accuracy of recommendation results, provide richer case information, and help users better understand the problem.

[0137] Specifically, the above-mentioned acquisition of sample data includes: converting data in different modalities such as text, image, video, etc. into a sequence form (for example, data in the sequence form of text data, image data, and video data).

[0138] After obtaining the sample data, the initial algorithm (such as the Transformer model) is used to learn the relationship between different elements in the sequence, extract the feature representation of the sequence, and input the feature representation of the sequence into the deep learning model for classification or regression to obtain the target learning model.

[0139] The above classification or regression is performed to obtain the target learning model, which can be expressed by the following formula:

[0140] X_text=TextTransformer(X_text) # Transformer model for text data type (i.e., the first intermediate algorithm);

[0141] X_image = ImageTransformer(X_image) # Transformer model of image data type (i.e., the second intermediate algorithm);

[0142] X_video = VideoTransformer(X_video) # Transformer model of video data type (i.e., the third intermediate algorithm);

[0143] X_fused=concatenate(X_text,X_image,X_video)#Feature fusion;

[0144] Y=f(X_fused)#Target learning algorithm.

[0145] The above formula is used to integrate different intermediate algorithms to obtain the target learning model.

[0146] In one embodiment, after outputting the case texts corresponding to the M target case vectors, the method further includes:

[0147] receiving feedback information input by the user;

[0148] Calculating a second similarity corresponding to each target case vector in the N target case vectors based on the feedback information;

[0149] Output case texts corresponding to K target case vectors, where the second similarities of the K target case vectors are higher than the probability of the remaining target cases, where K is a positive integer greater than 1.

[0150] The above feedback information is the user's feedback on the case text corresponding to the output M target case vectors, which may include a response to whether the case questions are satisfactory, as well as opinions on adjustments and modifications to the case.

[0151] In this embodiment of the present invention, feedback information input by the user is received; a second similarity corresponding to each of the N target case vectors is calculated based on the feedback information; and case texts corresponding to K target case vectors are output, with a probability that the second similarity of the K target case vectors is higher than that of the remaining target cases, where K is a positive integer greater than 1. Thus, after receiving the user feedback information, the output target case vectors are adjusted based on the feedback information to further improve the accuracy of case recommendations.

[0152] In one embodiment, the feedback information includes at least one of a feedback word, a feedback topic, a feedback case, and a feedback score;

[0153] The calculating, based on the feedback information, a second similarity corresponding to each target case vector in the N target case vectors includes:

[0154] Calculating a first sub-similarity corresponding to each target case vector in the N target case vectors based on the feedback word; and / or,

[0155] Calculating a second sub-similarity corresponding to each target case vector in the N target case vectors based on the feedback topic; and / or,

[0156] Calculating a third sub-similarity corresponding to each target case vector in the N target case vectors based on the feedback case;

[0157] The first sub-similarity, the second sub-similarity, the third sub-similarity and / or the feedback score are weighted to obtain the second similarity corresponding to each target case vector in the N target case vectors.

[0158] In an embodiment of the present invention, a first sub-similarity corresponding to each target case vector in the N target case vectors is calculated based on the feedback word; and / or a second sub-similarity corresponding to each target case vector in the N target case vectors is calculated based on the feedback topic; and / or a third sub-similarity corresponding to each target case vector in the N target case vectors is calculated based on the feedback case; the first sub-similarity, the second sub-similarity, the third sub-similarity, and / or the feedback score are weighted to obtain the second similarity corresponding to each target case vector in the N target case vectors. In this way, the output target case vector is adjusted based on one or more of the feedback word, feedback topic, feedback case, and feedback score of the user feedback, thereby further improving the accuracy of case recommendation.

[0159] In one embodiment, calculating the first sub-similarity corresponding to each target case vector in the N target case vectors based on the feedback word includes:

[0160] Obtaining N initial case vectors corresponding to the N target case vectors, where the initial case vectors correspond one-to-one to the target case vectors;

[0161] Embedding the feedback word into the case text corresponding to the N initial case vectors to obtain N embedded texts;

[0162] Calculate the intermediate vectors corresponding to the N embedded texts;

[0163] The similarity between the intermediate vector and the target case vector is calculated to obtain a first sub-similarity corresponding to each target case vector in the N target case vectors.

[0164] In this embodiment of the present invention, N initial case vectors corresponding to the N target case vectors are obtained, with the initial case vectors corresponding to the target case vectors in a one-to-one relationship. The feedback word is embedded into the case text corresponding to the N initial case vectors to obtain N embedded texts. An intermediate vector corresponding to the N embedded texts is calculated. The similarity between the intermediate vector and the target case vector is calculated to obtain a first sub-similarity corresponding to each of the N target case vectors. In this way, the output target case vector is adjusted by the feedback word through word embedding.

[0165] Specifically, the first sub-similarity (similarity_word(word1,word2)) can be calculated using the following formula:

[0166] similarity_word(word1,word2)=cosine_similarity(embedding(word1),embedding(word2))

[0167] In the formula, word1 and word2 represent two words, where word1 is the feedback word and word2 is the word obtained from the preset dictionary. embedding represents the word embedding function, and cosine_similarity represents the cosine similarity function.

[0168] In one embodiment, calculating the second sub-similarity corresponding to each target case vector in the N target case vectors based on the feedback topic includes:

[0169] Calculating a first probability of a question vector corresponding to the question information based on the feedback topic, where the first probability is used to represent the possibility that the question vector belongs to the feedback topic;

[0170] Calculating a second probability of each target case vector in the N target case vectors based on the feedback topic, where the second probability is used to represent the possibility that the target case vector belongs to the feedback topic;

[0171] The product of the first probability and the second probability is set as the second sub-similarity corresponding to each target case vector in the N target case vectors.

[0172] In this embodiment of the present invention, a first probability of the question vector corresponding to the question information is calculated based on the feedback topic, where the first probability is used to indicate the likelihood that the question vector belongs to the feedback topic. A second probability of each of the N target case vectors is calculated based on the feedback topic, where the second probability is used to indicate the likelihood that the target case vector belongs to the feedback topic. The product of the first and second probabilities is set as the second sub-similarity corresponding to each of the N target case vectors. In this way, by comparing the probabilities of the feedback topics in different vectors, the second sub-similarity corresponding to each of the N target case vectors is determined.

[0173] Specifically, the second sub-similarity (similarity_topic(document1,document2)) can be expressed by the following formula:

[0174] similarity_topic(document1,document2)=Σ(p(topic|document1)*p(topic|document2))

[0175] Among them, document1 and document2 represent the question vector and target case vector, and p(topic|document) represents the probability that a document belongs to a certain topic.

[0176] In one embodiment, the third sub-similarity corresponding to each target case vector in the N target case vectors is calculated based on the feedback case, and the third sub-similarity corresponding to each target case vector can be calculated using a neural network model, which can be specifically expressed by the following formula:

[0177] similarity_model(document1,document2)=model(document1,document2)

[0178] Among them, similarity_model(document1,document2) is the third sub-similarity, and model represents a neural network model used to calculate the similarity between vectors.

[0179] Furthermore, after calculating the first sub-similarity, the second sub-similarity, and / or the third sub-similarity, the first sub-similarity, the second sub-similarity, the third sub-similarity, and / or the feedback score are weighted to obtain the second similarity (Similarity2) corresponding to each target case vector in the N target case vectors, which can be specifically expressed by the following formula:

[0180] Similarity2=α*similarity_word+β*similarity_topic+γ*similarity_model+δ*user_feedback

[0181] Among them, similarity_word represents the first sub-similarity, similarity_topic represents the second sub-similarity, similarity_model represents the third sub-similarity, user_feedback represents the feedback score, and α, β, γ, and δ represent weight coefficients.

[0182] The second similarity can be calculated using the above formula.

[0183] In one embodiment, after calculating the second similarity corresponding to each target case vector in the N target case vectors based on the feedback information, the method further includes:

[0184] weighting the first similarity and the second similarity to obtain a third similarity;

[0185] The probability that the third similarities of the K target case vectors are higher than those of the remaining target cases.

[0186] In an embodiment of the present invention, the first similarity and the second similarity are combined to obtain a third similarity, and then K target case vectors are screened by the third similarity, thereby avoiding the second similarity being too biased towards user feedback information, resulting in a decrease in accuracy, and improving the accuracy of case recommendations.

[0187] See Figure 12 , Figure 12 is a structural diagram of a case recommendation device provided by an embodiment of the present invention, such as Figure 12 As shown, the case recommendation device 1200 includes:

[0188] The first receiving module 1201 is used to receive question information input by the user;

[0189] A retrieval module 1202 is configured to search a preset database based on the question information to obtain N target case vectors, where N is a positive integer greater than 1;

[0190] The processing module 1203 is configured to perform vectorization processing on the question information to obtain a question vector and a first prompt word corresponding to the question information;

[0191] A calling module 1204 is configured to call a large language model (LLM) to calculate a difference vector between the question vector and each target case vector based on the first prompt word, and convert the difference vector between the question vector and each target case vector into a probability based on an attention algorithm in the LLM.

[0192] The first output module 1205 is configured to output case texts corresponding to M target case vectors, where the probabilities of the M target case vectors are higher than the probabilities of the remaining target cases, and M is a positive integer greater than 1.

[0193] In one embodiment, the preset database includes a plurality of initial case vectors, and the retrieval module 1202 includes:

[0194] a calculation submodule, configured to calculate a first similarity between the question vector and each initial case vector;

[0195] A setting submodule is configured to set the N initial case vectors having the largest first similarities among the multiple initial case vectors as the N target case vectors.

[0196] In one embodiment, the calculation submodule includes:

[0197] a first calculation unit, configured to calculate a first intermediate similarity between the question vector and the plurality of initial case vectors based on a cosine similarity algorithm;

[0198] a second calculation unit, configured to calculate, based on a word embedding algorithm, a second intermediate similarity between the question vector and a plurality of first intermediate case vectors, wherein the plurality of first intermediate case vectors are case vectors whose first intermediate similarities are greater than a first set similarity threshold among the plurality of initial case vectors;

[0199] a third calculation unit, configured to calculate, based on a nearest neighbor algorithm, the first similarity between the question vector and a plurality of second intermediate case vectors, the plurality of second intermediate case vectors being case vectors whose first intermediate similarity is greater than a second set similarity threshold among the plurality of first intermediate case vectors;

[0200] The setting submodule includes:

[0201] A setting unit is configured to set the N second intermediate cases with the largest first similarities among the multiple second intermediate case vectors as the N target case vectors.

[0202] In one embodiment, the setting unit includes:

[0203] An acquisition subunit, configured to acquire historical feedback information of the user, wherein the historical feedback information includes at least one of historical ratings, historical preferences, historical personalized information, and historical keywords;

[0204] a filtering subunit, configured to filter the plurality of second intermediate case vectors based on the historical feedback information to obtain a plurality of third intermediate case vectors;

[0205] A setting subunit is configured to set the N second intermediate cases with the largest first similarities among the multiple third intermediate case vectors as the N target case vectors.

[0206] In one embodiment, the calling module 1204 includes:

[0207] a calling submodule, configured to call the LLM, and calculate the difference vector between the question vector and each target case vector based on the first prompt word and the target learning algorithm in the LLM;

[0208] The target learning algorithm is obtained as follows:

[0209] Acquire sample data, where the sample data includes at least one of text data, image data, and video data;

[0210] Training the initial algorithm based on the text data to obtain a first intermediate algorithm; and / or training the initial algorithm based on the image data to obtain a second intermediate algorithm; and / or training the initial algorithm based on the video data to obtain a third intermediate algorithm;

[0211] The first intermediate algorithm, the second intermediate algorithm and / or the third intermediate algorithm are integrated to obtain the target learning algorithm.

[0212] In one embodiment, the case recommendation device 1200 further includes:

[0213] A second receiving module is used to receive feedback information input by the user;

[0214] a calculation module, configured to calculate a second similarity corresponding to each of the N target case vectors based on the feedback information;

[0215] The second output module is used to output case texts corresponding to K target case vectors, where the second similarities of the K target case vectors are higher than the probability of the remaining target cases, and K is a positive integer greater than 1.

[0216] In one embodiment, the feedback information includes at least one of a feedback word, a feedback topic, a feedback case, and a feedback score;

[0217] The calculation module includes:

[0218] A first calculation submodule is configured to calculate a first sub-similarity corresponding to each of the N target case vectors based on the feedback word; and / or,

[0219] A second calculation submodule is configured to calculate a second sub-similarity corresponding to each target case vector in the N target case vectors based on the feedback topic; and / or,

[0220] A third calculation submodule, configured to calculate a third sub-similarity corresponding to each target case vector in the N target case vectors based on the feedback case;

[0221] A weighting submodule is configured to weight the first sub-similarity, the second sub-similarity, the third sub-similarity and / or the feedback score to obtain the second similarity corresponding to each target case vector in the N target case vectors.

[0222] In one embodiment, the first calculation submodule includes:

[0223] an acquiring unit, configured to acquire N initial case vectors corresponding to the N target case vectors, wherein the initial case vectors correspond to the target case vectors in a one-to-one manner;

[0224] An embedding unit, configured to embed the feedback word into the case text corresponding to the N initial case vectors to obtain N embedded texts;

[0225] a fourth computing unit, configured to compute intermediate vectors corresponding to the N embedded texts;

[0226] A fifth calculation unit is configured to calculate a similarity between the intermediate vector and the target case vector, and obtain a first sub-similarity corresponding to each target case vector in the N target case vectors.

[0227] In one embodiment, the second calculation submodule includes:

[0228] A sixth calculation unit, configured to calculate a first probability of a question vector corresponding to the question information based on the feedback topic, wherein the first probability is used to represent a possibility that the question vector belongs to the feedback topic;

[0229] a seventh calculation unit, configured to calculate a second probability of each target case vector in the N target case vectors based on the feedback topic, wherein the second probability is used to represent a possibility that the target case vector belongs to the feedback topic;

[0230] An eighth calculation unit is configured to set the product of the first probability and the second probability as the second sub-similarity corresponding to each target case vector in the N target case vectors.

[0231] The case recommendation device provided in the embodiment of the present invention is capable of implementing the various processes of the various embodiments of the above-mentioned case recommendation method. The technical features correspond one to one and can achieve the same technical effects. To avoid repetition, they will not be described here.

[0232] It should be noted that the case recommendation device in the embodiment of the present invention may be a device, or a component, integrated circuit, or chip in an electronic device.

[0233] An embodiment of the present invention also provides an electronic device, comprising: a processor, a memory, and a program stored on the memory and runnable on the processor. When the program is executed by the processor, the various processes of the above-mentioned case recommendation method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0234] For details, see Figure 13 As shown, an embodiment of the present invention further provides an electronic device, including a bus 1301 , a transceiver 1302 , an antenna 1303 , a bus interface 1304 , a processor 1305 and a memory 1306 .

[0235] The transceiver 1302 is used to receive question information input by the user;

[0236] The processor 1305 is configured to search a preset database based on the question information to obtain N target case vectors, where N is a positive integer greater than 1;

[0237] The processor 1305 is further configured to perform vectorization processing on the question information to obtain a question vector and a first prompt word corresponding to the question information;

[0238] The processor 1305 is further configured to call a large language model (LLM) to calculate a difference vector between the question vector and each target case vector based on the first prompt word, and convert the difference vector between the question vector and each target case vector into a probability based on an attention algorithm in the LLM;

[0239] The transceiver 1302 is further configured to output case texts corresponding to M target case vectors, where the probabilities of the M target case vectors are higher than the probabilities of the remaining target cases, and M is a positive integer greater than 1.

[0240] In one embodiment, the preset database includes a plurality of initial case vectors, and the search is performed in the preset database based on the question information to obtain N target case vectors, including:

[0241] Calculating a first similarity between the question vector and each initial case vector;

[0242] The N initial case vectors with the largest first similarities among the multiple initial case vectors are set as the N target case vectors.

[0243] In one embodiment, calculating the first similarity between the question vector and each initial case vector includes:

[0244] Calculating a first intermediate similarity between the question vector and the plurality of initial case vectors based on a cosine similarity algorithm;

[0245] Calculating a second intermediate similarity between the question vector and a plurality of first intermediate case vectors based on a word embedding algorithm, wherein the plurality of first intermediate case vectors are case vectors whose first intermediate similarity is greater than a first set similarity threshold among the plurality of initial case vectors;

[0246] Calculating the first similarity between the question vector and a plurality of second intermediate case vectors based on a nearest neighbor algorithm, wherein the plurality of second intermediate case vectors are case vectors whose first intermediate similarity is greater than a second set similarity threshold among the plurality of first intermediate case vectors;

[0247] The step of setting the N initial case vectors having the largest first similarities among the multiple initial case vectors as the N target case vectors includes:

[0248] The N second intermediate cases with the largest first similarities among the multiple second intermediate case vectors are set as the N target case vectors.

[0249] In one embodiment, setting the N second intermediate cases with the largest first similarities among the plurality of second intermediate case vectors as the N target case vectors includes:

[0250] Acquiring historical feedback information of the user, wherein the historical feedback information includes at least one of historical ratings, historical preferences, historical personalized information, and historical keywords;

[0251] filtering the plurality of second intermediate case vectors based on the historical feedback information to obtain a plurality of third intermediate case vectors;

[0252] The N second intermediate cases with the largest first similarities among the multiple third intermediate case vectors are set as the N target case vectors.

[0253] In one embodiment, the calling of the large language model (LLM) to calculate a difference vector between the question vector and each target case vector based on the first prompt word includes:

[0254] Invoking the LLM to calculate the difference vector between the question vector and each target case vector based on the first prompt word and a target learning algorithm in the LLM;

[0255] The target learning algorithm is obtained as follows:

[0256] Acquire sample data, where the sample data includes at least one of text data, image data, and video data;

[0257] Training the initial algorithm based on the text data to obtain a first intermediate algorithm; and / or training the initial algorithm based on the image data to obtain a second intermediate algorithm; and / or training the initial algorithm based on the video data to obtain a third intermediate algorithm;

[0258] The first intermediate algorithm, the second intermediate algorithm and / or the third intermediate algorithm are integrated to obtain the target learning algorithm.

[0259] In one embodiment, the transceiver 1302 is further configured to receive feedback information input by the user;

[0260] The processor 1305 is further configured to calculate a second similarity corresponding to each target case vector in the N target case vectors based on the feedback information;

[0261] The transceiver 1302 is further configured to output case texts corresponding to K target case vectors, wherein the second similarities of the K target case vectors are higher than the probability of the remaining target cases, where K is a positive integer greater than 1.

[0262] In one embodiment, the feedback information includes at least one of a feedback word, a feedback topic, a feedback case, and a feedback score;

[0263] The calculating, based on the feedback information, a second similarity corresponding to each target case vector in the N target case vectors includes:

[0264] Calculating a first sub-similarity corresponding to each target case vector in the N target case vectors based on the feedback word; and / or,

[0265] Calculating a second sub-similarity corresponding to each target case vector in the N target case vectors based on the feedback topic; and / or,

[0266] Calculating a third sub-similarity corresponding to each target case vector in the N target case vectors based on the feedback case;

[0267] The first sub-similarity, the second sub-similarity, the third sub-similarity and / or the feedback score are weighted to obtain the second similarity corresponding to each target case vector in the N target case vectors.

[0268] In one embodiment, calculating the first sub-similarity corresponding to each target case vector in the N target case vectors based on the feedback word includes:

[0269] Obtaining N initial case vectors corresponding to the N target case vectors, where the initial case vectors correspond one-to-one to the target case vectors;

[0270] Embedding the feedback word into the case text corresponding to the N initial case vectors to obtain N embedded texts;

[0271] Calculate the intermediate vectors corresponding to the N embedded texts;

[0272] The similarity between the intermediate vector and the target case vector is calculated to obtain a first sub-similarity corresponding to each target case vector in the N target case vectors.

[0273] In one embodiment, calculating the second sub-similarity corresponding to each target case vector in the N target case vectors based on the feedback topic includes:

[0274] Calculating a first probability of a question vector corresponding to the question information based on the feedback topic, where the first probability is used to represent the possibility that the question vector belongs to the feedback topic;

[0275] Calculating a second probability of each target case vector in the N target case vectors based on the feedback topic, where the second probability is used to represent the possibility that the target case vector belongs to the feedback topic;

[0276] The product of the first probability and the second probability is set as the second sub-similarity corresponding to each target case vector in the N target case vectors.

[0277] exist Figure 13In the embodiment, the bus architecture (represented by bus 1301) is shown. Bus 1301 may include any number of interconnected buses and bridges. Bus 1301 links together various circuits including one or more processors represented by processor 1305 and memory represented by memory 1306. Bus 1301 may also link together various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are all well known in the art and are therefore not described further herein. Bus interface 1304 provides an interface between bus 1301 and transceiver 1302. Transceiver 1302 may be one element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices on a transmission medium. Data processed by processor 1305 is transmitted on a wireless medium via antenna 1303. Furthermore, antenna 1303 also receives data and transmits the data to processor 1305.

[0278] The processor 1305 is responsible for managing the bus 1301 and general processing, and may also provide various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. The memory 1306 may be used to store data used by the processor 1305 when performing operations.

[0279] Optionally, the processor 1305 may be a CPU, an ASIC, an FPGA, or a CPLD.

[0280] The present invention also provides a computer-readable storage medium having a computer program stored thereon. When executed by a processor, the computer program implements the various processes of the above-described case recommendation method embodiment and achieves the same technical effects. To avoid repetition, the details are not described here. The computer-readable storage medium may be, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0281] The present invention also provides a computer program product, comprising computer instructions, which, when executed by a processor, implement the above Figure 1 The various processes of the corresponding case recommendation method implementation examples can achieve the same technical effects, so they will not be repeated here to avoid repetition.

[0282] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.

[0283] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better embodiment. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present invention.

[0284] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are protected by the present invention.

Claims

1. A case recommendation method, characterized in that: include: Receive question information entered by the user; Based on the problem information, a search is performed in a preset database to obtain N target case vectors, where N is a positive integer greater than 1; Performing vectorization processing on the question information to obtain a question vector and a first prompt word corresponding to the question information; Calling a large language model (LLM) to calculate a difference vector between the question vector and each target case vector based on the first prompt word, and converting the difference vector between the question vector and each target case vector into a probability based on an attention algorithm in the LLM; Output case texts corresponding to M target case vectors, where the probabilities of the M target case vectors are higher than the probabilities of the remaining target cases, where M is a positive integer greater than 1.

2. The method according to claim 1, wherein The preset database includes a plurality of initial case vectors. The search is performed in the preset database based on the question information to obtain N target case vectors, including: Calculating a first similarity between the question vector and each initial case vector; The N initial case vectors with the largest first similarities among the multiple initial case vectors are set as the N target case vectors.

3. The method according to claim 2, wherein The calculating a first similarity between the question vector and each initial case vector includes: Calculating a first intermediate similarity between the question vector and the plurality of initial case vectors based on a cosine similarity algorithm; Calculating a second intermediate similarity between the question vector and a plurality of first intermediate case vectors based on a word embedding algorithm, wherein the plurality of first intermediate case vectors are case vectors whose first intermediate similarity is greater than a first set similarity threshold among the plurality of initial case vectors; Calculating the first similarity between the question vector and a plurality of second intermediate case vectors based on a nearest neighbor algorithm, wherein the plurality of second intermediate case vectors are case vectors whose first intermediate similarity is greater than a second set similarity threshold among the plurality of first intermediate case vectors; The step of setting the N initial case vectors having the largest first similarities among the multiple initial case vectors as the N target case vectors includes: The N second intermediate cases with the largest first similarities among the multiple second intermediate case vectors are set as the N target case vectors.

4. The method according to claim 3, wherein The step of setting the N second intermediate cases with the largest first similarities among the plurality of second intermediate case vectors as the N target case vectors includes: Acquiring historical feedback information of the user, wherein the historical feedback information includes at least one of historical ratings, historical preferences, historical personalized information, and historical keywords; filtering the plurality of second intermediate case vectors based on the historical feedback information to obtain a plurality of third intermediate case vectors; The N second intermediate cases with the largest first similarities among the multiple third intermediate case vectors are set as the N target case vectors.

5. The method according to claim 1, wherein The calling of the large language model LLM to calculate a difference vector between the question vector and each target case vector based on the first prompt word includes: Invoking the LLM to calculate the difference vector between the question vector and each target case vector based on the first prompt word and a target learning algorithm in the LLM; The target learning algorithm is obtained as follows: Acquire sample data, where the sample data includes at least one of text data, image data, and video data; Training the initial algorithm based on the text data to obtain a first intermediate algorithm; and / or training the initial algorithm based on the image data to obtain a second intermediate algorithm; and / or training the initial algorithm based on the video data to obtain a third intermediate algorithm; The first intermediate algorithm, the second intermediate algorithm and / or the third intermediate algorithm are integrated to obtain the target learning algorithm.

6. The method according to claim 1, wherein After outputting the case texts corresponding to the M target case vectors, the method further includes: receiving feedback information input by the user; Calculating a second similarity corresponding to each target case vector in the N target case vectors based on the feedback information; Output case texts corresponding to K target case vectors, where the second similarities of the K target case vectors are higher than the probability of the remaining target cases, where K is a positive integer greater than 1.

7. The method according to claim 6, wherein The feedback information includes at least one of a feedback word, a feedback topic, a feedback case, and a feedback score; The calculating, based on the feedback information, a second similarity corresponding to each target case vector in the N target case vectors includes: Calculating a first sub-similarity corresponding to each target case vector in the N target case vectors based on the feedback word; and / or, Calculating a second sub-similarity corresponding to each target case vector in the N target case vectors based on the feedback topic; and / or, Calculating a third sub-similarity corresponding to each target case vector in the N target case vectors based on the feedback case; The first sub-similarity, the second sub-similarity, the third sub-similarity and / or the feedback score are weighted to obtain the second similarity corresponding to each target case vector in the N target case vectors.

8. The method according to claim 7, wherein The calculating, based on the feedback word, a first sub-similarity corresponding to each target case vector in the N target case vectors includes: Obtaining N initial case vectors corresponding to the N target case vectors, where the initial case vectors correspond one-to-one to the target case vectors; Embedding the feedback word into the case text corresponding to the N initial case vectors to obtain N embedded texts; Calculate the intermediate vectors corresponding to the N embedded texts; The similarity between the intermediate vector and the target case vector is calculated to obtain a first sub-similarity corresponding to each target case vector in the N target case vectors.

9. The method according to claim 7, wherein The calculating, based on the feedback topic, a second sub-similarity corresponding to each target case vector in the N target case vectors includes: Calculating a first probability of a question vector corresponding to the question information based on the feedback topic, where the first probability is used to represent the possibility that the question vector belongs to the feedback topic; Calculating a second probability of each target case vector in the N target case vectors based on the feedback topic, where the second probability is used to represent the possibility that the target case vector belongs to the feedback topic; The product of the first probability and the second probability is set as the second sub-similarity corresponding to each target case vector in the N target case vectors.

10. A case recommendation device, characterized in that: include: A first receiving module is used to receive question information input by a user; A retrieval module, configured to search a preset database based on the problem information to obtain N target case vectors, where N is a positive integer greater than 1; a processing module, configured to perform vectorization processing on the question information to obtain a question vector and a first prompt word corresponding to the question information; A calling module is configured to call a large language model (LLM) to calculate a difference vector between the question vector and each target case vector based on the first prompt word, and convert the difference vector between the question vector and each target case vector into a probability based on an attention algorithm in the LLM; The first output module is used to output case texts corresponding to M target case vectors, where the probabilities of the M target case vectors are higher than the probabilities of the remaining target cases, and M is a positive integer greater than 1.

11. An electronic device, characterized in that: Including transceiver and processor, The transceiver is used to receive question information input by the user; The processor is configured to search a preset database based on the problem information to obtain N target case vectors, where N is a positive integer greater than 1; The processor is further configured to perform vectorization processing on the question information to obtain a question vector and a first prompt word corresponding to the question information; The processor is further configured to call a large language model (LLM) to calculate a difference vector between the question vector and each target case vector based on the first prompt word, and convert the difference vector between the question vector and each target case vector into a probability based on an attention algorithm in the LLM; The transceiver is further configured to output case texts corresponding to M target case vectors, where the probabilities of the M target case vectors are higher than the probabilities of the remaining target cases, and M is a positive integer greater than 1.

12. An electronic device, characterized in that: include: A processor, a memory, and a program stored in the memory and executable on the processor, wherein when the program is executed by the processor, the steps of the case recommendation method according to any one of claims 1 to 9 are implemented.

13. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the case recommendation method according to any one of claims 1 to 9.

14. A computer program product, characterized in that The method comprises computer instructions, which, when executed by a processor, implement the steps of the case recommendation method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Knowledge graph enhanced neural machine translation model construction method

    CN116542261A

  • Text matching method and device, electronic equipment and storage medium

    CN118797048A

  • Knowledge question and answer method and device, electronic equipment, product and storage medium

    CN119046420A

  • Historical case retrieval method for interactive legal questions and answers

    CN119046439A

  • Answer acquisition method, computer program product, device and storage medium

    CN119377372A