Information recommendation method and device and electronic equipment
By obtaining the inference information to be reasoned by users' intentions and filtering target memory using memory banks and large language models, the problem of inaccurate information recommendation is solved, and more accurate and personalized recommendation information is achieved.
Patent Information
- Application Number
- CN202311426404.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-30
- Publication Date
- 2025-05-02
AI Technical Summary
The problem of inaccurate information recommendation in the prior art leads to the non-compliance of user intentions and personality.
By obtaining the information to be reasoned to be reasoned that represents the user's intention, based on the information to be reasoned, the memory bank and the large language model, the target memory related to the intention is filtered out from the memory database, including the user's long-term habits and recent behaviors, and then based on the information to be reasoned, the target memory and the large language model, the recommended information corresponding to the intention is obtained.
It improves the accuracy of recommended information, makes the recommended information more in line with user intentions and personality, and enhances the intelligence of information recommendations.
Smart Images

Figure CN119917725A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and more specifically, to an information recommendation method, device and electronic device. Background Art
[0002] With the advancement of technology, people's daily lives are becoming increasingly rich and diverse. They perform different behaviors at every moment, accompanied by various types of data. These data can contain and reflect the user's personality, preferences, tendencies, etc. In related methods, these data can be used to send recommended information that may be of interest to users. However, in related methods, there is still the problem of inaccurate recommended information. Summary of the invention
[0003] In view of the above problems, the present application proposes an information recommendation method, device and electronic device to improve the above problems.
[0004] In a first aspect, the present application provides an information recommendation method, which is applied to an electronic device, and the method includes: obtaining information to be inferred, wherein the information to be inferred represents the intention of a user; based on the information to be inferred, a memory bank and a large language model, obtaining a target memory, wherein the target memory is a memory in the memory bank related to the intention, and the target memory includes the user's long-term memory and / or short-term memory, wherein the long-term memory represents the user's long-term habits, and the short-term memory represents the user's recent behavior; based on the information to be inferred, the target memory and the large language model, obtaining recommended information corresponding to the intention.
[0005] In a second aspect, the present application provides an information recommendation device that runs on an electronic device, the device comprising: an information to be inferred acquisition unit, used to acquire information to be inferred, the information to be inferred representing the user's intention; a target memory acquisition unit, used to obtain a target memory based on the information to be inferred, a memory library and a large language model, the target memory being a memory related to the intention, the target memory including the user's long-term memory and / or short-term memory, the long-term memory representing the user's long-term habits, and the short-term memory representing the user's recent behavior; a recommended information acquisition unit, used to obtain recommended information corresponding to the intention based on the information to be inferred, the target memory and the large language model.
[0006] In a third aspect, the present application provides an electronic device comprising one or more processors and a memory; one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the above-mentioned method.
[0007] In a fourth aspect, the present application provides a computer-readable storage medium, in which program code is stored, wherein the above method is executed when the program code is run.
[0008] The present application provides an information recommendation method, device, electronic device and storage medium. After obtaining information to be inferred that represents the user's intention, based on the information to be inferred, the memory bank and the large language model, the target memory in the memory bank related to the intention, including long-term memory representing the user's long-term habits and / or short-term memory, is obtained. The target memory includes long-term memory representing the user's long-term habits and / or short-term memory representing the user's recent behavior. Based on the information to be inferred, the target memory and the large language model, the recommended information corresponding to the intention is obtained. Through the above-mentioned method, the target memory related to the intention can be firstly screened out from the memory bank based on the information to be inferred that represents the user's intention, the memory bank and the large language model, and then the recommended information corresponding to the intention can be obtained based on the information to be inferred, the target memory, the service list and the large language model, so that the recommended information that is more in line with the user's intention and the user's personality can be obtained based on the long-term memory and / or short-term memory related to the intention, thereby improving the accuracy of the recommended information. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0010] Figure 1 A flowchart of an information recommendation method proposed in an embodiment of the present application is shown;
[0011] Figure 2 A schematic diagram of obtaining information to be inferred proposed by the present application is shown;
[0012] Figure 3 A schematic diagram of acquiring target memory through a large language model proposed in the present application is shown;
[0013] Figure 4 A schematic diagram of obtaining recommendation information through a large language model proposed in the present application is shown;
[0014] Figure 5 A schematic diagram of obtaining target recommendation information through a large language model proposed in the present application is shown;
[0015] Figure 6 A schematic diagram of obtaining service recommendation information through a large language model proposed in this application is shown;
[0016] Figure 7 A flowchart of an information recommendation method proposed in another embodiment of the present application is shown;
[0017] Figure 8 A schematic diagram of generating long-term memory through a large language model proposed in the present application is shown;
[0018] Fig. 9 A schematic diagram of an information recommendation system proposed in this application is shown;
[0019] Fig.10 A schematic diagram showing the workflow of an information recommendation system proposed in this application is shown;
[0020] Fig.11 A structural block diagram of an information recommendation device proposed in an embodiment of the present application is shown;
[0021] Fig.12 A structural block diagram of an electronic device proposed in this application is shown;
[0022] Fig.13 It is a storage unit of an embodiment of the present application for storing or carrying a program code for implementing the information recommendation method according to an embodiment of the present application. DETAILED DESCRIPTION
[0023] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0024] With the advancement of science and technology and the improvement of people's living standards, people's daily lives are becoming more and more abundant. For example, online shopping, traveling, and watching short videos will generate a large amount of data based on various behaviors in daily life. These data can contain and reflect the user's personality, preferences, tendencies, etc. In a related way, big data can be used to analyze user preferences from these data, and recommend information that may be of interest to users based on their preferences.
[0025] The inventors found in relevant research that the relevant information recommendation methods still have the problem of inaccurate information recommendation.
[0026] Therefore, the inventor proposes an information recommendation method, device and electronic device in the present application. After obtaining the information to be inferred that represents the user's intention, based on the information to be inferred, the memory bank and the large language model, the target memory in the memory bank related to the intention, including the long-term memory representing the user's long-term habits and / or the short-term memory, is obtained. The target memory includes the user's long-term memory and / or the short-term memory representing the user's recent behavior. Based on the information to be inferred, the target memory and the large language model, the recommended information corresponding to the intention is obtained. Through the above-mentioned method, the target memory related to the intention can be firstly screened out from the memory bank based on the information to be inferred that represents the user's intention, the memory bank and the large language model, and then the recommended information corresponding to the intention can be obtained based on the information to be inferred, the target memory, the service list and the large language model. Therefore, based on the long-term memory and / or short-term memory related to the intention, the recommended information that is more in line with the user's intention and the user's personality can be obtained, thereby improving the accuracy of the recommended information.
[0027] In order to better understand the solutions of the embodiments of the present application, the technical terms used in the embodiments of the present application are explained below.
[0028] LLM (Large Language Model): refers to a deep learning model trained with a large amount of text data. LLM can generate natural language text or understand the meaning of language text. It is usually used to process a variety of natural language tasks, such as text classification, question answering, dialogue, etc. Exemplarily, the large language model can be a ChatGPT (Chat Generative Pre-trained Transformer) model.
[0029] ICL (In-Context Learning): It can refer to a method of estimating the conditional probability distribution model given an example using a well-trained language model. ICL can give the language model a "prompt", which can be a list of input-output pairs. An input-output pair can be an example that can be used to describe a task. At the end of the prompt, there can be a test input, and the language model can predict the corresponding output only by conditional on the prompt.
[0030] The embodiments of the present application will be described below with reference to the accompanying drawings.
[0031] See also Figure 1 , an information recommendation method provided by an embodiment of the present application is applied to an electronic device, the method comprising:
[0032] S110: Acquire information to be inferred, where the information to be inferred represents the user's intention.
[0033] The information to be inferred (Query) may refer to a reference for generating recommended information, and the user's intention may refer to the user's intention to achieve a certain purpose. For example, when the information to be inferred is that the user is going to Beijing for a three-day business trip next Monday, the user's intention may be a business trip.
[0034] As a method, users can directly input the information to be inferred into electronic devices (such as mobile phones, computers, tablets, smart control devices with screens, etc.).
[0035] Optionally, the user can directly input the information to be inferred to the electronic device through voice interaction. For example, the electronic device can be provided with a voice assistant, and the user can call the name of the voice assistant, and after receiving a response from the voice assistant, the user can directly inform the voice assistant of the information to be inferred through voice.
[0036] Optionally, the user can directly input the information to be inferred into the electronic device through voice interaction. Figure 2 As shown in the left picture, the screen of the electronic device can display cards such as smart recommendations and map navigation. Users can enter by clicking on the smart recommendation card. Figure 2 The right figure shows the input interface for information to be inferred, and the information to be inferred is directly input into the interface by text input.
[0037] As another way, the user can indirectly input the information to be inferred to the electronic device through other devices. For example, the user can wear a VR (Virtual Reality) device (such as VR glasses, etc.), which can make the content displayed by the electronic device three-dimensional, and the user can select the content in the electronic device through head movement, etc. When the user selects a card representing a smart recommendation, the user can enter the input interface of the information to be inferred to input the information to be inferred through gestures, etc.
[0038] S120: Based on the information to be inferred, the memory bank and the large language model, a target memory is obtained, where the target memory is the memory in the memory bank that is related to the intention, and the target memory includes the long-term memory and / or short-term memory of the user, where the long-term memory represents the long-term habits of the user, and the short-term memory represents the recent behavior of the user.
[0039] The memory bank can be used to store the user's long-term memory and short-term memory based on the user's historical behavior data. Long-term habits can represent the user's natural habits, long-term hobbies, behavioral tendencies, etc., and recent behaviors can represent the user's random behaviors, recent hot spots, recent points of interest, etc.
[0040] As a method, a pre-set target memory extraction example can be obtained; the target memory extraction example, the information to be inferred and the memory library are input into the large language model to obtain the target memory.
[0041] Among them, the target memory extraction example (Prompt) can be an input-output pair used to prompt how to perform target memory extraction. This input-output pair can enable the large language model to learn the relationship between input and output, and based on the learned relationship between input and output and input content (information to be inferred and memory library), obtain the output content (target memory) corresponding to the input content.
[0042] For example, Figure 3 As shown, the target memory extraction example can be "LLM input: user memory: ...LLM output: ... recently queried the weather in Beijing next week and browsed Beijing attractions." The target memory extraction example, the information to be inferred, and the memory library are input into the large language model to obtain the target memory.
[0043] Optionally, since Prompt can enable the large language model to learn the logical relationship between input and output, and the logical relationship between input and output in tasks of the same type has a certain similarity, the corresponding Prompt can be pre-set based on the needs of different types of tasks, and the pre-set corresponding Prompt can be stored in a specified location. During task execution, the Prompt corresponding to the current task is obtained from the specified location.
[0044] In an embodiment of the present application, by combining ICL with a large language model, that is, inputting the target memory extraction example together with the information to be inferred and the memory library into the large language model to obtain the target memory, the large model can learn the association between the input and output pairs through the target memory extraction example, and obtain the target memory based on the association. Compared with directly inputting the information to be inferred and the memory library into the large language model to obtain the target memory, the accuracy of the target memory can be improved, thereby improving the accuracy of the recommended information.
[0045] S130: Based on the information to be inferred, the target memory and the large language model, obtain recommendation information corresponding to the intention.
[0046] The recommendation information may include service recommendation information and / or text information and / or web page information, etc. The service recommendation information may include services corresponding to the intention. For example, if the user's intention may be to travel, the service recommendation information may include ticket booking services, hotel reservation services, map navigation services, etc. The text information may include text content corresponding to the intention. For example, if the user's intention may be to understand the difference between a green peacock and a blue peacock, the text information may be the difference between a green peacock and a blue peacock. The web page information may include a web page link address corresponding to the intention. For example, if the user's intention may be to log in to a XX web page, the web page information may be a web page link address corresponding to the XX web page, so that the user can enter the XX web page by clicking on the web page link address.
[0047] As a method, the recommendation information output examples, the information to be inferred, and the target memory can be input into the large language model to obtain the recommendation information corresponding to the intent.
[0048] The recommendation information output example (Prompt) may be an input-output pair for prompting how to output the recommendation information.
[0049] For example, Figure 4 As shown, an example of recommendation information output can be "LLM input: user memory: ...LLM output: ... recently queried the climate in Beijing next week and browsed Beijing attractions." The example of recommendation information output, the information to be inferred and the target memory are input into the large language model to obtain the recommendation information.
[0050] Optionally, the electronic device may present the recommendation information in the form of text on the screen of the electronic device to inform the user of the recommendation information; the recommendation information may also be informed to the user in the form of voice broadcast.
[0051] As a method, after informing the user of the recommended information, feedback information input by the user can be obtained; if the feedback information indicates that the recommended information should be modified, the feedback information, the recommended information, the target memory and the recommended information are input into the large language model to obtain the target recommended information corresponding to the feedback information. Among them, modifying the recommended information can be understood as adding, reducing or changing the content of the recommended information.
[0052] For example, Figure 5 As shown, when the user's feedback information is "Take the subway to the hotel instead of a taxi", the 7th item in the recommendation information can be changed from "After arriving at the destination, we will find an online taxi for you to go to the booked hotel." to "After arriving at the destination, we will turn on the navigation for you and take the subway in the station to the booked hotel."
[0053] Optionally, the memory bank can be updated based on the information to be inferred and the target recommendation information.
[0054] In the embodiment of the present application, the recommended information can be adjusted in real time based on the user's feedback information, thereby improving the flexibility of information recommendation.
[0055] Optionally, if the feedback information indicates that the service recommendation information matches the intent, the electronic device may exit the current process and store the information to be inferred and the recommended information as interaction data to update the memory base based on the interaction data.
[0056] As a way, when the recommendation information is service recommendation information, the service recommendation information can be obtained based on the information to be inferred, the target memory, the service list and the large language model.
[0057] Among them, the service list may include services that the electronic device can provide. The services that the electronic device can provide may include weather conditions, flight tickets, attraction introductions, food recommendations, information services, etc. Information services may refer to providing private service information related to the user, such as the phone number of a person in the address book, etc.
[0058] Optionally, the service recommendation information may be notified to the user, and feedback information input by the user may be obtained. If the feedback information indicates that the service recommendation information matches the intent, the service corresponding to the service recommendation information is executed, thereby improving the intelligence level of information recommendation.
[0059] For example, Figure 6 As shown, the information to be inferred may be "What should I eat tonight? Please arrange it for me." The large language model can obtain the service recommendation information "OK. Based on your taste preferences, I recommend a Sichuan restaurant. ... Pacific Cinema is located on the fifth floor. Are you satisfied with this arrangement?" based on the information to be inferred, the target memory, the service list and the large language model. When the user feedback information is satisfactory, it indicates that the service recommendation information is correct, and the user can be further confirmed whether to reserve a seat and movie tickets. If the user agrees, services related to the reservation of seats and movie tickets can be executed, for example, the merchant phone number is obtained through a food-related application, and the merchant is called to reserve a seat.
[0060] In the embodiment of the present application, by using a large language model to understand the user's historical behavior and summarize it into long-term and short-term memory, more accurate service recommendation information can be obtained, that is, a more comprehensive service arrangement that is more in line with the user's personality and current needs can be obtained.
[0061] The present embodiment provides an information recommendation method, after obtaining information to be inferred representing the user's intention, based on the information to be inferred, the memory bank and the large language model, obtains target memory in the memory bank related to the intention, including long-term memory representing the user's long-term habits and / or short-term memory, wherein the target memory includes the user's long-term memory and / or short-term memory representing the user's recent behavior, and obtains recommendation information corresponding to the intention based on the information to be inferred, the target memory and the large language model. Through the above-mentioned method, the target memory related to the intention can be firstly screened out from the memory bank based on the information to be inferred representing the user's intention, the memory bank and the large language model, and then the recommendation information corresponding to the intention can be obtained based on the information to be inferred, the target memory, the service list and the large language model, so that the recommendation information that is more in line with the user's intention and the user's personality can be obtained based on the long-term memory and / or short-term memory related to the intention, thereby improving the accuracy of the recommendation information.
[0062] See also Figure 7 , an information recommendation method provided by an embodiment of the present application is applied to an electronic device, the method comprising:
[0063] S210: Acquire historical behavior data of the user.
[0064] As shown in Table 1, the historical behavior data may include one or more of the user's operation data, content data, interaction data, physical trajectory, silent state data and non-silent state data. The operation data may characterize the user's service usage, the content data may characterize the multimedia information browsed by the user, the interaction data may characterize the user's interaction with the electronic device, and the physical trajectory may characterize the user's activity area; the silent state data may characterize the user's physiological data when in a quiet state; and the non-silent state data may characterize the user's physiological data when in motion.
[0065] Table 1
[0066]
[0067]
[0068] As a way, historical behavior data can be obtained based on the operating system corresponding to the electronic device. Taking the Android system as an example, when a user opens the flashlight application that comes with the system, the Android system can respond to the user's operation and start recording the content of the operation (such as: application name, flashlight opening time, duration) through its own system capabilities / accessibility services, and use the recorded content as operation data.
[0069] As another method, the historical behavior data may be obtained based on a third-party application, for example, from an operation log of the third-party application.
[0070] As another way, historical behavior data can be obtained through screen recognition technology. For example, when a user browses an article displayed on the screen of an electronic device, the title and content of the article can be obtained using OCR (Optical Character Recognition) technology in screen recognition technology.
[0071] In the embodiment of the present application, by acquiring a variety of historical data characterizing user behavior, the user's long-term habits and recent behaviors can be analyzed more accurately, thereby improving the accuracy of the recommendation information.
[0072] S220: Obtain a historical behavior data dictionary based on the historical behavior data.
[0073] There may be multiple pieces of historical behavior data.
[0074] As a method, statistical information of the same or similar behaviors in multiple historical behavior data can be obtained. The statistical information may include one or more of the number of occurrences, start time, duration, and content introduction of the behavior; based on the statistical information, a historical behavior data dictionary is obtained.
[0075] The same behavior can be understood as a behavior with the same purpose and operation content. The operation content can be controlling the control in the application, browsing the specific content of the information, purchasing goods, etc. For example, the user's behavior at time t1: opening the control A1 of application A, and the behavior at time t2: opening the control A1 of application A, can be the same behavior. Similar behaviors can be understood as behaviors with the same purpose but different operation contents. For example, the user's behavior at time t3: browsing the third chapter of XX article, and the behavior at time t4: browsing the tenth chapter of XX article, can be similar behaviors.
[0076] Exemplarily, the historical behavior data dictionary may be as shown in Table 2.
[0077] Table 2
[0078]
[0079]
[0080]
[0081] Optionally, after the historical behavior data dictionary is generated, the historical behavior data dictionary may be stored, and the corresponding historical behavior data may be deleted.
[0082] In an embodiment of the present application, by obtaining a historical behavior data dictionary based on historical behavior data, it is possible to further extract potentially useful information contained in the historical behavior data and compress the storage space, thereby generating a more accurate memory library based on the further extracted information and reducing storage costs.
[0083] S230: Generate the memory base based on the historical behavior data dictionary.
[0084] As a method, a long-term behavior data dictionary and a short-term behavior data dictionary can be obtained from the historical behavior data dictionary based on the first time period and the second time period respectively; long-term memory can be generated based on the long-term behavior data dictionary and the large language model; short-term memory can be generated based on the short-term behavior data dictionary and the large language model; and a memory bank can be obtained based on the long-term memory and the short-term memory.
[0085] The length of the first time period may be greater than the length of the second time period. For example, the length of the first time period may be one week, and the length of the second time period may be one day.
[0086] Optionally, a long-term behavior data dictionary and a short-term behavior data dictionary may be obtained based on the start time, the first time period, and the second time period in the historical behavior data dictionary.
[0087] Optionally, long-term behavior data can be obtained based on the start time and the first time period in the historical behavior data dictionary, and a long-term behavior data dictionary can be obtained based on the long-term behavior data. The long-term behavior data can be obtained from the historical behavior data dictionary based on the start time, and the historical behavior data occurs within the first time period of the current moment. For example, the current moment is October 23rd at 0:0:00, the first time period can be 7 days, and the start time in the historical behavior data dictionary can include: {Behavior 1: October 22nd at 0:0:00; Behavior 2: October 21st at 6:0:00; Behavior 3: October 10th at 8:0:00}, then the long-term behavior data can be {Behavior 1: October 22nd at 0:0:00; Behavior 2: October 21st at 6:0:00}.
[0088] Optionally, short-term behavior data can be obtained based on the start time and the second time period in the historical behavior data dictionary, and the long-term behavior data dictionary can be obtained based on the start time from the historical behavior data dictionary and occurring within the second time period from the current time.
[0089] In an embodiment of the present application, the historical behavior data dictionary may be generated periodically. The period of generating the historical behavior data dictionary may be greater than or equal to the first time period. For example, the first time period may be one week, and the period of generating the historical behavior data dictionary may be one month or half a month.
[0090] Optionally, the long-term behavior data dictionary / short-term behavior data dictionary can be input into the large language model to generate long-term memory / short-term memory. Figure 8 An implementation method for generating long-term memory is shown. The input long-term behavior data dictionary can be obtained based on the historical behavior data dictionary shown in Table 2, and the long-term memory can be as shown in Table 3.
[0091] Table 3
[0092]
[0093]
[0094]
[0095] Optionally, the long-term memory and the short-term memory may be stored to obtain a memory bank, and the corresponding long-term behavior data dictionary and short-term behavior data dictionary may be deleted at the same time.
[0096] In the embodiment of the present application, by generating a memory library based on the historical behavior data dictionary, it is possible to further extract the potentially useful information of the user's historical behavior data according to time windows of different lengths to generate a memory library covering the user's long-term habits and short-term behaviors, thereby facilitating the acquisition of more user-friendly recommendation information based on the memory library. Moreover, generating a memory library based on the historical behavior data dictionary can further reduce storage costs, and can also avoid the situation where the recommendation information cannot be obtained due to the limited length of the input text of the large language model.
[0097] Optionally, after the memory bank is generated for the first time, the memory bank may be updated based on the update cycles corresponding to the long-term memory and the short-term memory, respectively, to ensure that the content of the memory bank is in real time in line with the user behavior.
[0098] Among them, the update period of the long-term memory can be the same as the length of the first time period, and the update period of the short-term memory can be the same as the length of the second time period.
[0099] In the embodiments of the present application, the update of memory may be a replacement update and / or an incremental update. A replacement update may refer to replacing the previous memory base based on the currently generated memory. For example, if the previous memory base is ABC and the currently generated memory is DEF, ABC is directly overwritten with DEF, and the updated memory base is DEF. An incremental update may refer to adding the content of the currently generated memory that is different from the previous memory base to the previous memory base. For example, if the previous memory base is ABC and the currently generated memory is BEF, the updated memory base is ABCEF.
[0100] Optionally, the short-term memory may be updated by replacing the memory. The long-term memory may be updated by a variety of methods.
[0101] As a way to update long-term memory, long-term memory can be updated by replacement update, thereby saving storage space.
[0102] As another way to update long-term memory, long-term memory can be updated through incremental updating, so that more long-term memory can be obtained, which is conducive to screening out more accurate target memory.
[0103] As another way to update long-term memory, long-term memory may be updated based on a combination of replacement update and incremental update.
[0104] Optionally, after each generation of long-term memory, the similarity between the long-term memory generated this time and the long-term memory generated last time can be obtained, and the update method of the current long-term memory can be determined based on the similarity. If the similarity is less than a preset value, it indicates that the user's long-term habits (interests and hobbies, etc.) have begun to change significantly. In order to avoid the previous long-term habits affecting the accuracy of the recommended information obtained after the long-term habits have changed, it can be determined that the update method of the current long-term memory is replacement update; if the similarity is greater than or equal to the preset value, it indicates that the user's long-term habits (interests and hobbies, etc.) have not changed much. In order to more accurately determine the user's long-term habits, it can be determined that the update method of the current long-term memory is incremental update.
[0105] Optionally, the preset similarity can be obtained based on multiple experiments, for example, 60%. The text can be converted into vectors, and the similarity between two adjacent long-term memories can be determined based on a similarity metric between vectors (such as Euclidean distance, cosine distance, etc.).
[0106] Optionally, the large language model can be guided to update long-term memory and short-term memory by setting different examples (prompts). Exemplarily, the example of replacement update can be "LLM input: last short-term memory {ABC}; current short-term memory {DEF}, LLM output: updated short-term memory {DEF}". The example of replacement update can be "LLM input: last short-term memory {ABC}; current short-term memory {BEF}, LLM output: updated short-term memory {ABCEF}".
[0107] Optionally, in order to further reduce the storage pressure of the electronic device, the memory bank can be stored in the cloud, and when the information to be recommended is received, the memory bank is directly obtained from the cloud.
[0108] S240: Acquire information to be inferred, where the information to be inferred represents the user's intention.
[0109] S250: Based on the information to be inferred, the memory bank and the large language model, a target memory is obtained, where the target memory is the memory in the memory bank that is related to the intention, and the target memory includes the user's long-term memory and / or short-term memory, where the long-term memory represents the user's long-term habits, and the short-term memory represents the user's recent behavior.
[0110] S260: Based on the information to be inferred, the target memory and the large language model, obtain recommendation information corresponding to the intention.
[0111] The information recommendation method provided in this embodiment can firstly select the target memory related to the intention from the memory based on the information to be inferred, the memory bank and the large language model representing the user's intention, and then obtain the recommended information corresponding to the intention based on the information to be inferred, the target memory, the service list and the large language model, so that the recommended information that is more in line with the user's intention and the user's personality can be obtained based on the long-term memory and / or short-term memory related to the intention, thereby improving the accuracy of the recommended information. In addition, in this embodiment, the historical behavior data is first converted into a historical behavior data dictionary, so that the user's historical behavior can be recorded in a running account manner, reducing the overhead of the historical behavior data storage space; then the memory bank is obtained based on the historical behavior data dictionary, and the understanding of the historical behavior data dictionary is summarized into natural language memory, further reducing the overhead of storage space.
[0112] See also Fig. 9The present application provides an information recommendation system 10, which may include multiple modules. The behavior acquisition module 101 may acquire the historical behavior data of the user; the behavior statistics module 103 may generate a historical behavior data dictionary based on the historical behavior data; the memory formation module 105 may generate long-term memory and short-term memory based on the historical behavior data dictionary; the memory preservation module 107 may obtain a memory bank based on the long-term memory and short-term memory; the memory screening module 109 may obtain a target memory based on the memory bank and the information to be inferred; the comprehensive understanding module 111 may generate recommendation information based on the information to be inferred and the target memory; the recommendation information output module 113 may inform the user of the recommendation information and accept the user's feedback information; the recommendation information adjustment module 115 may adjust the generated recommendation information based on the user's feedback information; and the execution module 117 may execute related services based on the recommendation information.
[0113] Taking the recommended information as service recommendation information as an example, the workflow of the information recommendation system 10 can be as follows: Fig.10 As shown. Fig.10 In the example, the information recommendation system 10 can first obtain the user's historical behavior data, generate a historical behavior data dictionary based on the historical behavior data, and then generate and save / update the memory based on the scenario learning technology, the historical behavior data dictionary and the large language model to obtain the user's memory bank. After obtaining the memory bank, the target memory can be obtained based on the acquired information to be inferred, the memory bank, the scenario learning technology and the large language model; then, the service recommendation information is generated and output based on the information to be inferred, the target memory, the service list, the scenario learning technology and the large language model.
[0114] See also Fig.11 The present application provides an information recommendation device 600, which runs on an electronic device. The device 600 includes:
[0115] The information to be inferred obtaining unit 610 is used to obtain the information to be inferred, where the information to be inferred represents the intention of the user.
[0116] The target memory acquisition unit 620 is used to obtain the target memory based on the information to be inferred, the memory library and the large language model. The target memory is the memory related to the intention. The target memory includes the user's long-term memory and / or short-term memory. The long-term memory represents the user's long-term habits, and the short-term memory represents the user's recent behavior.
[0117] The recommendation information acquisition unit 630 is used to obtain recommendation information corresponding to the intention based on the information to be inferred, the target memory and the large language model.
[0118] As a method, the relationship acquisition unit 640 is specifically used to obtain a preset target memory extraction example; input the target memory extraction example, the information to be inferred and the memory library into the large language model to obtain the target memory.
[0119] As a method, the recommendation information acquisition unit 630 is specifically used to obtain feedback information input by the user; if the feedback information indicates to modify the recommendation information, the feedback information, the recommendation information and the target memory are input into the large language model to obtain the target recommendation information corresponding to the feedback information.
[0120] Optionally, the recommendation information includes service recommendation information, and the service recommendation information includes a service corresponding to the intent. The recommendation information acquisition unit 630 is specifically used to obtain the service recommendation information based on the information to be inferred, the target memory, the service list and the large language model, and the service list includes services that can be provided by the electronic device; if the feedback information indicates that the service recommendation matches the intent, execute the service corresponding to the service recommendation information.
[0121] The device 600 further includes:
[0122] The memory base generation unit 640 is used to obtain the historical behavior data of the user; obtain a historical behavior data dictionary based on the historical behavior data; and generate the memory base based on the historical behavior data dictionary.
[0123] The memory updating unit 650 is used to update the memory based on the information to be inferred and the target recommendation information.
[0124] As a method, the memory generation unit 640 is specifically used to obtain statistical information of the same or similar behaviors in the multiple historical behavior data, and the statistical information includes one or more of the number of occurrences, start time, duration, and content introduction of the behavior; based on the statistical information, the historical behavior data dictionary is obtained.
[0125] As a method, the memory bank generation unit 640 is specifically used to obtain a long-term behavior data dictionary and a short-term behavior data dictionary from the historical behavior data dictionary based on a first time period and a second time period, respectively, wherein the length of the first time period is greater than the length of the second time period; based on the long-term behavior data dictionary and the large language model, generate the long-term memory; based on the short-term behavior data dictionary and the large language model, generate the short-term memory; based on the long-term memory and the short-term memory, obtain the memory bank.
[0126] Optionally, the historical behavior data includes one or more of the user's operation data, content data, interaction data, physical trajectory, silent state data and non-silent state data, the operation data characterizes the user's service usage, the content data characterizes the multimedia information browsed by the user, the interaction data characterizes the interaction between the user and the electronic device, and the physical trajectory characterizes the user's activity area; the silent state data characterizes the physiological data of the user when in a quiet state; and the non-silent state data characterizes the physiological data of the user when in motion.
[0127] The following will be combined Fig.12 An electronic device provided by the present application is described.
[0128] See also Fig.12 Based on the above information recommendation method and device, the embodiment of the present application also provides another electronic device 100 that can execute the above information recommendation method. The electronic device 100 includes a processor 102 and a memory 104, wherein the memory 104 stores a program that can execute the content of the above embodiment, and the processor 102 can execute the program stored in the memory 104.
[0129] Among them, the processor 102 may include one or more processing cores. The processor 102 uses various interfaces and lines to connect various parts within the entire electronic device 100, and executes various functions and processes data of the electronic device 100 by running or executing instructions, programs, code sets or instruction sets stored in the memory 104, and calling data stored in the memory 104. Optionally, the processor 102 can be implemented in at least one hardware form of a network processor (Neural network Processing Unit, NPU), a digital signal processing (Digital Signal Processing, DSP), a field programmable gate array (Field-Programmable Gate Array, FPGA), and a programmable logic array (Programmable Logic Array, PLA). The processor 102 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processor (Graphics Processing Unit, GPU), a network processor (Neural network Processing Unit, NPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing display content; the NPU is responsible for processing multimedia data such as video and images; and the modem is used to process wireless communications. It is understandable that the above-mentioned modem may not be integrated into the processor 102, but may be implemented separately through a communication chip.
[0130] The memory 104 may include a random access memory (RAM), and may also include a read-only memory (RAM) and a double data rate synchronous dynamic random access memory (DDR). The memory 104 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 104 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc. The data storage area may also store data (such as a phone book, audio and video data, chat record data) created by the electronic device 100 during use.
[0131] Please refer to Fig.13, which shows a structural block diagram of a computer-readable storage medium provided in an embodiment of the present application. The computer-readable storage medium 800 stores program codes, which can be called by a processor to execute the method described in the above method embodiment.
[0132] The computer readable storage medium 800 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk, or a ROM. Optionally, the computer readable storage medium 800 includes a non-transitory computer-readable storage medium. The computer readable storage medium 800 has storage space for program code 810 that performs any method step in the above method. These program codes can be read from or written to one or more computer program products. The program code 810 can be compressed, for example, in an appropriate form.
[0133] In summary, the present application provides an information recommendation method, device, and electronic device. After acquiring information to be inferred that represents the user's intention, based on the information to be inferred, the memory bank, and the large language model, the target memory in the memory bank related to the intention, including long-term memory representing the user's long-term habits and / or short-term memory, the target memory includes the user's long-term memory and / or short-term memory representing the user's recent behavior, and based on the information to be inferred, the target memory, and the large language model, the recommended information corresponding to the intention is obtained. Through the above-mentioned method, the target memory related to the intention can be firstly screened out from the memory bank based on the information to be inferred that represents the user's intention, the memory bank, and the large language model, and then the recommended information corresponding to the intention can be obtained based on the information to be inferred, the target memory, the service list, and the large language model, so that the recommended information that is more in line with the user's intention and the user's personality can be obtained based on the long-term memory and / or short-term memory related to the intention, thereby improving the accuracy of the recommended information.
[0134] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. An information recommendation method, characterized in that: Applied to electronic equipment, the method comprises: Acquiring information to be inferred, where the information to be inferred represents the intention of the user; Based on the information to be inferred, the memory bank and the large language model, a target memory is obtained, where the target memory is a memory in the memory bank related to the intention, and the target memory includes the long-term memory and / or short-term memory of the user, where the long-term memory represents the long-term habits of the user, and the short-term memory represents the recent behavior of the user; Based on the information to be inferred, the target memory and the large language model, recommendation information corresponding to the intention is obtained.
2. The method according to claim 1, characterized in that The step of obtaining a target memory based on the information to be inferred, the memory bank and the pre-trained large language model includes: Get a pre-set target memory retrieval example; The target memory extraction example, the information to be inferred and the memory library are input into the large language model to obtain the target memory.
3. The method according to claim 1, characterized in that After obtaining the recommendation information corresponding to the intention based on the information to be inferred, the target memory and the large language model, the method further includes: Get feedback from user input; If the feedback information indicates that the recommendation information is to be modified, the feedback information, the recommendation information and the target memory are input into the large language model to obtain the target recommendation information corresponding to the feedback information.
4. The method according to claim 3, characterized in that If the feedback information is to modify the recommendation information, after inputting the feedback information, the recommendation information and the target memory into the large language model to obtain the target recommendation information corresponding to the feedback information, the method further includes: Based on the information to be inferred and the target recommendation information, the memory library is updated.
5. The method according to claim 3, characterized in that: The recommendation information includes service recommendation information, the service recommendation information includes services corresponding to the intent, and obtaining the recommendation information corresponding to the intent based on the information to be inferred, the target memory and the large language model includes: Based on the information to be inferred, the target memory, the service list and the large language model, the service recommendation information is obtained, wherein the service list includes services that the electronic device can provide; The method further comprises: If the feedback information indicates that the service recommendation information matches the intention, the service corresponding to the service recommendation information is executed.
6. The method according to claim 1, characterized in that Before obtaining the information to be inferred, the method further includes: Obtaining historical behavior data of the user; Based on the historical behavior data, obtaining a historical behavior data dictionary; The memory library is generated based on the historical behavior data dictionary.
7. The method according to claim 6, characterized in that The historical behavior data includes one or more of the user's operation data, content data, interaction data, physical trajectory, silent state data and non-silent state data; The operation data represents the service usage of the user, the content data represents the multimedia information browsed by the user; the interaction data represents the interaction between the user and the electronic device; the physical track represents the activity area of the user; The silent state data represents the physiological data of the user when the user is in a silent state; The non-silent state data represents the physiological data of the user when the user is in motion.
8. The method according to claim 6, characterized in that The historical behavior data has multiple pieces, and the historical behavior data dictionary is obtained based on the historical behavior data, including: Obtaining statistical information of the same or similar behaviors in the plurality of historical behavior data, the statistical information including one or more of the number of occurrences, start time, duration, and content introduction of the behaviors; Based on the statistical information, the historical behavior data dictionary is obtained.
9. The method according to claim 6, characterized in that The step of generating the memory base based on the historical behavior data dictionary includes: Acquire a long-term behavior data dictionary and a short-term behavior data dictionary from the historical behavior data dictionary based on a first time period and a second time period, respectively, wherein the length of the first time period is greater than the length of the second time period; generating the long-term memory based on the long-term behavior data dictionary and the large language model; generating the short-term memory based on the short-term behavior data dictionary and the large language model; Based on the long-term memory and the short-term memory, the memory bank is obtained.
10. An information recommendation device, characterized in that: Running on an electronic device, the device comprises: An information-to-be-reasoned acquisition unit, used to acquire information to be reasoned, wherein the information to be reasoned represents the intention of the user; a target memory acquisition unit, configured to obtain a target memory based on the information to be inferred, the memory library and the large language model, wherein the target memory is a memory related to the intention, and includes the user's long-term memory and / or short-term memory, wherein the long-term memory represents the user's long-term habits, and the short-term memory represents the user's recent behavior; A recommendation information acquisition unit is used to obtain recommendation information corresponding to the intention based on the information to be inferred, the target memory and the large language model.
11. An electronic device, characterized in that: comprising one or more processors and memory; One or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the method according to any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program code, wherein when the program code is run, the method according to any one of claims 1 to 9 is executed.
Citation Information
Cited By
Recommendation information generation method and device based on anthropomorphic agent and electronic equipment
CN120508838A
Federal dynamic multi-modal memory recommendation method, computer equipment and computer program product
CN121934722A
Federal dynamic multi-modal memory recommendation method, computer device and computer program product
CN121934722B