Message acquisition method and device, electronic equipment and storage medium
By parsing the query statement and processing the filtered words, and combining the large language model to generate response messages, the problem of accuracy and efficiency in message retrieval in office scenarios is solved, and fast and accurate message retrieval is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING BAIDU NETCOM SCI & TECH CO LTD
- Filing Date
- 2023-04-26
- Publication Date
- 2026-07-24
AI Technical Summary
In office settings, the volume of messages is enormous and the sorting is often unreasonable, making it difficult for existing technologies to quickly and accurately obtain the messages that users need.
By parsing the query statement, keywords and filter words are determined. Combined with a large language model such as the GPT model, message search and filtering are performed to obtain the context dialogue and generate response messages.
It enables the rapid and accurate retrieval of messages needed by users, reduces the number of recalled messages, and improves the speed and accuracy of output results.
Smart Images

Figure CN116483972B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of artificial intelligence technology, specifically to deep learning and natural language processing technology, and particularly to a method, apparatus, electronic device, and storage medium for acquiring messages. Background Technology
[0002] In an office setting, a rapid stream of instant messaging messages is generated daily. The sheer volume of these messages makes message retrieval a significant challenge.
[0003] In related technologies, messages containing specific keywords are typically retrieved using exact matching based on user-input keywords. However, due to the large volume and illogical sorting of messages, this method often fails to quickly and accurately obtain the messages the user needs. Summary of the Invention
[0004] A method, apparatus, electronic device, and storage medium for obtaining messages are provided.
[0005] According to a first aspect, a method for obtaining a message is provided, comprising: parsing a query statement to determine keywords and filter words in the query statement; performing a message search in a message record based on the keywords to obtain a first message; filtering the first message based on the filter words to obtain a second message; obtaining a context dialogue corresponding to the second message; and generating a response message corresponding to the query statement based on the query statement and the context dialogue.
[0006] According to a second aspect, a message acquisition device is provided, comprising: a parsing module for parsing a query statement to determine keywords and filter words in the query statement; a search module for searching messages in a message record based on the keywords to acquire a first message; a filtering module for filtering the first message based on the filter words to acquire a second message; an acquisition module for acquiring a context dialogue corresponding to the second message; and a generation module for generating a response message corresponding to the query statement based on the query statement and the context dialogue.
[0007] According to a third aspect, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the message acquisition method described in the first aspect of this disclosure.
[0008] According to a fourth aspect, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are used to cause the computer to perform a message acquisition method according to a first aspect of this disclosure.
[0009] According to a fifth aspect, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps of the message acquisition method according to the first aspect of this disclosure.
[0010] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0011] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:
[0012] Figure 1 This is a flowchart illustrating a message acquisition method according to the first embodiment of this disclosure;
[0013] Figure 2 This is a diagram illustrating the search for messages based on keywords and the corresponding contextual dialogue.
[0014] Figure 3 This is a flowchart illustrating a message acquisition method according to a second embodiment of the present disclosure;
[0015] Figure 4 This is an example of a prompt template and response message. Figure 1 ;
[0016] Figure 5 This is an example of a prompt template and response message. Figure 2 ;
[0017] Figure 6 This is a schematic diagram of the overall flow of a message acquisition method according to the third embodiment of this disclosure;
[0018] Figure 7 This is a block diagram of a message acquisition apparatus according to a first embodiment of the present disclosure;
[0019] Figure 8 This is a block diagram of a message acquisition apparatus according to a second embodiment of the present disclosure;
[0020] Figure 9 This is a block diagram of an electronic device used to implement the methods of the embodiments of this disclosure. Detailed Implementation
[0021] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0022] Artificial intelligence (AI) is a technical science that studies and develops theories, methods, technologies, and application systems to simulate, extend, and expand human intelligence. Currently, AI technology has the advantages of high automation, high accuracy, and low cost, and has been widely applied.
[0023] Deep learning (DL) is a new research direction in the field of machine learning (ML). It learns the inherent patterns and hierarchical representations of sample data. The information gained during this learning process greatly aids in interpreting data such as text, images, and sound. Its ultimate goal is to enable machines to possess analytical and learning capabilities like humans, allowing them to recognize text, images, and sound. Specific research areas mainly include convolutional neural networks (CNNs) based on convolutional operations; autoencoder neural networks based on multi-layered neurons; and deep belief networks that are pre-trained using multi-layered autoencoder neural networks and then further optimized by incorporating discriminative information. Deep learning has achieved significant results in search technology, data mining, machine learning, machine translation, natural language processing, multimedia learning, speech recognition, recommendation and personalization technologies, and other related fields. Deep learning enables machines to mimic human activities such as sight, hearing, and thinking, solving many complex pattern recognition problems and leading to significant advancements in artificial intelligence technologies.
[0024] Natural Language Processing (NLP) is a science that studies computer systems, especially their software systems, that can effectively achieve natural language communication. It is an important direction in the fields of computer science and artificial intelligence.
[0025] The following describes, with reference to the accompanying drawings, a method, apparatus, electronic device, and storage medium for obtaining messages according to embodiments of the present disclosure.
[0026] Figure 1 This is a flowchart illustrating a message acquisition method according to a first embodiment of the present disclosure.
[0027] like Figure 1As shown, the message acquisition method of this disclosure embodiment may specifically include the following steps:
[0028] S101, parse the query statement to determine the keywords and filter words in the query statement.
[0029] Specifically, the execution entity of the message acquisition method in this embodiment of the disclosure may be the message acquisition device provided in this embodiment of the disclosure. The message acquisition device may be a hardware device with data information processing capabilities and / or the necessary software required to drive the hardware device. Optionally, the execution entity may include a workstation, server, computer, user terminal, and other devices. The user terminal includes, but is not limited to, mobile phones, computers, intelligent voice interaction devices, smart home appliances, and vehicle terminals.
[0030] In this embodiment of the disclosure, the query statement is used to describe what kind of message the user wants to find in the message record, such as "Zhang San's conclusion about searching for documents in the Super Assistant group the day before yesterday", or "When does the early recruitment for campus recruitment last year end?"
[0031] The query statement must include at least the keywords (terms) used for the query, and may also include some filter words (filters) used to limit the scope of the query. The filter words may include, but are not limited to, at least one of the following information: time information, group information, and personnel information.
[0032] Structured data extraction is performed on user queries to extract keywords and filter terms. Taking the query "Zhang San's conclusion about searching for documents in the Super Assistant group the day before yesterday" as an example, the keywords can be identified as "search for documents", and the filter terms are the time information "the day before yesterday", the group information "Super Assistant group", and the person information "Zhang San".
[0033] S102, search for messages in the message history based on keywords to obtain the first message.
[0034] In this embodiment of the disclosure, message records, also known as chat logs, are historical chat messages stored in instant messaging tools such as WeChat and Ruliu. An online message search is performed in the message records based on the keywords determined in step S101; the messages found that include the keywords are the first messages. For example... Figure 2 As shown, searching online messages in the message history based on the keyword "eat" yields 6 messages, with "eat" being the first one.
[0035] S103, filter the first message according to the filter words to obtain the second message.
[0036] In this embodiment of the disclosure, the first message obtained in step S102 is filtered according to the filter words determined in step S101, and messages in the first message that do not conform to the filter words are filtered out, and messages that conform to the filter words are selected as the second message.
[0037] S104, obtain the context dialogue corresponding to the second message.
[0038] In this embodiment of the disclosure, the second message obtained in step S103, along with a preset number of messages above and below it in the original text, can be used as the context dialogue corresponding to the second message. Context dialogue, for example... Figure 2 As shown, the message "Draw 5 mao, don't eat" and the two messages above "Let's see how much you can win in the lottery" and "5 mao" and the two messages below "How much V gold do you have" and "How much do you have" can be used as the context dialogue corresponding to the message "Draw 5 mao, don't eat".
[0039] S105, Generate the response message corresponding to the query statement based on the query statement and the context dialogue.
[0040] In this embodiment of the disclosure, the query statement can be used as the question, the contextual dialogue as the prompt information, and the answer to the question can be extracted by summarizing the contextual dialogue of the query statement and the second message, that is, the response message corresponding to the query statement.
[0041] For example:
[0042] Query statement (problem): Zhang San's conclusion about searching documents in the Super Assistant group the day before yesterday;
[0043] Response message (answer): According to the chat history of group chat A, Zhang San said in the Super Assistant group the day before yesterday, "Searching for documents is not very available right now." Therefore, Zhang San's conclusion about searching for documents in the Super Assistant group the day before yesterday was "Searching for documents is not very available right now."
[0044] For example:
[0045] Query (Question): When did the early admission period for campus recruitment end last year?
[0046] Response message (answer): According to Qiu's conversation in the Strategy Team group on August 29, 2022, the deadline for the early recruitment of last year's campus recruitment was last Friday (August 26, 2022).
[0047] It should be noted here that when there are too many context dialogues, you can select a preset number, such as 3-5 context dialogues, at the front of the list to generate response messages.
[0048] In summary, the message acquisition method of this disclosure parses a query statement to determine keywords and filter words within the query statement, searches the message record based on the keywords to obtain a first message, filters the first message based on the filter words to obtain a second message, and generates a response message corresponding to the query statement based on the contextual dialogue between the query statement and the second message. This disclosure reduces the number of second messages recalled by filtering the first message retrieved based on keywords, and by summarizing the contextual dialogue of the second message to extract the response message corresponding to the query statement, it can quickly and accurately obtain the message needed by the user.
[0049] Figure 3 This is a flowchart illustrating a message acquisition method according to a second embodiment of the present disclosure.
[0050] like Figure 3 As shown, in Figure 1 Based on the illustrated embodiments, the message acquisition method of this disclosure embodiment may specifically include the following steps:
[0051] The step S101 in the above embodiment, "parse the query statement to determine the keywords and filter words in the query statement", specifically includes the following step S301.
[0052] S301 uses a large language model to parse the query statement in order to determine the keywords and filter words in the query statement.
[0053] In this embodiment, a Large Language Model (LLM), such as a Generative Pre-trained Transformer (GPT) model, can be used to extract structured data from the query statement, thereby extracting keywords and filter words from the query statement. The GPT model is a pre-trained language model that uses the Transformer architecture to handle Natural Language Processing (NLP) tasks. By using large-scale pre-trained data and autonomous learning techniques, the GPT model can capture grammatical rules, common expressions, common contexts, and semantic meanings in natural language, generating human-readable natural language text, such as dialogues, articles, or news reports.
[0054] For example:
[0055] Query statement: Zhang San's conclusion about document searching in the Super Assistant group the day before yesterday;
[0056] Structured data: {'time':'The day before yesterday', 'group':'Super Assistant Group', 'people':'Zhang San', 'main_question':'Conclusion about searching documents', 'main_question_keywords':'Searching for documents'}.
[0057] S302, search for messages in the message history based on keywords to obtain the first message.
[0058] S303, filter the first message according to the filter words to obtain the second message.
[0059] In this embodiment, steps S302 and S303 are the same as steps S102 and S103 in the above embodiments, and will not be repeated here.
[0060] The step S104 "obtaining the context dialogue corresponding to the second message" in the above embodiment may specifically include the following step S304.
[0061] S304 If the number of second messages does not exceed the preset first quantity threshold, then obtain the context dialogue corresponding to the second message.
[0062] In this embodiment of the disclosure, a first quantity threshold can be preset, for example, 10 messages. If the number of second messages obtained in step S303 does not exceed the first quantity threshold, then the second messages are no longer filtered by the crowd intimacy list, and the context dialogue corresponding to the second message is obtained.
[0063] S305, if the number of second messages exceeds the first quantity threshold, then obtain the user's group intimacy list.
[0064] In this embodiment of the disclosure, if the number of second messages obtained in step S303 exceeds the first quantity threshold, it is determined that the number of second messages is too large, and the second messages need to be filtered using the crowd intimacy list. The crowd intimacy list includes close contacts and / or close groups corresponding to the user. For example, the crowd intimacy list of user A is as follows:
[0065] User A's close contacts: [Zhang San, Li Si, Wang Wu, ...;
[0066] User A's close groups: [rd group, dining group, team group, project group, launch group, ...].
[0067] The group intimacy list can be determined based on factors such as the number and frequency of chat messages sent by users.
[0068] S306, Filter the second message based on the group intimacy list to obtain the third message.
[0069] In this embodiment of the disclosure, the second messages are filtered based on the user's group intimacy list obtained in step S305, retaining second messages from contacts and groups with high intimacy with the user. Alternatively, the sorting order of the second messages can be adjusted according to intimacy, suppressing contacts and groups with low intimacy with the user.
[0070] S307, obtain the context dialogue corresponding to the third message.
[0071] In this embodiment of the disclosure, the process of obtaining the context dialogue corresponding to the third message is the same as that of obtaining the context dialogue corresponding to the second message in step S304, and will not be described again here.
[0072] S308, Generate a response message corresponding to the query statement based on the query statement and the context dialogue.
[0073] In this embodiment, step S308 is the same as step S105 in the above embodiment, and will not be described again here.
[0074] Furthermore, step S308 above, "generating a response message corresponding to the query statement based on the query statement and contextual dialogue," may specifically include the following steps: generating a response message corresponding to the query statement based on the query statement, contextual dialogue, and a large language model. Specifically, a prompt template can be generated based on the query statement and contextual dialogue, and this prompt template can be input into a large language model, such as the GPT-4 model, to generate the response message corresponding to the query statement. For example, the prompt template and response message can be as follows: Figure 4 , Figure 5 As shown.
[0075] In summary, the message acquisition method of this disclosure filters the first messages retrieved based on keywords, reducing the number of recalled second messages. Furthermore, by summarizing the context of the second messages and extracting the response messages corresponding to the query, the method can quickly and accurately retrieve the messages the user needs. If the number of recalled second messages is still too large, a third message can be obtained by filtering again based on a user affinity list, further reducing the number of recalled third messages. Again, by summarizing the context of the third messages and extracting the response messages corresponding to the query, the method can retrieve the messages the user needs even faster and more accurately. Using a pre-trained large language model to parse the query and generate the corresponding response messages improves the speed and accuracy of the output results.
[0076] To clearly illustrate the message acquisition method of this disclosure embodiment, the following will be combined with... Figure 6 Provide a detailed description. Figure 6 This is a schematic diagram of the overall process of a message acquisition method according to an embodiment of the present disclosure.
[0077] like Figure 6 As shown, the system retrieves the user's query "Zhang San's conclusion about searching for documents in the Super Assistant group the day before yesterday," and parses the query to extract the time information "the day before yesterday," the group information "Super Assistant group," and the person information "Zhang San" as filter words. The core query is "the conclusion about searching for documents," thus determining the core keyword term "searching for documents." Based on the core keyword term "searching for documents," the system searches the message history to obtain the first message. The first message is then filtered using the filter words "the day before yesterday," "Super Assistant group," and "Zhang San" to obtain the second message. If the number of retrieved second messages is too large (e.g., exceeding the first threshold of 10), the second messages can be filtered based on a group affinity list to obtain the third message. The context and query of the first 3 or 5 (Top 3 / 5) third messages are summarized to extract the corresponding response message.
[0078] Figure 7 This is a block diagram of a message acquisition apparatus according to a first embodiment of the present disclosure.
[0079] like Figure 7 As shown, the message acquisition device 700 of this embodiment includes: a parsing module 701, a searching module 702, a filtering module 703, an acquisition module 704, and a generation module 705. Wherein:
[0080] The parsing module 701 is used to parse the query statement to determine the keywords and filter words in the query statement.
[0081] Search module 702 is used to search for messages in the message record based on keywords in order to obtain the first message.
[0082] The filtering module 703 is used to filter the first message according to the filtering words in order to obtain the second message.
[0083] The acquisition module 704 is used to acquire the context dialogue corresponding to the second message.
[0084] The generation module 705 is used to generate the response message corresponding to the query statement based on the query statement and the context dialogue.
[0085] It should be noted that the above explanation of the message acquisition method embodiments also applies to the message acquisition device of the present disclosure embodiments, and the specific process will not be repeated here.
[0086] In summary, the message acquisition device of this disclosure parses a query statement to determine keywords and filter words in the query statement, searches for messages in the message record based on the keywords to obtain a first message, filters the first message based on the filter words to obtain a second message, and generates a response message corresponding to the query statement based on the contextual dialogue of the query statement and the second message. This disclosure reduces the number of second messages recalled by filtering the first message retrieved based on the keywords, and summarizes and extracts the response message corresponding to the query statement based on the contextual dialogue of the second message, enabling the quick and accurate acquisition of the message needed by the user.
[0087] Figure 8 This is a block diagram of a message acquisition apparatus according to a second embodiment of the present disclosure.
[0088] like Figure 8 As shown, the message acquisition device 800 of this embodiment includes: a parsing module 801, a search module 802, a filtering module 803, an acquisition module 804, and a generation module 805.
[0089] The parsing module 801 has the same structure and function as the parsing module 701 in the previous embodiment, the search module 802 has the same structure and function as the search module 702 in the previous embodiment, the filtering module 803 has the same structure and function as the filtering module 703 in the previous embodiment, the acquisition module 804 has the same structure and function as the acquisition module 704 in the previous embodiment, and the generation module 805 has the same structure and function as the generation module 705 in the previous embodiment.
[0090] Furthermore, the filter words include at least one of the following: time information, group information, and personnel information.
[0091] Furthermore, the acquisition module 804 includes an acquisition unit 8041, used to acquire the context dialogue corresponding to the second message if the number of second messages does not exceed a preset first quantity threshold.
[0092] Furthermore, the generation module 805 is further configured to: if the number of second messages exceeds a first quantity threshold, obtain the user's group intimacy list; filter the second messages according to the group intimacy list to obtain a third message; obtain the context dialogue corresponding to the third message; and generate a response message corresponding to the query statement according to the query statement and the context dialogue.
[0093] Furthermore, the crowd intimacy list includes pre-determined close contacts and / or close groups corresponding to the user.
[0094] Furthermore, the generation module 805 is further used to generate a response message corresponding to the query statement based on the query statement, the context dialogue, and the large language model.
[0095] Furthermore, the generation module 805 is further used to: generate a prompt template based on the query statement and the context dialogue; and input the prompt template into the large language model to generate a response message corresponding to the query statement.
[0096] Furthermore, the large language model is a generative pre-trained converter model.
[0097] Furthermore, the parsing module 801 is further used to: parse the query statement using a large language model to determine the keywords and filter words in the query statement.
[0098] It should be noted that the above explanation of the message acquisition method embodiments also applies to the message acquisition device of the present disclosure embodiments, and the specific process will not be repeated here.
[0099] In summary, the message acquisition device of this embodiment filters the first message retrieved based on keywords, reducing the number of recalled second messages. Furthermore, by summarizing the context of the second message and extracting the response message corresponding to the query, the device can quickly and accurately retrieve the message the user needs. If the number of recalled second messages is still too large, a third message can be obtained by filtering again based on a user affinity list, further reducing the number of recalled third messages. Again, by summarizing the context of the third message and extracting the response message corresponding to the query, the device can retrieve the message the user needs even faster and more accurately. Using a pre-trained large language model to parse the query and generate the response message improves the speed and accuracy of the output results.
[0100] The collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0101] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0102] Figure 9A schematic block diagram of an example electronic device 900 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0103] like Figure 9 As shown, the electronic device 900 includes a computing unit 901, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 902 or a computer program loaded from a storage unit 908 into a random access memory (RAM) 903. The RAM 903 may also store various programs and data required for the operation of the electronic device 900. The computing unit 901, ROM 902, and RAM 903 are interconnected via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.
[0104] Multiple components in electronic device 900 are connected to I / O interface 905, including: input unit 906, such as keyboard, mouse, etc.; output unit 907, such as various types of displays, speakers, etc.; storage unit 908, such as disk, optical disk, etc.; and communication unit 909, such as network card, modem, wireless transceiver, etc. Communication unit 909 allows electronic device 900 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0105] The computing unit 901 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 901 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 901 performs the various methods and processes described above, such as... Figures 1 to 6The method for obtaining messages is illustrated. For example, in some embodiments, the message obtaining method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 908. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 900 via ROM 902 and / or communication unit 909. When the computer program is loaded into RAM 903 and executed by computing unit 901, one or more steps of the semantic parsing method described above may be performed. Alternatively, in other embodiments, computing unit 901 may be configured to perform the message obtaining method by any other suitable means (e.g., by means of firmware).
[0106] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0107] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0108] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0109] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0110] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), the Internet, and blockchain networks.
[0111] Computer systems can include clients and servers. Clients and servers are generally geographically separated and typically interact via communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. A server can be a cloud server, also known as a cloud computing server or cloud host, a hosting product within the cloud computing service system that addresses the management difficulties and weak business scalability inherent in traditional physical hosts and VPS (Virtual Private Server) services. Servers can also be servers for distributed systems or servers incorporating blockchain technology.
[0112] According to embodiments of this disclosure, this disclosure also provides a computer program product, including a computer program, wherein the computer program, when executed by a processor, implements the steps of the message acquisition method shown in the above embodiments of this disclosure.
[0113] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.
[0114] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A method for obtaining a message, comprising: A large language model is used to parse the query statement to determine the keywords and filter words in the query statement; Search the message history for the first message based on the keywords; The first message is filtered according to the filter words to obtain the second message; If the number of the second messages exceeds a preset first threshold, then obtain the user's group intimacy list; filter the second messages according to the group intimacy list to obtain the third message; Obtain the context dialogue corresponding to the third message; as well as Generate a prompt template based on the query statement and the context dialogue; The prompt template is then applied to the large language model to generate the response message corresponding to the query statement.
2. The acquisition method according to claim 1, wherein, The filter words include at least one of the following: Time information, group information, and personnel information.
3. The acquisition method according to claim 1, wherein, The method further includes: If the number of the second messages does not exceed the first quantity threshold, then the context dialogue corresponding to the second message is obtained.
4. The acquisition method according to claim 1, wherein, The group intimacy list includes close contacts and / or close groups corresponding to the user.
5. The method for obtaining according to claim 1, wherein, The large language model is a generative pre-trained converter model.
6. A message acquisition device, comprising: The parsing module is used to parse the query statement using a large language model to determine the keywords and filter words in the query statement; The search module is used to perform online message searches in the message records based on the keywords to obtain the first message; The filtering module is used to filter the first message according to the filtering words to obtain the second message; The acquisition module is used to acquire the user's group intimacy list if the number of the second messages exceeds a preset first quantity threshold. The second message is filtered according to the aforementioned group intimacy list to obtain the third message; Obtain the context dialogue corresponding to the third message; as well as The generation module is used to generate a prompt template based on the query statement and the context dialogue; The prompt template is then applied to the large language model to generate the response message corresponding to the query statement.
7. The acquiring device according to claim 6, wherein, The filter words include at least one of the following: Time information, group information, and personnel information.
8. The acquiring device according to claim 6, wherein, The acquisition module is also used for: If the number of the second messages does not exceed a preset first quantity threshold, then the context dialogue corresponding to the second message is obtained.
9. The acquiring device according to claim 6, wherein, The intimacy list includes pre-determined close contacts and / or close groups corresponding to the user.
10. The acquiring device according to claim 6, wherein, The large language model is a generative pre-trained converter model.
11. An electronic device, comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-5.
12. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-5.
13. A computer program product comprising a computer program that, when executed by a processor, implements the steps of the method according to any one of claims 1-5.