Information recommendation method based on large model role switching
By constructing a context prompt word sequence collection and role switching mechanism in the data big model, the problem of poor information recommendation experience is solved, and reply closer to natural language is achieved, and user experience is improved.
Patent Information
- Application Number
- CN202410917835.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-10
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2044-07-10
AI Technical Summary
When recommending information, the existing data model has poor information experience, which can easily cause user disgust and affect user experience.
By constructing a collection of contextual prompt word sequences for large models, including the first role prompt word and the second role prompt word, setting role flags and association information, detecting whether the returned result contains identifier characters, switching roles based on the results, realizing natural language Reply to avoid adding related information directly.
Improve user experience, ensure that the information output by the big model is closer to natural language, and avoid user disgust caused by excessive information.
Smart Images

Figure CN118916474A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of big data models, and in particular to an information recommendation method based on big model role switching. Background Art
[0002] The existing big data model can answer based on user input, and the role of the big model can be preset, so that the user input can be responded to in a targeted manner. The provider of the big model also hopes to provide users with recommended additional information to promote communication between the provider and the user. The current practice is generally to add and supplement additional information after testing the output of the big model, but the information given to users in this way will be very blunt, which is easy to cause user disgust and affect user experience. Summary of the invention
[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 existing information recommendation.
[0004] To achieve the above object, the present invention provides an information recommendation method based on large model role switching, comprising the following steps:
[0005] Constructing a context prompt word sequence set for a large model, wherein the prompt word sequence set includes a first role prompt word and a second role prompt word, and inputting the prompt word sequence set into the large model;
[0006] The initial role flag of the large model is set to the first role, and the associated information, warning information and corresponding identification characters of the large model are set, wherein the large model is used to add the identification characters in the result and output the associated information after detecting the warning information;
[0007] Obtaining the input text of the user end, sending the input text to the large model with the currently set role flag and obtaining the return result;
[0008] Check whether the currently set role flag and the returned result contain the flag character;
[0009] If the currently set role flag is the first role and the returned result does not contain the identification character, sending the returned result to the user end;
[0010] If the currently set role flag is the first role and the returned result contains the identification character, then switch the set role flag to the second role, modify the user's input text to include the second role, send it to the large model, obtain the returned result, and remove the identification character from the returned result and send it to the user end;
[0011] If the currently set role flag is the second role and the returned result does not contain the identification character, then switch the set role flag to the first role, modify the user's input text to include the first role, send it to the large model, obtain the returned result, and remove the identification character from the returned result and send it to the user end;
[0012] If the currently set role flag is the second role and the returned result contains the identification character, the returned result is sent to the user end after removing the identification character.
[0013] Furthermore, it also includes constructing a disabled switching set, setting a disabled switching set of a large model and a corresponding disabled identifier, and after obtaining the return result, it also includes a step of detecting the disabled identifier. If it is detected that the return result contains a disabled identifier, the currently set role flag is switched to the first role and role switching is prohibited. Subsequently, the currently set role flag and the return result will no longer be detected to see whether they contain the identification bit characters. The return result will only be sent to the user end after removing the identification bit characters and the disabled identifier. If the disabled identifier is not contained, the currently set role flag and the return result will be detected to see whether they contain the identification bit characters.
[0014] Furthermore, an association relationship between the client and the set role flag is established, and different clients contain corresponding set role flags.
[0015] Furthermore, 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.
[0016] Furthermore, the construction of a context prompt word sequence set for a large model comprises the steps of:
[0017] The original text is input into the large model for summarization to obtain the prompt word sequence set.
[0018] Furthermore, the original text is obtained by optical character recognition to obtain text in the image.
[0019] Furthermore, the obtaining of the input text of the user terminal includes obtaining an input picture of the user terminal, and obtaining the text in the input picture by optical character recognition.
[0020] Furthermore, the associated information is recommended product information.
[0021] Furthermore, the recommended product information includes the ID, name and function introduction of the recommended product.
[0022] Furthermore, the large model is a large language model.
[0023] Different from the prior art, the above technical solution can have different role prompts through the first role prompt word and the second role prompt word. Then the big model can detect the user's input and mark the result. The present invention can detect the marked result and control whether to switch to the second role. The big model will answer again according to the second role and return it to the user. Such reply information is replied by the big model, so that the big model outputs the answer containing related information, and the second role is used to reply. The content of the reply is closer to the role, thereby avoiding the method of directly adding related information. The reply of the big model is closer to natural language, improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 is a method flow chart of an embodiment of the present invention;
[0025] Figure 2 The present invention is a method flow chart of another embodiment of the present invention. DETAILED DESCRIPTION
[0026] In order to explain the technical content, structural features, achieved objectives and effects of the technical solution in detail, the following is a detailed description in conjunction with specific embodiments and accompanying drawings.
[0027] Reference to "embodiment" herein means that the specific features, structures or characteristics described in conjunction with the embodiment may be included in at least one embodiment of the present application. The term "embodiment" appearing in various places in the specification does not necessarily refer to the same embodiment, nor does it particularly limit its independence or association with other embodiments. In principle, in the present application, as long as there is no technical contradiction or conflict, the various technical features mentioned in the embodiments can be combined in any way to form a corresponding implementable technical solution.
[0028] Unless otherwise defined, the technical terms used in this document have the same meanings as those generally understood by those skilled in the art to which this application belongs; the use of relevant terms in this document is only for describing specific embodiments and is not intended to limit this application.
[0029] In the description of this application, the term "and / or" is an expression used to describe the logical relationship between objects, indicating that three relationships may exist, for example, A and / or B, which means: A exists, B exists, and A and B exist at the same time. In addition, the character " / " in this article generally indicates that the objects before and after are in an "or" logical relationship.
[0030] In the present application, terms such as “first” and “second” are merely used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship of quantity, priority or sequence between these entities or operations.
[0031] Without further limitations, in this application, the words "include", "comprises", "has" or other similar expressions used in the sentences are intended to cover non-exclusive inclusion. These expressions do not exclude the presence of additional elements in the process, method or product including the elements, so that the process, method or product including a series of elements may include not only those limited elements, but also other elements not explicitly listed, or also include elements inherent to such process, method or product.
[0032] Similar to the understanding in the Patent Examination Guidelines, in this application, expressions such as "greater than", "less than", "exceed" and the like are understood to exclude the number itself; expressions such as "above", "below", "within" and the like are understood to include the number itself. In addition, in the description of the embodiments of this application, "multiple" means more than two (including two), and similar expressions related to "multiple" are also understood in this way, such as "multiple groups", "multiple times", etc., unless otherwise clearly and specifically limited.
[0033] In the description of the embodiments of the present application, space-related expressions used, such as "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "vertical", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise", "axial", "radial", "circumferential", etc., indicate the orientation or position relationship based on the orientation or position relationship shown in the specific embodiments or drawings, and are only for the convenience of describing the specific embodiments of the present application or facilitating the reader's understanding, and do not indicate or imply that the referred device or component must have a specific position, a specific orientation, or be constructed or operated in a specific orientation, and therefore cannot be understood as a limitation on the embodiments of the present application.
[0034] Unless otherwise expressly specified or limited, in the description of the embodiments of the present application, the terms such as "install", "connect", "connect", "fix", "set", etc. used should be understood in a broad sense. For example, the "connection" can be a fixed connection, a detachable connection, or an integrated setting; it can be a mechanical connection, an electrical connection, or a communication connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium; it can be the internal connection of two elements or the interaction relationship between two elements. For technicians in the technical field to which the present application belongs, the specific meanings of the above terms in the embodiments of the present application can be understood according to the specific circumstances.
[0035] See also Figure 1 to Figure 2The present invention provides an information recommendation method based on large model role switching, comprising the following steps: Step S101 constructs a context prompt word sequence set for the large model, the prompt word sequence set includes a first role prompt word and a second role prompt word, and inputs the prompt word sequence set into the large model. Step S102 sets the initial role flag of the large model to the first role, sets the associated information, warning information and corresponding identification characters of the large model, and the large model is used to add identification characters to the result and output the associated information after detecting the warning information. Step S103 obtains the input text of the user end, sends the input text to the large model with the currently set role flag, and obtains the return result. Step S104 detects whether the currently set role flag and the return result contain the identification character. Then, according to the detection result, enter any step of step S114, step S124, step S134, and step S144 respectively. In step S114, if the currently set role flag is the first role and the return result does not contain the identification character, the return result is sent to the user end; in step S124, if the currently set role flag is the first role and the return result contains the identification character, the role flag is switched to the second role, the user's input text is modified to include the second role and then sent to the large model and the return result is obtained, and the return result is removed from the identification character and then sent to the user end; in step S134, if the currently set role flag is the second role and the return result does not contain the identification character, the role flag is switched to the first role, the user's input text is modified to include the first role and then sent to the large model and the return result is obtained, and the return result is removed from the identification character and then sent to the user end; in step S144, if the currently set role flag is the second role and the return result contains the identification character, the return result is removed from the identification character and then sent to the user end.
[0036] The present invention uses the first role prompt word and the second role prompt word to realize that the big model can generate replies of different roles and can have different role prompts. Then the big model can detect the user's input and mark the result, so that the detection of natural language can be realized, and the detection is more accurate. The present invention can detect the marked result and control whether to switch to the second role. The big model will answer again according to the second role and return it to the user. Such reply information is replied by the big model, so that the big model outputs a reply containing related information, and the second role is used to reply. The content of the reply is closer to the role, thereby avoiding the method of directly adding related information. The reply of the big model is closer to natural language, improving the user experience.
[0037] In order to avoid users receiving too much recommended information and causing disgust, Figure 2As shown, it also includes step S201 to construct a disabled switching set, where the switching set is a natural language disabled set, and sets the disabled switching set of the large model and the corresponding disabled identifier, such as $$. When the large model detects that the user's natural language expresses the same meaning as the disabled switching set, it will return the disabled identifier. After step S104 obtains the returned result, it also includes step S202 to detect the disabled identifier. After the detection, it enters step S203. If it is detected that the returned result contains a disabled identifier, the currently set role flag is switched to the first role and the role switching is prohibited. Subsequently, step S104 is no longer performed to detect whether the currently set role flag and the returned result contain the identification bit characters. Only the returned result is sent to the user end after removing the identification bit characters and the disabled identifier. If the disabled identifier is not included, step S104 is performed to detect whether the currently set role flag and the returned result contain the identification bit characters. In this way, after the user inputs the content with the same semantics as the disabled switching set, it will enter the disabled switching state, avoid switching roles and recommending information, thereby avoiding user disgust.
[0038] In some embodiments, a switching enable value may be introduced, which is turned on after the role switching is prohibited, and then the returned result is detected to see whether it contains the identification character. If so, the switching enable value is increased by one, and when the switching enable value reaches a preset number of times, step S104 is restarted to perform detection and role switching. In this way, the role switching can be restarted after the user actively mentions it multiple times, thereby realizing information recommendation.
[0039] Further, an association relationship between the client and the set role flag is established, and different clients contain the set role flags corresponding thereto. In this way, different role flags can be implemented for different clients, and a separate role reply for each client can be implemented.
[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 replies can be implemented according to the user login information, and the reply can continue even if the user switches the client.
[0041] Furthermore, the construction of the context prompt word sequence set for the large model includes the steps 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 the key context prompt word sequence from the summary, the key information and background knowledge of the original text can be effectively captured. Some irrelevant or repeated 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 text in the image. The image may be a medical test report, and optical character recognition can reduce the workload, and then a more accurate context prompt word sequence set can be generated by summarizing through a large model.
[0043] Furthermore, obtaining 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 input may also be optical character recognition, so that after the user uploads the picture, the system can reply according to the content of the picture.
[0044] Furthermore, the related information is recommended product information, so that users can understand and purchase product information, thereby increasing 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 information that the user knows can be recorded through the ID background. The name and introduction can give the user more information. 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 to realize the conversion of related information.
[0046] Furthermore, the large model is a large language model. For example, it can be a GPT large language model, a BERT large language model, or a Pangu large language model. Using an existing large language model can make the response closer to natural language and achieve anthropomorphic dialogue.
[0047] It should be noted that, although the above embodiments have been described in this article, the patent protection scope of the present invention is not limited thereby. Therefore, based on the innovative concept of the present invention, changes and modifications made to the embodiments described herein, or equivalent structures or equivalent process changes made using the contents of the present invention specification and drawings, directly or indirectly applying the above technical solutions to other related technical fields, are all included in the patent protection scope of the present invention.
Claims
1. An information recommendation method based on large model role switching, characterized in that: The steps include: Constructing a context prompt word sequence set for a large model, wherein the prompt word sequence set includes a first role prompt word and a second role prompt word, and inputting the prompt word sequence set into the large model; The initial role flag of the large model is set to the first role, and the associated information, warning information and corresponding identification characters of the large model are set, wherein the large model is used to add the identification characters in the result and output the associated information after detecting the warning information; Obtaining the input text of the user end, sending the input text to the large model with the currently set role flag and obtaining the return result; Check whether the currently set role flag and the returned result contain the flag character; If the currently set role flag is the first role and the returned result does not contain the identification character, sending the returned result to the user end; If the currently set role flag is the first role and the returned result contains the identification character, then switch the set role flag to the second role, modify the user's input text to include the second role, send it to the large model, obtain the returned result, and remove the identification character from the returned result and send it to the user end; If the currently set role flag is the second role and the returned result does not contain the identification character, then switch the set role flag to the first role, modify the user's input text to include the first role, send it to the large model, obtain the returned result, and remove the identification character from the returned result and send it to the user end; If the currently set role flag is the second role and the returned result contains the identification character, the returned result is sent to the user end after removing the identification character.
2. The information recommendation method based on large model role switching according to claim 1 is characterized in that: It also includes constructing a disabled switching set, setting the disabled switching set of the large model and the corresponding disabled identifier, and after obtaining the return result, it also includes the step of detecting the disabled identifier. If it is detected that the return result contains the disabled identifier, the currently set role flag is switched to the first role and the role switching is prohibited. Subsequently, the currently set role flag and the return result will no longer be detected to see whether they contain the identification bit characters. The return result will only be sent to the user end after removing the identification bit characters and the disabled identifier. If the disabled identifier is not contained, the currently set role flag and the return result will be detected to see whether they contain the identification bit characters.
3. The information recommendation method based on large model role switching according to claim 1 is characterized in that: An association relationship between the client and the set role flag is established, and different clients contain corresponding set role flags.
4. The information recommendation method based on large model role switching according to claim 1 is characterized in that: 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.
5. The information recommendation method based on large model role switching according to claim 1 is characterized in that: The construction of the context prompt word sequence set for the large model comprises the steps of: The original text is input into the large model for summarization to obtain the prompt word sequence set.
6. The information recommendation method based on large model role switching according to claim 5 is characterized in that: The original text is obtained by optical character recognition to obtain text in the image.
7. The information recommendation method based on large model role switching according to claim 1 is characterized in that: The obtaining of the input text of the user terminal includes obtaining an input picture of the user terminal, and obtaining the text in the input picture by optical character recognition.
8. The information recommendation method based on large model role switching according to claim 1 is characterized in that: The associated information is recommended product information.
9. The information recommendation method based on large model role switching according to claim 8 is characterized in that: The recommended product information includes the ID, name and function introduction of the recommended product.
10. The information recommendation method based on large model role switching according to any one of claims 1 to 9, characterized in that: The large model is a large language model.
Citation Information
Patent Citations
Electric power scientific research achievement knowledge base construction method based on large language model
CN118093768A
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
Wired drone system
KR1020240175829A
Method and apparatus for generating push information
WO2022095892A1
