Information recommendation device based on large model role switching
By switching roles in the large model and detecting trigger keywords, the method of embedding recommended information solves the problem of users ignoring additional information, improves the information recommendation effect of the language large model, and enhances the user experience.
Patent Information
- Application Number
- CN202411012545.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-26
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2044-07-26
AI Technical Summary
Existing large language models usually use additional information prompts when recommending information, which causes users to focus on the answer and ignore the recommended information.
Through an information recommendation device based on large-scale model role switching, contextual question and answer text sets of different reply roles are pre-stored, and the question and answer control unit is used to detect trigger keywords and switch roles, and the answer results containing recommended information are output, combined with a text set prohibiting role changes to prevent improper switching.
It achieves the goal of embedding recommendation information in natural language answers, improving user experience, avoiding the direct attachment of recommendation information, and enhancing the effectiveness and naturalness of information recommendations.
Smart Images

Figure CN119066162B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data large model devices, and in particular to an information recommendation device based on large model role switching. Background Art
[0002] A large model generally refers to a large language model. Large language models, such as the GPT large language model, can provide natural language responses to user input questions. By controlling the input of the large language model, the large model's roles can be set. Using different large model roles to answer user questions simulates human communication and improves the user experience. Setting different roles is particularly meaningful in customer service systems. In large language model responses, the model provider also hopes to provide users with recommended additional information, such as advertising or information of interest, to encourage users to pay attention to this important information. The current practice is to test the large model output, perform keyword matching, and then highlight the keyword position as a prompt or add a reminder message. This gives the user the impression of additional information, and the user's attention may remain focused on the large language model's answer and ignore the reminder message. Summary of the Invention
[0003] To this end, it is necessary to provide an information recommendation device based on large model role switching to solve the problem that the existing language big data model uses additional information for prompts when recommending information.
[0004] To achieve the above-mentioned object, the present invention provides an information recommendation device based on large model role switching, comprising a client, a large model unit, a question-and-answer control unit, a role storage unit, and a keyword storage unit; the role storage unit pre-stores the client's initial role information; the keyword storage unit pre-stores trigger keyword information related to information recommendation;
[0005] The large model unit is pre-input with a contextual question and answer text set, wherein the contextual question and answer text set is distinguished by different reply roles. The large model unit summarizes the contextual question and answer text set and responds according to the input text information. The large model unit is pre-set with recommendation information, trigger keyword information and corresponding marked character information. The large model unit is used to add the marked character information to the result after detecting the trigger keyword information and output the recommendation information.
[0006] The question-answer control unit obtains question text information input by the client; sends the question text information to the large model unit using the initial role information of the role storage unit and obtains the returned answer result;
[0007] The question-answer control unit obtains whether the returned answer result contains the marked character information;
[0008] If the role information in the role storage unit is initial role information and the returned answer result does not include the mark character information, the question and answer control unit sends the returned answer result to the client;
[0009] If the role information in the role storage unit is the initial role information and the returned answer result includes the marked character information, the question and answer control unit changes the role information in the role storage unit to the information recommended role, modifies the question text information to include the information recommended role, and then sends it to the large model unit and obtains the returned answer result, removes the marked character information from the returned answer result, and sends it to the client;
[0010] If the role information in the role storage unit is an information-recommended role and the returned answer result does not contain the marked character information, the question-answer control unit changes the role information in the role storage unit to the initial role information, modifies the question text information to include the initial role information, and then sends it to the large model unit and obtains the returned answer result, removes the marked character information from the returned answer result, and sends it to the client;
[0011] If the role information in the role storage unit is an information recommended role and the returned answer result contains the marked character information, the question and answer control unit removes the marked character information from the returned answer result and sends it to the client.
[0012] Furthermore, it also includes constructing a set of characters that prohibit role changes, and the large model unit pre-inputs the set of characters that prohibit role changes and the corresponding prohibited detection identifier. After obtaining the returned answer result, the question and answer control unit also determines whether it contains the prohibited detection identifier. If it is detected that the returned answer result contains the prohibited detection identifier, the role information in the role storage unit is switched to the initial role information, the role switching is prohibited, and the role storage unit is marked. If the marked character information is detected subsequently, the question text information is added with the non-recommendation information and sent to the large model unit, and then the answer of the large model unit is sent to the client. If it does not contain the prohibited detection identifier, the role information in the role storage unit and the returned answer result are checked to see whether they contain the marked character information.
[0013] Furthermore, the marking in the role storage unit includes marking a disabled time limit, and after the time limit expires, the question and answer control unit cancels the disabled time limit.
[0014] Furthermore, the question-and-answer control unit establishes an association relationship between the ID logged in by the client and the set role information in the role storage unit, and different IDs logged in by the client contain the set role information corresponding thereto.
[0015] Furthermore, the contextual question and answer text set is obtained by inputting the original text into the large model unit for summarization.
[0016] Furthermore, the original text is obtained by OCR to obtain text in the image.
[0017] Furthermore, the client is also used to obtain an input image of the client, obtain text in the input image through OCR, and use the text in the image as question text information.
[0018] Furthermore, the recommendation information is recommended product information.
[0019] Furthermore, the recommended product information includes the ID, name and function introduction of the recommended product.
[0020] Furthermore, the client includes a mobile client, a WEB client or a computer client.
[0021] Different from the existing technology, the above technical solution can provide answers of different roles according to the input text questions by pre-inputting a contextual question and answer text set with different reply roles in the large model unit. The initial role information words or information recommendation role words are input into the large model unit through the question and answer control unit, and the large model unit generates answers based on different roles to achieve more humanized answers. The large model can then answer the user's input and mark the answer results so that the results contain marking information. The present invention can detect the marked results and control whether to switch to the information recommendation role. After switching, the large model unit will answer again according to the information recommendation role and return it to the user. Such reply information is summarized by the large model, so that the large model outputs an answer containing recommended information, and uses the information recommendation role to reply. The content of the reply is closer to the information recommendation role, thereby avoiding the method of directly appending recommended information. The reply of the large model is closer to natural language, which improves the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 A structural diagram of a device according to an embodiment of the present invention;
[0023] Figure 2 This is a method flow chart of another embodiment of the present invention.
[0024] Description of reference numerals:
[0025] 1. Client;
[0026] 2. Large model unit;
[0027] 3. Question and answer control unit;
[0028] 4. Role storage unit;
[0029] 5. Keyword storage unit. DETAILED DESCRIPTION
[0030] 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.
[0031] References to "embodiments" herein mean that the specific features, structures, or characteristics described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the word "embodiment" in various places in the specification does not necessarily refer to the same embodiment, nor does it particularly limit its independence or relevance to other embodiments. In principle, in this application, as long as there are no technical contradictions or conflicts, the various technical features mentioned in the embodiments can be combined in any manner to form a corresponding implementable technical solution.
[0032] Unless otherwise defined, the technical terms used herein have the same meanings as those generally understood by those skilled in the art to which this application belongs; the use of relevant terms herein is only for describing specific embodiments and is not intended to limit this application.
[0033] In the description of this application, the term "and / or" is used to describe a logical relationship between objects, indicating that three relationships can exist. For example, A and / or B means: A exists, B exists, and both A and B exist. In addition, the character " / " in this document generally indicates that the objects before and after are in a logical "or" relationship.
[0034] In this 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 quantity, priority or sequence relationship between these entities or operations.
[0035] Without further limitations, in this application, the words "include", "comprise", "have" 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 that includes the elements, so that the process, method or product that includes a series of elements may include not only those limited elements, but also other elements that are not explicitly listed, or also include elements inherent to such process, method or product.
[0036] Consistent with the understanding in the Patent Examination Guidelines, in this application, expressions such as "greater than," "less than," and "exceed" are understood to exclude the number itself; expressions such as "above," "below," and "within" 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 manner, such as "multiple groups" and "multiple times," unless otherwise clearly and specifically limited.
[0037] In the description of the embodiments of the present application, the 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 device or component referred to must have a specific position, a specific orientation, or be constructed or operated in a specific orientation. Therefore, it should not be understood as a limitation on the embodiments of the present application.
[0038] Unless otherwise expressly specified or limited, in the description of the embodiments of the present application, the terms "installed", "connected", "connected", "fixed", "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 an indirect connection through an intermediate medium; it can be the internal connection of two elements or the interaction relationship between two elements. For those skilled in the art of the present application, the specific meanings of the above terms in the embodiments of the present application can be understood according to the specific circumstances.
[0039] See also Figures 1 to 2 The present invention provides an information recommendation device based on large model role switching, comprising a client 1, a large model unit 2, a question-and-answer control unit 3, a role storage unit 4, and a keyword storage unit 5. The role storage unit 4 pre-stores the initial role information of the client 1; the keyword storage unit 5 pre-stores trigger keyword information related to information recommendation. The client 1 may include a mobile client, a web client, or a computer client. The mobile client may be an Android client or an Apple client. The web client may be a browser client, and the computer client may be a Windows installation client.
[0040] The large model unit 2 is pre-loaded with a contextual question and answer text set, which includes questions and corresponding answers. This set can be collected from the customer service system. The large model unit can summarize the questions and answers, and if there are similar questions, it can provide the corresponding answers. The contextual question and answer text set distinguishes different response roles, that is, the answers contain response role information. The response role information can be used to distinguish different answers. The response role here can be an initialized normal question and answer role and an information recommendation role used for recommending information. The present invention can also have more roles, such as including third role information. If the large model unit adds a text defining the response role to the question, the large model unit can summarize and respond based on the answers corresponding to the role in the contextual question and answer text. The large model unit 2 summarizes the contextual question and answer text set and responds based on the input text information. The large model unit 2 is pre-set with recommended information, trigger keyword information, and corresponding tag character information. After detecting the trigger keyword information, the large model unit 2 is configured to add the tag character information to the results and output the recommended information. The trigger keyword information here is the question text information input by the customer, the recommended information can be advertising information, and the marking character information is a special character (such as %@%@%), which is used for detection by the question and answer control unit 3.
[0041] The question and answer control unit 3 obtains the question text information input by the client 1; sends the question text information to the large model unit 2 with the initial role information of the role storage unit 4 and obtains the returned answer result; the question and answer control unit 3 obtains whether the returned answer result contains the marked character information.
[0042] If the role information in the role storage unit 4 is the initial role information and the returned answer result does not contain the marking character information, the question and answer control unit 3 sends the returned answer result to the client 1, that is, directly replies.
[0043] If the role information in the role storage unit 4 is the initial role information and the returned answer result contains the marked character information, the question and answer control unit 3 changes the role information in the role storage unit 4 to the information recommended role. Here, the role change and the interception of the answer are realized. After the question text information is modified to include the information recommended role, it is sent to the large model unit 2 and the returned answer result is obtained (the answer at this time is answered with the information recommended role, and contains the recommended information and marked character information), and the returned answer result is removed from the marked character information and sent to the client 1. Here, the role change and the use of the corresponding role in the answer are realized, and the recommendation information is included.
[0044] If the role information in role storage unit 4 is a recommended role and the returned answer does not contain the marked character information, the question and answer control unit 3 changes the role information in role storage unit 4 to the initial role information, modifies the question text information to include the initial role information, sends it to the large model unit 2, obtains the returned answer result, removes the marked character information from the returned answer result, and sends it to client 1. The present invention can restore the initial role to reply at this point, ensuring normal communication.
[0045] If the character information in the character storage unit 4 indicates a recommended character and the returned answer contains the marked character information, the question and answer control unit 3 removes the marked character information from the returned answer and sends it to the client 1. If the character information is already a recommended character, the mark is removed and the answer is sent back to the client, thus enabling question and answer between different clients.
[0046] The present invention pre-inputs a contextual question and answer text set with different reply roles into the large model unit, and can provide answers of different roles according to the input text questions. The initial role information words or information recommendation role words are input into the large model unit through the question and answer control unit, and the large model unit generates answers based on different roles to achieve more humanized answers. The large model can then answer the user's input and mark the answer results so that the results contain marking information. The present invention can detect the marked results and control whether to switch to the information recommendation role. After switching, the large model unit will answer again according to the information recommendation role and return it to the user. Such reply information is summarized by the large model, so that the large model outputs an answer containing recommended information, and uses the information recommendation role to reply. The content of the reply is closer to the information recommendation role, thereby avoiding the method of directly adding recommended information. The reply of the large model is closer to natural language, which improves the user experience.
[0047] In order to detect the situation in which a customer dislikes the recommended information and improve the customer experience, the present invention further includes constructing a set of characters that prohibit role changes. The large model unit 2 pre-enters the set of characters that prohibit role changes and a corresponding prohibition detection identifier (such as %%¥¥). The characters that prohibit role changes here are characters that express user dislike. For example, if a user enters relevant text content such as "I don't like the content you recommended" or "Don't recommend it to me", it means that the user does not want to change the role. After the question and answer control unit 3 obtains the returned answer result, it also enters step S201 to determine whether it contains a prohibited detection identifier. If it is detected that the returned answer result contains a prohibited detection identifier, it enters step S202 to switch the role information in the role storage unit 4 to the initial role information and prohibit role switching and mark it in the role storage unit 4 (marked as a non-switchable state). If the marked character information is detected later, the question text information is added with no recommendation information (such as adding text such as "do not recommend information", and the large language model can not recommend information based on this information) and then sent to the large model unit, and then the answer of the large model unit is sent to the client 1. If it does not contain a prohibited detection identifier, it enters step S203 to detect whether the role information in the role storage unit 4 and the returned answer result contain the marked character information, that is, the detection is performed normally. In this way, when the user's input has the same semantics as the prohibited role change text set, it will enter the disabled switching state, avoid switching roles and recommending information, thereby avoiding user disgust.
[0048] Furthermore, the marking in the role storage unit 4 includes a time limit for marking the disablement, and after the time limit is reached, the question and answer control unit 3 cancels the time limit for the disablement. If the time limit is 24 hours, the current time plus 24 hours is disabled. It can be re-enabled after this time. In some embodiments, a switch enable value can also be introduced. After the role switching is prohibited, the switch enable value is turned on, and then the returned answer result is detected to see if it contains the marked character information. If so, the switch enable value is increased by one. When the switch 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 to achieve information recommendation.
[0049] In some embodiments, the question-and-answer control unit 3 establishes an association between the ID used by the client 1 to log in and the configured role information in the role storage unit 4. Different IDs used by the client 1 to log in contain the corresponding configured role information. This allows for targeted role replies based on the user's login information, and allows for continued replies even if the user switches clients.
[0050] Furthermore, the contextual question and answer text set is generated by inputting the original text into the large model unit 2 for summarization. By inputting the original text into the large model for summarization and extracting key contextual questions and answers from the summary, the key information and background knowledge of the original text can be effectively captured. It can also filter out irrelevant or repetitive information, thereby improving the accuracy and quality of the generated text.
[0051] Furthermore, the original text is processed through OCR to obtain the text in the image. This image can be a medical test report. OCR (Optical Character Recognition) can reduce the workload, and then summarize it through a large model to generate a more accurate contextual question and answer text set.
[0052] Furthermore, the client 1 is further configured to obtain an input image from the client 1, obtain text in the input image through OCR, and use the text in the image as the question text information. The user input can also be optical character recognition, so that after the user uploads the image, the system can respond based on the image content.
[0053] Furthermore, the recommended information is recommended product information, so that users can understand and purchase product information, thereby increasing the conversion rate of information recommendations.
[0054] Furthermore, the recommended product information includes the recommended product's ID, name, and a brief description of its features. The ID allows the backend to record the information the user has learned. The name and description provide the user with more information. A hyperlink can then be attached to the information based on the product's ID. Users can click on the hyperlink to be taken to the corresponding product page, thus achieving conversion of the recommended information.
[0055] Furthermore, the large model unit 2 is a language large model unit 2. For example, it can be a GPT language large model, a BERT language large model, or a Pangu language large model. Using an existing language large model can make the response closer to natural language and achieve human-like dialogue.
[0056] It should be noted that although the above embodiments have been described herein, this does not limit the scope of patent protection of the present invention. Therefore, based on the innovative concept of the present invention, changes and modifications to the embodiments described herein, or equivalent structural or equivalent process transformations made using the contents of the present invention's specification and drawings, and direct or indirect application of the above technical solutions to other related technical fields, are all included in the scope of patent protection of the present invention.
Claims
1. An information recommendation device based on large model role switching, characterized in that: It includes a client, a large model unit, a question-answer control unit, a role storage unit, and a keyword storage unit; the role storage unit pre-stores the initial role information of the client; the keyword storage unit pre-stores trigger keyword information related to information recommendation; The large model unit is pre-input with a contextual question and answer text set, wherein the contextual question and answer text set is distinguished by different reply roles. The large model unit summarizes the contextual question and answer text set and replies according to the input text information; The large model unit is pre-set with recommendation information, trigger keyword information and corresponding mark character information, and the large model unit is used to add the mark character information to the result and output the recommendation information after detecting the trigger keyword information; The question-answer control unit obtains question text information input by the client; Sending question text information to the large model unit using the initial role information of the role storage unit and obtaining the returned answer result; The question-answer control unit obtains whether the returned answer result contains the marked character information; If the role information in the role storage unit is initial role information and the returned answer result does not include the mark character information, the question and answer control unit sends the returned answer result to the client; If the role information in the role storage unit is the initial role information and the returned answer result includes the marked character information, the question and answer control unit changes the role information in the role storage unit to the information recommended role, modifies the question text information to include the information recommended role, and then sends it to the large model unit and obtains the returned answer result, removes the marked character information from the returned answer result, and sends it to the client; If the role information in the role storage unit is an information-recommended role and the returned answer result does not contain the marked character information, the question-answer control unit changes the role information in the role storage unit to the initial role information, modifies the question text information to include the initial role information, and then sends it to the large model unit and obtains the returned answer result, removes the marked character information from the returned answer result, and sends it to the client; If the role information in the role storage unit is an information recommended role and the returned answer result contains the marked character information, the question and answer control unit removes the marked character information from the returned answer result and sends it to the client.
2. The information recommendation device based on large model role switching according to claim 1, characterized in that: It also includes constructing a prohibited role change text set, the large model unit pre-inputs the prohibited role change text set and the corresponding prohibited detection identifier, and the question and answer control unit also determines whether it contains the prohibited detection identifier after obtaining the returned answer result. If it is detected that the returned answer result contains the prohibited detection identifier, the role information in the role storage unit is switched to the initial role information, the role switching is prohibited, and the role storage unit is marked. If the marked character information is detected subsequently, the question text information is added with the non-recommendation information and sent to the large model unit, and then the answer of the large model unit is sent to the client. If it does not contain the prohibited detection identifier, the role information in the role storage unit and the returned answer result are checked to see whether they contain the marked character information.
3. The information recommendation device based on large model role switching according to claim 2, characterized in that: The marking in the role storage unit includes marking a time limit for disabling, and after the time limit expires, the question and answer control unit cancels the time limit for disabling.
4. The information recommendation device based on large model role switching according to claim 1, characterized in that: The question-and-answer control unit establishes an association relationship between the ID logged in by the client and the set role information in the role storage unit, and different IDs logged in by the client contain the set role information corresponding thereto.
5. The information recommendation device based on large model role switching according to claim 1, characterized in that: The contextual question and answer text set is obtained by inputting the original text into the large model unit for summarization.
6. The information recommendation device based on large model role switching according to claim 5, characterized in that: The original text is obtained by OCR to obtain the text in the image.
7. The information recommendation device based on large model role switching according to claim 1 is characterized in that: The client is further configured to obtain an input image of the client, obtain text in the input image through OCR, and use the text in the image as question text information.
8. The information recommendation device based on large model role switching according to claim 1 is characterized in that: The recommendation information is recommended product information.
9. The information recommendation device based on large model role switching according to claim 8, characterized in that: The recommended product information includes the ID, name and function introduction of the recommended product.
10. The information recommendation device based on large model role switching according to any one of claims 1 to 9, characterized in that: The client includes a mobile client, a WEB client or a computer client.
Citation Information
Patent Citations
Intelligent customer service information generation system and method based on keyword extraction
CN116628173A
Dialogue processing method and device based on large language model and electronic equipment
CN117251552A