High-quality entry recommendation method and device, storage medium and electronic equipment

By obtaining all search characters of search entries entered by the user, recalling relevant entries in the target entries library, calculating character correlation and vector correlation, and filtering out high-quality recommended entries at multiple levels, solving the difficulty in filtering in the existing technology The problem of low-quality recommendation entries improves the accuracy of user experience and recommendation results.

CN119311862APending Publication Date: 2025-01-14BEIJING IQIYI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411360666.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-27
Publication Date
2025-01-14

AI Technical Summary

Technical Problem

The prior art is difficult to effectively filter low-quality recommended entries, which has affected the user experience. Existing methods such as search frequency thresholds and regularized matching have problems such as error filtering and limited coverage.

Method used

By obtaining all search characters of search entries entered by the user, recalling relevant entries in the target entries library, calculating character relevance and vector relevance, filtering out high-quality recommended entries at multiple levels and recommending them to users.

Benefits of technology

It improves the accuracy and quality of recommended entries, optimizes the user search experience, effectively filters out low-quality entries, and ensures the accuracy and relevance of recommended results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119311862A_ABST
    Figure CN119311862A_ABST
Patent Text Reader

Abstract

The invention relates to a high-quality entry recommendation method and device, a storage medium and electronic equipment. The method comprises the steps that all search characters of search entries input by a user are obtained, all recommended entries corresponding to each search character are recalled from a target entry library through a recall link, and a first entry set is obtained; calculating the character relevancy between each recommended entry in the first entry set and the search entry, and determining all recommended entries with the character relevancy greater than a first threshold in the first entry set as a second entry set; calculating the vector correlation between each recommended entry in the second entry set and the search entry, and determining all recommended entries with the vector correlation greater than a second threshold in the second entry set as a third entry set; and determining high-quality recommended entries from the third entry set according to the vector relevancy, and recommending the high-quality recommended entries to the user. The technical problem that it is difficult to effectively filter low-quality recommended entries is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of multimedia intelligent processing technology, and in particular to a method, device, storage medium and electronic device for recommending high-quality entries. Background Art

[0002] On current video websites, users enter a small number of keywords (tokens) through the search query portal to find the video content they want to watch. After the user enters the keyword, the system will retrieve a list of related recommended words (queries) from the recall source (corpus). For example, when the user enters "genius", the system may recommend "genius shooter", "genius bespectacled dog", "genius basic law" and other related content. In order to cope with the search needs of massive users, video websites need to build a huge vocabulary (corpus), in which the number of entries usually reaches millions. The current vocabulary is mainly composed of two parts: the first part is the high-quality entries of the resources on the site, such as PPC (Professional Produced Content, long videos), celebrities, characters and other high-quality entries; the second part is the entries that users actively search and input. The first part is high-quality entries, which are of high quality and can accurately reflect user needs. However, the quality of entries actively entered by users varies, and often contain some low-quality entries with grammatical errors or spelling errors. For example, entries such as "A TV series 2" or "The basic rules of genius" may be caused by problems with the user's input method. These low-quality entries are mistakenly recommended to users by the click-through rate prediction model due to the high frequency of searches, thus wasting precious exposure opportunities. At present, there are two main ways to judge the quality of entries in the vocabulary: one is based on search There are two methods, one is to use the search frequency threshold method, that is, if the number of searches for a query in a specific time period (such as within half a year) is lower than the threshold, it will be filtered out; the other is to use a large number of regularized templates or rules to filter out low-quality queries through regularized matching. However, both methods have limitations. The search frequency threshold method may mistakenly filter out some low-frequency but high-quality terms, while the coverage of regularized templates and rules is limited, and it is easy to mistakenly process some high-quality terms as low-quality terms. In addition, the regularization method does not work well for ever-changing low-quality terms. Overall, it is difficult for existing methods to effectively filter low-quality queries, resulting in a poor user experience. Summary of the invention

[0003] The present application provides a method, device, storage medium and electronic device for recommending high-quality terms to solve the technical problem of difficulty in effectively filtering low-quality recommended terms.

[0004] In a first aspect, the present application provides a method for recommending high-quality terms, comprising: obtaining all search characters of a search term input by a user, and recalling all recommended terms corresponding to each of the above search characters from a target term library through a recall link to obtain a first term set; calculating the character relevance between each recommended term in the above first term set and the above search term, and determining all recommended terms in the above first term set whose character relevance is greater than a first threshold as a second term set; calculating the vector relevance between each recommended term in the above second term set and the above search term, and determining all recommended terms in the above second term set whose vector relevance is greater than a second threshold as a third term set; determining high-quality recommended terms from the above third term set according to the above vector relevance, and recommending the above high-quality recommended terms to the above user.

[0005] In a second aspect, the present application provides a device for recommending high-quality terms, including: an acquisition module, used to acquire all search characters of a search term input by a user, and recall all recommended terms corresponding to each of the above search characters from a target term library through a recall link to obtain a first term set; a first calculation module, used to calculate the character relevance between each recommended term in the above first term set and the above search term, and determine all recommended terms in the above first term set whose character relevance is greater than a first threshold as a second term set; a second calculation module, used to calculate the vector relevance between each recommended term in the above second term set and the above search term, and determine all recommended terms in the above second term set whose vector relevance is greater than a second threshold as a third term set; a determination module, used to determine high-quality recommended terms from the above third term set according to the above vector relevance, and recommend the above high-quality recommended terms to the above user.

[0006] As an optional example, the above-mentioned device also includes: a processing module, which is used to obtain all search characters of the search term input by the user, and recall all recommended terms corresponding to each of the above search characters from the target term library through a recall link, before obtaining the first term set, taking each recommended term in the above-mentioned target term library as the current recommended term, and performing the following operations on the above-mentioned current recommended term: obtaining all recommended characters of the above-mentioned current recommended term; and constructing a recall link from each of the above-mentioned recommended characters to the above-mentioned current recommended term.

[0007] As an optional example, the first calculation module includes: a first processing unit, used to take each recommended term in the first term set as the current recommended term, and perform the following operations on the current recommended term: obtain a first number of characters shared by the current recommended term and the search term; obtain a second number of all unique characters in the current recommended term and the search term; calculate the quotient of the first number and the second number to obtain the character relevance between the current recommended term and the search term.

[0008] As an optional example, the second calculation module includes: a second processing unit, used to take each recommended term in the second term set as the current recommended term, and perform the following operations on the current recommended term: obtain the first vector of the current recommended term; obtain the second vector of the search term; calculate the cosine similarity between the first vector and the second vector, and obtain the vector correlation between the current recommended term and the search term.

[0009] As an optional example, the above-mentioned determination module includes: a sorting unit, used to sort all recommended terms in the above-mentioned third term set from large to small according to the vector relevance with the above-mentioned search terms, to obtain a sorted fourth term set; a determination unit, used to determine the first target number of recommended terms in the above-mentioned fourth term set as the above-mentioned high-quality recommended terms.

[0010] As an optional example, the above-mentioned device also includes: a first construction module, which is used to obtain all search characters of the search terms input by the user, and recall all recommended terms corresponding to each of the above search characters from the target term library through a recall link to obtain a first term set, and then construct an initial term library, wherein the above-mentioned initial term library includes multiple search terms input by multiple users; a recognition module, which is used to input each term in the above-mentioned initial term library into the target large language model, identify grammatical problems of each term in the above-mentioned initial term library, and obtain recognition results of each term in the above-mentioned initial term library; a deletion module, which is used to delete the target term in the above-mentioned initial term library to obtain the above-mentioned target term library, wherein the recognition result of the above-mentioned target term is that there is a grammatical problem.

[0011] As an optional example, the above-mentioned device also includes: a second construction module, used to construct training data and verification data according to the above-mentioned initial word library before inputting each entry in the above-mentioned initial word library into the target large language model; an input module, used to input the above-mentioned training data into the initial large language model to obtain the result data of the above-mentioned training data; a third calculation module, used to use a loss function to calculate the difference between the above-mentioned result data and the above-mentioned verification data to obtain a loss value; a fourth calculation module, used to adjust the model parameters of the above-mentioned initial large language model according to the above-mentioned loss value, and recalculate the above-mentioned loss value until the recalculated above-mentioned loss value is less than the target threshold value, so as to obtain the above-mentioned target large language model.

[0012] In a third aspect, the present application provides a storage medium storing a computer program, wherein the computer program executes the above-mentioned method for recommending high-quality terms when executed by a processor.

[0013] In a fourth aspect, the present application further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the above-mentioned method for recommending high-quality terms through the computer program.

[0014] In the embodiment of the present application, a method is adopted in which all search characters of the search terms input by the user are obtained, and all recommended terms corresponding to each of the above search characters are recalled from the target term library through a recall link to obtain a first term set; the character relevance between each recommended term in the above first term set and the above search terms is calculated, and all recommended terms in the above first term set whose character relevance is greater than a first threshold are determined as a second term set; the vector relevance between each recommended term in the above second term set and the above search terms is calculated, and all recommended terms in the above second term set whose vector relevance is greater than a second threshold are determined as a third term set; high-quality recommended terms are determined from the above third term set according to the above vector relevance, and the above high-quality recommended terms are recommended to the above user. In the above method, the search terms input by the user are split into characters, and all recommended terms matching these characters are retrieved from the term library to form a first term set. Then, the character relevance between each term and the search terms is calculated, and terms with relevance higher than the first threshold are screened out to form a second term set. Then, the vector correlation between each term in the second term set and the search term is calculated, and the terms with correlation higher than the second threshold are screened out to form a third term set. Finally, the recommended terms in the third term set are sorted according to the vector correlation, and the most relevant high-quality terms are recommended to the user. This achieves the purpose of improving the accuracy and quality of recommended terms by multi-level screening and optimizing the user search experience, thereby solving the technical problem of the difficulty in effectively filtering low-quality recommended terms. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0016] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0017] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0018] Figure 1 is a flowchart of an optional method for recommending high-quality terms according to an embodiment of the present application;

[0019] Figure 2 is a schematic structural diagram of an optional high-quality entry recommendation device according to an embodiment of the present application;

[0020] Figure 3 is a schematic diagram of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0021] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are 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 this application.

[0022] The disclosure below provides many different embodiments or examples to realize the different structures of the present application. In order to simplify the disclosure of the present application, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present application. In addition, the present application can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.

[0023] According to a first aspect of an embodiment of the present application, a method for recommending high-quality terms is provided. Optionally, as follows: Figure 1 As shown, the above method includes:

[0024] S102, obtaining all search characters of the search term input by the user, and recalling all recommended terms corresponding to each search character from the target term library through a recall link to obtain a first term set;

[0025] S104, calculating the character relevance between each recommended term in the first term set and the search term, and determining all recommended terms in the first term set whose character relevance is greater than a first threshold as the second term set;

[0026] S106, calculating the vector correlation between each recommended term in the second term set and the search term, and determining all recommended terms in the second term set whose vector correlation is greater than a second threshold as the third term set;

[0027] S108, determining high-quality recommended terms from the third term set according to the vector relevance, and recommending the high-quality recommended terms to the user.

[0028] Optionally, in this embodiment, all the search characters of the search term input by the user are obtained. After the user inputs a search term, the term is split into single characters or combinations of multiple characters. For example, when the user inputs "Genius Gunman", characters such as "天", "才", "枪", "手" are extracted to maximize the possible recall results and ensure that no recommended terms that partially match the search term are missed. According to the extracted search characters, all recommended terms that match these characters are recalled from the pre-constructed target term library to form the first term set. This set contains a large number of recommended terms related to the search term, and each character corresponds to multiple terms. Next, the character similarity between each recommended term in the first term set and the user's search term is calculated. The character relevance measures the matching degree between the recommended term and the search term at the character level. For example, the recalled list of terms (the first term set) is [Genius Gunman, Tian Long Ba Bu, A Love So Beautiful, Day Day Up]. Among them, the character relevance between "Genius Gunman" and "Genius Gunman" is relatively high because they share the character combination "Genius Gunman". The recommended terms with a character relevance greater than the first threshold are included in the second term set to ensure that only the recommended terms that highly match the user's search term in characters are retained. The vector relevance is obtained by converting the terms into vector representations and measuring their similarity in the vector space. Compared with the character relevance, the vector relevance takes into account the semantic information and context of the terms. For example, the character relevance between "Genius Gunman" and "A Love So Beautiful" may be low, but they may be semantically similar. At this stage, the vector relevance between each recommended term and the search term is calculated, and the recommended terms with a vector relevance greater than the second threshold are filtered out to form the third term set. Finally, the recommended terms in the third term set are sorted according to the vector relevance, and the high-quality recommended terms that are most relevant to the user's search term are selected and recommended to the user to ensure that the recommended terms the user sees not only match in characters but also are highly relevant semantically, thereby improving the user's search experience.

[0029] Optionally, in this embodiment, through multi-level screening (character relevance and vector relevance), the intention of the user's search term can be captured more accurately. As a result, when the user searches, more accurate and relevant recommended terms will be obtained, reducing the occurrence of irrelevant or low-quality terms and improving the efficiency and satisfaction of the search. By setting the character relevance and vector relevance, terms with low quality, spelling mistakes, or grammar problems can be effectively filtered out, ensuring the quality of the recommended results, and thus solving the technical problem of being difficult to effectively filter out low-quality recommended terms.

[0030] As an optional example, before obtaining all the search characters of the search term input by the user and recalling all the recommended terms corresponding to each search character from the target term library through the recall link to obtain the first term set, the above method further includes:

[0031] Take each recommended term in the target term library as the current recommended term and perform the following operations on the current recommended term:

[0032] Get all recommended characters for the current recommended entry;

[0033] Construct a recall link from each recommended character to the current recommended term.

[0034] Optionally, in this embodiment, high-quality entries are extracted from the target entry library, such as PPC, stars, roles, etc., and each character (char) in these entries is established with the entire entry (query) to establish a recall link. For example, for the entry "Genius Gunner", the following recall link is created: {day->Genius Gunner}, {talent->Genius Gunner}, {gun->Genius Gunner}, {hand->Genius Gunner}, so that a recall source (recaller) of "char->query" is formed, which is used to quickly recall related entries according to the input characters. In this way, when the user searches for "Genius Gunner", it is decomposed into characters: day, talent, gun, hand, and the recall link is used to find the high-quality entries containing these characters, for example, the possible recall results are "Genius Gunner", "Tianlong Babu", "Genius Basic Law", "Day Day Up", etc. By establishing a recall link, it is possible to effectively recall the high-quality entries related to the user input from the original entry library, thereby improving the accuracy and relevance of the search.

[0035] As an optional example, calculating the character relevance between each recommended term in the first term set and the search term includes:

[0036] Take each recommended term in the first term set as the current recommended term, and perform the following operations on the current recommended term:

[0037] Get the first number of characters that the current recommended term and the search term have in common;

[0038] Get a second number of all unique characters in the current recommended term and the search term;

[0039] The quotient of the first quantity and the second quantity is calculated to obtain the character relevance between the current recommended term and the search term.

[0040] Optionally, in this embodiment, when calculating the character relevance between each recommended entry in the first entry set and the search entry, taking a certain recommended entry as an example, the common characters between the recommended entry and the search entry are determined, and the number of these common characters is calculated. For example, if the search entry is "Genius Gunman" and the recommended entry is "The Fundamental Theorem of Genius", the common characters include "天" and "才", so the first quantity is 2. Determine the number of all unique characters in the recommended entry and the search entry, that is, calculate the number of all different characters in the two entries. For the above example, the set of unique characters of the search entry may be: {天, 才, 枪, 手}, and the set of unique characters of the recommended entry may be: {天, 才, 基, 本, 法, 则}, so the union of the unique characters of the two is: {天, 才, 基, 本, 法, 则, 枪, 手}, and the size of the union is 8. Therefore, the second quantity is 8. Divide the first quantity by the second quantity to obtain the character relevance, and the character relevance = first quantity / second quantity. In this example, the character relevance is character relevance = 2 / 8 = 0.25. This calculation method provides a similarity index of the recommended entry and the search entry at the character level, and the higher the value, the higher the character matching degree of the two entries.

[0041] As an optional example, calculating the vector relevance between each recommended entry in the second entry set and the search entry includes:

[0042] Taking each recommended entry in the second entry set as the current recommended entry, perform the following operations on the current recommended entry:

[0043] Obtain the first vector of the current recommended entry;

[0044] Obtain the second vector of the search entry;

[0045] Calculate the cosine similarity of the first vector and the second vector to obtain the vector relevance between the current recommended entry and the search entry.

[0046] Optionally, in this embodiment, when calculating the vector relevance between each recommended term and the search term in the second term set, taking a certain recommended term as an example, using the Embedding word embedding technology, the recommended term and the search term are converted into a vector representation, and the first vector embed_1 and the second vector embed_2 are obtained respectively. The Embedding word embedding technology is a technology that maps high-dimensional or discrete data to a low-dimensional, continuous vector space, thereby capturing the semantic relationship between words, sentences, and documents. Through the Embedding word embedding technology, words, sentences, or documents can be represented as continuous vectors that capture the semantic and grammatical information in the original data, and then the relationship between words can be evaluated by calculating the similarity between these vectors. Cosine similarity is used to measure the similarity between two vectors, and the formula is as follows: cosine similarity = cosine (embed_1, embed_2), the value range of cosine similarity is (-1, 1), and the closer the value is to 1, the higher the similarity between the two vectors, that is, the more semantically related the recommended term is to the search term.

[0047] As an optional example, determining high-quality recommended terms from the third term set according to the vector relevance includes:

[0048] Sorting all the recommended terms in the third term set from large to small according to their vector relevance to the search term, to obtain a sorted fourth term set;

[0049] The first target number of recommended terms in the fourth term set is determined as high-quality recommended terms.

[0050] Optionally, in this embodiment, when determining high-quality recommended terms from the third term set, all recommended terms in the third term set are sorted from large to small according to the vector relevance calculated to obtain a sorted fourth term set. From the sorted fourth term set, the first target number of recommended terms are selected, and these recommended terms are determined as high-quality recommended terms. For example, if the target number is 10, the first 10 recommended terms are selected as high-quality recommended terms, and these terms are displayed to the user.

[0051] As an optional example, before obtaining all search characters of the search term input by the user and recalling all recommended terms corresponding to each search character from the target term library through the recall link to obtain the first term set, the method further includes:

[0052] Building an initial term library, wherein the initial term library includes a plurality of search terms input by a plurality of users;

[0053] Input each word in the initial word library into the target large language model, identify the grammatical problem of each word in the initial word library, and obtain the recognition result of each word in the initial word library;

[0054] The target term in the initial term library is deleted to obtain a target term library, wherein the recognition result of the target term is that there is a grammatical problem.

[0055] Optionally, in this embodiment, multiple search terms are collected from the user's search history, and an initial term library is constructed based on the high-quality terms of the system database. This library contains a variety of search terms entered by the user, which may have grammatical errors. Each term in the initial term library is input into the target large language model in turn. The target large language model has been trained and can accurately identify and judge grammatical problems in the terms. The model performs grammatical analysis on each input term and gives the recognition result of the term. The recognition result will indicate whether the term has grammatical problems and the specific type of grammatical errors (such as redundant words, wrong words, missing words, etc.). In the recognition result, find out those terms that are judged by the model to have grammatical problems, and mark these terms as target terms. Delete these target terms with grammatical problems from the initial term library, so as to obtain a streamlined target term library. The target term library finally obtained only contains those high-quality terms that are recognized by the model as having no grammatical problems, and the target term library will be more suitable for use in scenarios such as recommendation and search. With its powerful text understanding and processing capabilities, the large language model can not only effectively identify and correct grammatical problems in entries, but also achieve efficient quality assessment under limited supervised data conditions.

[0056] As an optional example, before inputting each word in the initial word library into the target large language model, the method further includes:

[0057] Based on the initial entry library, construct training data and verification data;

[0058] Input the training data into the initial large language model to obtain result data of the training data;

[0059] Use the loss function to calculate the difference between the result data and the verification data to get the loss value;

[0060] The model parameters of the initial large language model are adjusted according to the loss value, and the loss value is recalculated until the recalculated loss value is less than the target threshold, thereby obtaining the target large language model.

[0061] Optionally, in this embodiment, in order to improve the success rate of the large language model under a specific task, a supervised training data set is constructed, and the large language model is optimized in the field by fine-tuning the instructions. To construct the training data, 10,000 search terms can be randomly selected from the initial term library as training data, and the initial term library contains search terms of tens of millions of users. The grammatical problems of the terms are summarized into 6 categories of problems: no grammatical problems (basic rules of genius), redundant words (basic rules of genius), missing words (basic rules of genius), wrong words (basic rules of genius), mixed pinyin words (basic rules of tiancai), and mixed numbers (basic rules of genius 1234). The grammatical problems of the training data are marked, and all grammatical problems are covered in the training data to obtain verification data. Input the training data into the initial large language model. The large language model (LLM) is a model based on natural language processing (NLP). This type of model has the ability to understand and generate text. Its goal is to understand and generate natural language text. Large language models usually have billions to tens of billions of parameters. These parameters are pre-trained with massive text data to capture complex patterns and semantics in the language. The initial large language model processes the input data and generates corresponding prediction results. These result data include the prediction classification of each input sample by the initial large language model. Use an appropriate loss function (such as cross entropy loss) to calculate the difference between the prediction results of the initial large language model and the validation data. The loss function measures the degree of difference between the model prediction and the true label. The smaller the loss value, the closer the prediction of the large language model is to the true label. The initial loss value is calculated by comparing the validation data with the model prediction results. Use SFT (Supervised Fine-Tuning) to fine-tune some parameters of the large language model based on the loss value to minimize the loss value. SFT refers to fine-tuning the model with labeled data based on the pre-trained model to adapt it to a specific task. Supervised fine-tuning is the process of further training based on a pre-trained model. The model is usually first pre-trained on large-scale unlabeled text data to learn general language representations. After this, the model is fine-tuned using labeled datasets for specific tasks to perform better on specific tasks. The training data is repeatedly input into the large language model, the loss value is calculated, and the parameters are adjusted. After each training cycle, the loss value is recalculated using the validation data. A target loss threshold is set, and training is stopped when the loss value drops below the threshold, or when the training cycle reaches a certain number of times. When the recalculated loss value is less than the target threshold, or the training cycle reaches a certain number of times, the model is considered to have converged and the training is completed. The model obtained at this time is the target large language model.

[0062] Optionally, in the above embodiment, the construction of RAG information is implemented by using a RAG model, and supervised training data is constructed based on the RAG information to train the large language model. Specifically, the RAG (Retrieval-Augmented Generation) model is a technology that combines information retrieval and generative models to improve the effect of natural language generation tasks. The RAG model is mainly used to generate more accurate and content-rich texts, especially in scenarios where complex questions are answered or external knowledge is required. The core of the RAG model is to combine two technologies together: Retrieval Model: First, it retrieves the documents or fragments most relevant to the input question from a pre-built document library. Generation Model: Next, the generation model uses the retrieved documents as context input and generates a response based on this information. This approach enables the generation model to utilize a wider knowledge base, rather than relying solely on its internal pre-trained knowledge. The RAG model improves the accuracy and practicality of large language model generation tasks through three key parts: retrieval, utilization, and generation. In the retrieval phase, the system retrieves the entities most relevant to the input term from a predefined pool of terms, including the title of the play, the name of the actor, and the name of the character. These terms are carefully selected to ensure that they are grammatically correct and have entity meaning. For example, when processing an input term "the basic law of genius", the relevant entities are first retrieved from the content pool. Retrieval techniques include character similarity and correlation analysis of embedding vectors, in this way, highly relevant entity words such as "the basic law of genius" can be screened out from the pool as retrieval results. In the utilization phase, the retrieved relevant entities are used to construct a prompt to guide the generation model on how to process the input term. For example, the constructed prompt may be: "I have an entry, which may contain grammatical problems such as extra words, missing words, and typos. Please judge whether the given entry contains grammatical problems based on the reference entity words. The entry is "Basic Rule of Genius", and the reference high-quality entry entity is "Basic Law of Genius". Through such a prompt, the generation model can better understand the relationship between the input entry and the reference entity, and then judge the grammatical problem. The key to this step is to use the retrieved high-quality entities to enhance the contextual understanding of the generation model so that it can make more accurate judgments. In the generation stage, the constructed prompt will be input into the large language model. With the reference information provided in the retrieval stage, the model can generate more accurate answers based on the context. For example, in the above example, the model may generate the following answer: "The entry 'Basic Rule of Genius' contains multi-word problems." In this way, the RAG model effectively combines information retrieval and generation technology, and uses the retrieved high-quality entities to improve the accuracy and reliability of the generated results.

[0063] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0064] According to another aspect of the embodiment of the present application, a device for recommending high-quality terms is also provided. Figure 2 As shown, including:

[0065] The acquisition module 202 is used to acquire all search characters of the search term input by the user, and recall all recommended terms corresponding to each search character from the target term library through a recall link to obtain a first term set;

[0066] A first calculation module 204, configured to calculate a character relevance between each recommended term in the first term set and the search term, and determine all recommended terms in the first term set whose character relevance is greater than a first threshold as a second term set;

[0067] A second calculation module 206, configured to calculate a vector correlation between each recommended term in the second term set and the search term, and determine all recommended terms in the second term set whose vector correlation is greater than a second threshold as a third term set;

[0068] The determination module 208 is used to determine high-quality recommended terms from the third term set according to the vector relevance, and recommend the high-quality recommended terms to the user.

[0069] It should be noted that the acquisition module 202 in this embodiment can be used to execute step S102 in the embodiment of the present application, the first calculation module 204 in this embodiment can be used to execute step S104 in the embodiment of the present application, the second calculation module 206 in this embodiment can be used to execute step S106 in the embodiment of the present application, and the determination module 208 in this embodiment can be used to execute step S108 in the embodiment of the present application.

[0070] As an optional example, the above device further includes:

[0071] The processing module is used to obtain all search characters of the search term input by the user, and recall all recommended terms corresponding to each search character from the target term library through the recall link, and before obtaining the first term set, take each recommended term in the target term library as the current recommended term, and perform the following operations on the current recommended term:

[0072] Get all recommended characters for the current recommended entry;

[0073] Construct a recall link from each recommended character to the current recommended term.

[0074] As an optional example, the first calculation module includes:

[0075] The first processing unit is configured to use each recommended term in the first term set as a current recommended term and perform the following operations on the current recommended term:

[0076] Get the first number of characters that the current recommended term and the search term have in common;

[0077] Get a second number of all unique characters in the current recommended term and the search term;

[0078] The quotient of the first quantity and the second quantity is calculated to obtain the character relevance between the current recommended term and the search term.

[0079] As an optional example, the second calculation module includes:

[0080] The second processing unit is configured to use each recommended term in the second term set as a current recommended term and perform the following operations on the current recommended term:

[0081] Get the first vector of the current recommended term; get the second vector of the search term;

[0082] The cosine similarity between the first vector and the second vector is calculated to obtain the vector correlation between the current recommended term and the search term.

[0083] As an optional example, the determination module includes:

[0084] A sorting unit, used to sort all the recommended terms in the third term set from large to small according to the vector relevance with the search term, to obtain a sorted fourth term set;

[0085] The determination unit is used to determine the first target number of recommended terms in the fourth term set as high-quality recommended terms.

[0086] As an optional example, the above device further includes:

[0087] A first building module is used to build an initial term library before obtaining all search characters of a search term input by a user and recalling all recommended terms corresponding to each search character from a target term library through a recall link to obtain a first term set, wherein the initial term library includes multiple search terms input by multiple users;

[0088] A recognition module, used for inputting each entry in the initial entry library into the target large language model, identifying the grammatical problem of each entry in the initial entry library, and obtaining the recognition result of each entry in the initial entry library;

[0089] The deletion module is used to delete the target term in the initial term library to obtain the target term library, wherein the recognition result of the target term is that there is a grammatical problem.

[0090] As an optional example, the above device further includes:

[0091] A second construction module is used to construct training data and verification data according to the initial word library before each word in the initial word library is input into the target large language model;

[0092] An input module, used to input the training data into the initial large language model to obtain result data of the training data;

[0093] A third calculation module is used to calculate the difference between the result data and the verification data using a loss function to obtain a loss value;

[0094] The fourth calculation module is used to adjust the model parameters of the initial large language model according to the loss value, and recalculate the loss value until the recalculated loss value is less than the target threshold, so as to obtain the target large language model.

[0095] For other examples of this embodiment, please refer to the above examples and will not be repeated here.

[0096] Figure 3 is a schematic diagram of an optional electronic device according to an embodiment of the present application, such as Figure 3 As shown, it includes a processor 302, a communication interface 304, a memory 306 and a communication bus 308, wherein the processor 302, the communication interface 304 and the memory 306 communicate with each other through the communication bus 308, wherein,

[0097] Memory 306, used for storing computer programs;

[0098] The processor 302 is used to implement the following steps when executing the computer program stored in the memory 306:

[0099] Obtain all search characters of the search term input by the user, and recall all recommended terms corresponding to each search character from the target term library through a recall link to obtain a first term set;

[0100] Calculating the character relevance between each recommended term in the first term set and the search term, and determining all recommended terms in the first term set whose character relevance is greater than a first threshold as the second term set;

[0101] Calculating the vector correlation between each recommended term in the second term set and the search term, and determining all recommended terms in the second term set whose vector correlation is greater than a second threshold as the third term set;

[0102] High-quality recommended terms are determined from the third term set according to the vector relevance, and the high-quality recommended terms are recommended to the user.

[0103] Optionally, in this embodiment, the communication bus may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 The communication interface is used for communication between the above electronic device and other devices.

[0104] The memory may include RAM, or may include non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0105] As an example, the memory 306 may include, but is not limited to, the acquisition module 202, the first calculation module 204, the second calculation module 206, and the determination module 208 in the high-quality term recommendation device. In addition, it may also include, but is not limited to, other module units in the high-quality term recommendation device, which will not be described in detail in this example.

[0106] The above-mentioned processor can be a general-purpose processor, which can include but not be limited to: CPU (Central Processing Unit), NP (Network Processor), etc.; it can also be DSP (Digital Signal Processing), ASIC (Application Specific Integrated Circuit), FPGA (Field-Programmable Gate Array) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0107] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment will not be described in detail here.

[0108] It can be understood by those skilled in the art that Figure 3 The structure shown is for illustration only. The device for implementing the above-mentioned method for recommending high-quality entries may be a terminal device, which may be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (Mobile Internet Devices, MID), a PAD, and other terminal devices. Figure 3 The structure of the electronic device is not limited. For example, the electronic device may also include Figure 3 More or fewer components (such as network interfaces, display devices, etc.) shown in, or having Figure 3 Different configurations shown.

[0109] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, which can include: a flash drive, ROM, RAM, a magnetic disk or an optical disk, etc.

[0110] According to another aspect of the embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program executes the steps in the above-mentioned method for recommending high-quality terms when executed by a processor.

[0111] Optionally, in this embodiment, a person of ordinary skill in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing hardware related to the terminal device through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.

[0112] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0113] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which may be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.

[0114] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0115] In the several embodiments provided in the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0116] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0117] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0118] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A method for recommending high-quality terms, characterized in that: include: Acquire all search characters of the search term input by the user, and recall all recommended terms corresponding to each of the search characters from the target term library through a recall link to obtain a first term set; Calculating the character relevance between each recommended term in the first term set and the search term, and determining all recommended terms in the first term set whose character relevance is greater than a first threshold as a second term set; Calculating the vector correlation between each recommended term in the second term set and the search term, and determining all recommended terms in the second term set whose vector correlation is greater than a second threshold as a third term set; Determine high-quality recommended terms from the third term set according to the vector relevance, and recommend the high-quality recommended terms to the user.

2. The method according to claim 1, characterized in that: Before obtaining all search characters of the search terms input by the user and recalling all recommended terms corresponding to each of the search characters from the target term library through a recall link to obtain the first term set, the method further includes: Take each recommended term in the target term library as the current recommended term, and perform the following operations on the current recommended term: Obtain all recommended characters of the current recommended entry; Construct a recall link from each of the recommended characters to the current recommended term.

3. The method according to claim 1, characterized in that The calculating of the character relevance between each recommended term in the first term set and the search term comprises: Take each recommended term in the first term set as a current recommended term, and perform the following operations on the current recommended term: Obtaining a first number of characters shared by the current recommended term and the search term; Obtain a second number of all unique characters in the current recommended term and the search term; The quotient of the first number and the second number is calculated to obtain the character relevance between the current recommended term and the search term.

4. The method according to claim 1, characterized in that: The calculating of the vector relevance between each recommended term in the second term set and the search term comprises: Take each recommended term in the second term set as a current recommended term, and perform the following operations on the current recommended term: Obtaining a first vector of the current recommended term; Obtaining a second vector of the search term; The cosine similarity between the first vector and the second vector is calculated to obtain the vector correlation between the current recommended term and the search term.

5. The method according to claim 1, characterized in that Determining high-quality recommended terms from the third term set according to the vector relevance includes: Sorting all the recommended terms in the third term set from large to small according to the vector relevance to the search term, to obtain a sorted fourth term set; The first target number of recommended terms in the fourth term set is determined as the high-quality recommended terms.

6. The method according to claim 1, characterized in that Before obtaining all search characters of the search terms input by the user and recalling all recommended terms corresponding to each of the search characters from the target term library through a recall link to obtain the first term set, the method further includes: Constructing an initial term library, wherein the initial term library includes a plurality of search terms input by a plurality of users; Inputting each entry in the initial entry library into the target large language model, identifying grammatical problems of each entry in the initial entry library, and obtaining recognition results of each entry in the initial entry library; The target term in the initial term library is deleted to obtain the target term library, wherein the recognition result of the target term is that there is a grammatical problem.

7. The method according to claim 6, characterized in that Before inputting each word in the initial word library into the target large language model, the method further includes: Constructing training data and verification data according to the initial word library; Inputting the training data into an initial large language model to obtain result data of the training data; Using a loss function to calculate the difference between the result data and the verification data, to obtain a loss value; The model parameters of the initial large language model are adjusted according to the loss value, and the loss value is recalculated until the recalculated loss value is less than a target threshold, thereby obtaining the target large language model.

8. A device for recommending high-quality entries, characterized in that: include: An acquisition module, configured to acquire all search characters of a search term input by a user, and recall all recommended terms corresponding to each of the search characters from a target term library through a recall link to obtain a first term set; A first calculation module, configured to calculate a character relevance between each recommended term in the first term set and the search term, and determine all recommended terms in the first term set whose character relevance is greater than a first threshold as a second term set; A second calculation module, configured to calculate a vector correlation between each recommended term in the second term set and the search term, and determine all recommended terms in the second term set whose vector correlation is greater than a second threshold as a third term set; A determination module is used to determine high-quality recommended terms from the third term set according to the vector relevance, and recommend the high-quality recommended terms to the user.

9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is executed.

10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 7 through the computer program.