Information recommendation method based on large model role switching
By constructing a role-switching mechanism and disabling a set of switching modes, the problem of unnatural information recommendation in large models was solved, and information responses that are closer to natural language were achieved, improving user experience and information conversion rate.
Patent Information
- Application Number
- CN202410917835.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-10
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2044-07-10
AI Technical Summary
Existing large-scale models, when recommending information, directly add supplementary information, resulting in a poor user experience and information that is too rigid.
By constructing first and second role prompt word sequence sets, detecting identifier characters in the output of the large model, switching roles in the large model based on role identifiers, controlling the naturalness of information recommendation, and combining the disabled switching set and the association relationship of role identifiers, a more natural language-like information response is achieved.
This improves the user experience, ensuring that information recommendations are more closely aligned with the user's role and natural language, reducing user aversion, and enhancing information conversion rates.
Smart Images

Figure CN118916474B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data large model, and particularly relates to an information recommendation method based on large model role switching. BACKGROUND
[0002] The existing data large model can answer according to the user input, and the role of the large model can be preset, so that the input of the user can be replied in a targeted manner. The provider of the large model also hopes to provide recommended additional information to the user, so as to promote the communication between the provider and the user. At present, the general method is to detect the output of the large model, and then add and supplement the additional information, but the information provided to the user will be very harsh, which is easy to cause the user to be disgusted and affect the user experience. SUMMARY
[0003] Therefore, it is necessary to provide an information recommendation method based on large model role switching to solve the problem of poor information experience in the existing information recommendation.
[0004] To achieve the above purpose, the present application provides an information recommendation method based on large model role switching, comprising the following steps:
[0005] A context prompt word sequence set for the large model is constructed, the prompt word sequence set contains a first role prompt word and a second role prompt word, and the prompt word sequence set is input into the large model;
[0006] The initial role flag of the large model is set as the first role, the associated information, the warning information and the corresponding identification bit character of the large model are set, and the large model is used to add the identification bit character in the result and output the associated information after detecting the warning information;
[0007] The input text of the user end is obtained, and the input text is sent to the large model with the currently set role flag and the returned result is obtained;
[0008] Whether the currently set role flag and the returned result contain the identification bit character is detected;
[0009] If the currently set role flag is the first role and the returned result does not contain the identification bit character, the returned result is sent to the user end;
[0010] If the currently set role flag is the first role and the returned result contains the identification bit character, the set role flag is switched to the second role, the input text of the user containing the second role is modified and sent to the large model to obtain the returned result, and the returned result is sent to the user end after removing the identification bit character;
[0011] If the currently set role flag is the second role and the return result does not contain the identification bit character, switch the set role flag to the first role, modify the input text of the user to contain the first role, send it to the large model and obtain the return result, and send the return result after removing the identification bit character to the user terminal;
[0012] If the currently set role flag is the second role and the return result contains the identification bit character, send the return result after removing the identification bit character to the user terminal.
[0013] Further, it also includes constructing a disabled switching set, setting the disabled switching set and the corresponding disabled identifier of the large model, and further including the step of detecting the disabled identifier after obtaining the return result. If the disabled identifier is detected in the return result, switch the currently set role flag to the first role and prohibit role switching. Subsequently, the currently set role flag and the return result are no longer detected whether they contain the identification bit character. Only the return result after removing the identification bit character and the disabled identifier is sent to the user terminal. If the disabled identifier is not contained, the currently set role flag and the return result are detected whether they contain the identification bit character.
[0014] Further, an association relationship between the client and the set role flag is established. Different clients contain corresponding set role flags.
[0015] Further, an association relationship between the user login ID and the set role flag is established. Different user login IDs contain corresponding set role flags.
[0016] Further, the construction of the context prompt word sequence set for the large model includes the steps of:
[0017] The original text is input into the large model for summarization to obtain the prompt word sequence set.
[0018] Further, the original text is obtained by optical character recognition to obtain the text in the image.
[0019] Further, the input text of the user terminal includes obtaining the input picture of the user terminal, and obtaining the text in the input picture by optical character recognition.
[0020] Further, the association information is recommended product information.
[0021] Further, the recommended product information includes the ID, name and function introduction of the recommended product.
[0022] Further, the large model is a large language model.
[0023] Distinguished from the prior art, the technical scheme can have different role prompts through the first role prompt word and the second role prompt word. Then the large model can detect the input of the user and mark the result. The application can detect the marked result and control whether to switch to the second role. The large model returns the answer according to the second role to the user. Such reply information is replied by the large model, so that the large model outputs an answer containing associated information, and replies by the second role. The content of the reply is closer to the role, so that the way of directly adding associated information is avoided, the large model replies more close to natural language, and user experience is improved. BRIEF DESCRIPTION OF DRAWINGS
[0024] Fig. 1 Method flowchart of an embodiment of the application;
[0025] Fig. 2 Method flowchart of another embodiment of the application. DETAILED DESCRIPTION
[0026] To describe the technical content, structural features, purposes and effects of the technical scheme in detail, the following will be described in detail in combination with specific embodiments and the accompanying drawings.
[0027] In this paper, the term "embodiment" means that the specific features, structures or characteristics described in combination with the embodiment can be included in at least one embodiment of the application. The term "embodiment" appearing at various positions in the specification does not necessarily refer to the same embodiment, and does not particularly limit the independence or association between other embodiments. In principle, in this application, as long as there is no technical contradiction or conflict, the technical features mentioned in each embodiment can be combined in any way to form a corresponding implementable technical scheme.
[0028] Unless otherwise defined, the meaning of the technical terms used in this paper is the same as that generally understood by those skilled in the art to which the application belongs; the use of related terms in this paper is only for the purpose of describing specific embodiments, and is not intended to limit the application.
[0029] In the description of the application, the phrase "and / or" is a description of the logical relationship between the objects, which means that there can be three relationships, for example, A and / or B, which means that there are three cases: A exists, B exists, and A and B exist at the same time. In addition, the character " / " in this paper generally represents that the associated objects before and after are a kind of "or" logical relationship.
[0030] In this application, such as "first" and "second", the terms are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual quantity, primary and secondary or order relationship between the entities or operations.
[0031] In the present application, the word "comprise", "contain", "have" or other similar words used in the sentences are intended to cover non-exclusive inclusion, and the words do not exclude the presence of other elements in the process, method or product comprising the elements, so that the process, method or product comprising a series of elements can not only include those limited elements, but also include other elements not explicitly listed, or also include the elements inherent to such process, method or product.
[0032] In the present application, "greater than", "less than", "exceed" and other expressions are understood as not including the number; "above", "below", "within" and other expressions are understood as including the number. In addition, in the description of the embodiments of the present application, the meaning of "multiple" is more than two (including two), and similar expressions related to "multiple" are also understood in this way, for example, "multiple groups", "multiple times" and the like, unless otherwise explicitly specified.
[0033] In the description of the embodiments of the present application, the spatial-related expressions used, such as "center", "lengthwise", "transverse", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "vertical", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise", "axial", "radial", "circumferential" and the like, indicate the orientation or positional relationship based on the orientation or positional relationship shown in the specific embodiments or the drawings, and are only for the convenience of describing the specific embodiments of the present application or for the reader to understand, and do not indicate or imply that the indicated device or component must have a particular position, a particular orientation, or be constructed or operated in a particular orientation, and therefore cannot be understood as a limitation on the embodiments of the present application.
[0034] Unless otherwise explicitly specified or limited, in the description of the embodiments of the present application, the terms "mount", "connect", "connect", "fix", "set" and the like should be understood broadly. For example, the "connection" can be fixed connection, or detachable connection, or integrated setting; it can be mechanical connection, or electrical connection, or communication connection; it can be direct connection, or indirect connection through intermediate medium; it can be the internal communication of two elements or the interaction relationship between two elements. For those skilled in the art to which the present application belongs, the specific meaning of the above terms in the embodiments of the present application can be understood according to the specific circumstances.
[0035] Please refer to Figs. 1-2The application provides a large model role switching-based information recommendation method, comprising the following steps: step S101, constructing a context prompt word sequence set for a large model, the prompt word sequence set containing a first role prompt word and a second role prompt word, and inputting the prompt word sequence set into the large model; step S102, setting an initial role flag of the large model as the first role, setting associated information, early warning information and corresponding identification bit characters of the large model, and the large model is used to add the identification bit characters in the result after detecting the early warning information and output the associated information; step S103, acquiring input text of a user end, sending the input text to the large model according to the currently set role flag and acquiring a returned result; step S104, detecting whether the currently set role flag and the returned result contain the identification bit characters; and then according to the detection result, entering any of step S114, step S124, step S134 and step S144. In step S114, if the currently set role flag is the first role and the returned result does not contain the identification bit characters, the returned result is sent to the user end; in step S124, if the currently set role flag is the first role and the returned result contains the identification bit characters, the set role flag is switched to the second role, the input text of the user containing the second role is modified and sent to the large model to acquire a returned result, and the returned result is sent to the user end after removing the identification bit characters; in step S134, if the currently set role flag is the second role and the returned result does not contain the identification bit characters, the set role flag is switched to the first role, the input text of the user containing the first role is modified and sent to the large model to acquire a returned result, and the returned result is sent to the user end after removing the identification bit characters; and in step S144, if the currently set role flag is the second role and the returned result contains the identification bit characters, the returned result is sent to the user end after removing the identification bit characters.
[0036] The first role prompt word and the second role prompt word are used to enable the large model to generate replies of different roles, and the large model can have different role prompts. Then the large model can detect the input of the user and mark the result, so that the natural language detection is realized and the detection is more accurate. The application can detect the marked result and control whether to switch to the second role, and the large model returns the reply of the second role to the user, so that the reply information is replied by the large model, the large model outputs the reply containing the associated information, and the second role is used for reply, so that the content of the reply is closer to the role, thereby avoiding the direct addition of the associated information, the large model reply is closer to the natural language, and the user experience is improved.
[0037] In order to avoid that the user is disgusted by receiving too much recommended information, such as Fig. 2As shown, the method further comprises a step S201 of constructing a disabling switch set, where the switch set is a natural language disabling set, and setting a disabling switch set of the large model and a corresponding disabling identifier, such as $$, so that when the large model detects that the user's natural language expresses the same meaning as the semantics in the disabling switch set, the disabling identifier is returned. After the step S104 of obtaining the returned result, the method further comprises a step S202 of detecting the disabling identifier, and after the detection, the method proceeds to a step S203 of switching the currently set role flag to the first role and disabling the role switching, and the subsequent step S104 of detecting whether the returned result contains the role flag and the identifier bit character is no longer performed. Only the returned result is sent to the user terminal after removing the identifier bit character and the disabling identifier. If the disabling identifier is not contained, the step S104 of detecting whether the returned result contains the role flag and the identifier bit character is performed. In this way, when the user's input contains the same content as the semantics in the disabling switch set, the disabling switch state is entered, the role switching is avoided, and the recommended information is avoided, thereby avoiding user dissatisfaction.
[0038] In some embodiments, a switch enabling value can also be introduced, which is enabled after the role switching is disabled. Then, it is detected whether the returned result contains the identifier bit character. If it does, the switch enabling value is incremented by one. When the switch enabling value reaches a preset number of times, the step S104 of detection and role switching is restarted. In this way, the role switching can be restarted after the user actively mentions multiple times, and information recommendation can be achieved.
[0039] Further, an association relationship between the client and the set role flag is established, and different clients contain corresponding set role flags. In this way, different role flags can be achieved for different clients, and individual role responses for each client can be achieved.
[0040] In some embodiments, an association relationship between the user login ID and the set role flag is established, and different user login IDs contain corresponding set role flags. In this way, targeted role responses can be achieved according to the user login information, and the responses can be continued even if the user switches the client.
[0041] Further, the step of constructing the context prompt word sequence set for the large model comprises a step of inputting the original text into the large model for summarization to obtain the prompt word sequence set. By inputting the original text into the large model for summarization and extracting key context prompt word sequences from the summary, the key information and background knowledge of the original text can be effectively captured. Some irrelevant or repetitive information can be filtered out, thereby improving the accuracy and quality of the generated text.
[0042] In some embodiments, the original text is obtained by optical character recognition to obtain the text in the image. This image can be a medical test report, and the workload can be reduced by optical character recognition, and then summarized by a large model to generate a more accurate context prompt word sequence set.
[0043] Further, the input text of the user terminal includes obtaining the input picture of the user terminal, and obtaining the text in the input picture by optical character recognition. The user's input can also be optical character recognition, so that the user can upload the picture, and the system can reply according to the picture content.
[0044] Further, the associated information is recommended product information. In this way, the user can understand and purchase the product information, and increase the conversion rate of information recommendation.
[0045] In some embodiments, the recommended product information includes the ID, name and function introduction of the recommended product. The ID can record the information understood by the user in the background. The name and introduction can provide more information to the user. Then, according to the ID of the product, a hyperlink can be attached to the information, and the user can enter the corresponding product page by clicking the hyperlink, thereby realizing the conversion of the associated information.
[0046] Further, the large model is a large language model. For example, it can be a GPT large language model, a BERT large language model, and a disc large language model. Using existing large language models can make the reply closer to natural language and realize the personification dialogue.
[0047] It should be noted that although the above embodiments have been described in this paper, the patent protection scope of the present application is not limited thereby. Therefore, based on the innovative idea of the present application, the changes and modifications of the embodiments described in this paper, or the equivalent structure or equivalent process transformation made by using the content of the present application specification and drawings, directly or indirectly apply the above technical solutions to other related technical fields, are all included in the patent protection scope of the present application.
Claims
1.A method for information recommendation based on large model role switching, characterized in that, The method comprises the following steps: a context prompt word sequence set for a large model is constructed, the prompt word sequence set contains a first role prompt word and a second role prompt word, and the prompt word sequence set is input into the large model; an initial role mark of the large model is set as the first role, and associated information, early warning information and a corresponding mark character of the large model are set, the large model is used to add the mark character in the result and output the associated information after detecting the early warning information; input text of a user terminal is obtained, the input text is sent to the large model with the current set role mark, and a returned result is obtained; whether the current set role mark and the returned result contain the mark character is detected; if the current set role mark is the first role and the returned result does not contain the mark character, the returned result is sent to the user terminal; if the current set role mark is the first role and the returned result contains the mark character, the set role mark is switched to the second role, the input text of the user is modified to contain the second role and is sent to the large model, a returned result is obtained, and the returned result is sent to the user terminal after removing the mark character; if the current set role mark is the second role and the returned result does not contain the mark character, the set role mark is switched to the first role, the input text of the user is modified to contain the first role and is sent to the large model, a returned result is obtained, and the returned result is sent to the user terminal after removing the mark character; if the current set role mark is the second role and the returned result contains the mark character, the returned result is sent to the user terminal after removing the mark character; a disabled switching set is further constructed, a disabled switching set and a corresponding disabled identifier of the large model are set, and after the returned result is obtained, a disabled identifier detection step is further included, if the returned result contains the disabled identifier, the current set role mark is switched to the first role and the role switching is disabled, subsequent detection of whether the current set role mark and the returned result contain the mark character is not performed, and only the returned result is sent to the user terminal after removing the mark character and the disabled identifier, if the returned result does not contain the disabled identifier, detection of whether the current set role mark and the returned result contain the mark character is performed. 2.The information recommendation method based on large model role switching according to claim 1, characterized in that: An association between a client and a set role mark is established, different clients contain corresponding set role marks. 3.The information recommendation method based on large model role switching according to claim 1, characterized in that: An association between a user login ID and a set role mark is established, different user login IDs contain corresponding set role marks. 4.The information recommendation method based on large model role switching according to claim 1, characterized in that: The method of constructing a context prompt word sequence set for a large model comprises the following steps: original text is input into the large model for summarization, and the prompt word sequence set is obtained. 5.The information recommendation method based on large model role switching according to claim 4, characterized in that: The original text obtains text in an image through optical character recognition. 6.The information recommendation method based on large model role switching according to claim 1, characterized in that: The input text of the user terminal comprises input pictures of the user terminal, and text in the input pictures is obtained through optical character recognition. 7.The information recommendation method based on large model role switching according to claim 1, characterized in that: The associated information is recommended product information. 8.The information recommendation method based on large model role switching according to claim 7, characterized in that: The recommended product information contains an ID, a name and a function introduction of a recommended product. 9.The information recommendation method based on large model role switching according to any one of claims 1 to 8, characterized in that: The large model is a large language model.
Citation Information
Patent Citations
Online question and answer cue word optimization generation method based on large language model
CN118093836A
Log analysis positioning method and system based on large model technology
CN118227421A