A method, apparatus and system for data processing
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-14
- Publication Date
- 2026-08-14
AI Technical Summary
然而,当前技术通常基于已有示例或采用大量的提示对输入信息进行匹配,信息抽取的效率和准确性较低
Smart Images

Figure CN122572402A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence, and more specifically, to a method, apparatus, and system for data processing. Background Technology
[0002] Large language models (LLMs) are trained on large-scale corpora to understand and generate natural language, enabling them to perform various language tasks such as text generation, language understanding, question answering, translation, information extraction, and dialogue interaction. LLMs can also be applied to agent technology; for example, their information extraction capabilities can be used to improve an agent's memory recall and enhance its intelligence. However, current techniques typically rely on matching input information based on existing examples or a large number of prompts, resulting in relatively low efficiency and accuracy in information extraction.
[0003] Therefore, improving the efficiency and accuracy of information extraction is an urgent problem to be solved. Summary of the Invention
[0004] This application provides a data processing method, apparatus, and system that can improve the efficiency and accuracy of information extraction based on a unified memory extraction paradigm template.
[0005] In a first aspect, a data processing method is provided, comprising: acquiring user input; determining a first template from a template set based on the user input, the template set including multiple templates, each of the multiple templates including a first feature, a second feature, and a third feature, wherein the first feature indicates the function of the template, the second feature indicates the application scenario of the template, the third feature includes multiple pieces of first information and multiple pieces of second information, each piece of first information indicating an information category corresponding to the second feature, each piece of second information corresponding one-to-one with each piece of first information, and each piece of second information including a description of the first information and / or an example of the extraction result based on the first information; and extracting information from the user input based on the first template to obtain a first data set.
[0006] Based on the above scheme, the templates in the template set have the same structure (i.e., each template is determined according to a unified paradigm template), which allows for flexible configuration of templates according to system requirements and user scenario needs. Furthermore, the unified paradigm template can be extended to more application scenarios and business requirements to obtain new templates. In the process of determining the corresponding template based on user input, the presence of the first feature enables rapid template retrieval (matching), improving the efficiency of information extraction. The presence of the first information allows the model to more accurately classify the content of user input during information extraction, resulting in structured information extraction results. The presence of the second information enhances the model's understanding and reasoning abilities in information extraction tasks, enabling more accurate extraction of user input and improving the accuracy of information extraction. In addition, the segmented collaborative approach of first matching templates and then extracting information based on them improves task execution efficiency and accuracy while also reducing the requirements on the model's capabilities during data processing to some extent.
[0007] In conjunction with the first aspect, in some implementations of the first aspect, the third feature is determined based on the second feature, and the first feature is determined based on the second feature and the third feature.
[0008] Based on the above scheme, different extraction content can be configured for different application scenarios, and templates can be configured according to the scenario and extraction content. This allows for the faster construction of the first dataset for specific application scenarios and provides high template expansion flexibility.
[0009] In conjunction with the first aspect, in some implementations of the first aspect, the first feature is determined based on the second feature and the third feature, including: the first feature is based on a large language model (LLM) and determined based on the second feature and the third feature.
[0010] Based on the above scheme, using LLM to determine the first feature according to the second and third features can improve the configuration efficiency of the first feature while achieving the function of accurately and in detail indicating the template through the first feature.
[0011] In conjunction with the first aspect, in some implementations of the first aspect, determining the first template from the template set based on the user input includes: determining the first template from the template set based on the semantic relevance between the first feature of each template and the user input.
[0012] Based on the above scheme, compared with the current technology that uses the same extraction instructions for multiple scenarios, the scheme of this application can determine the template used to extract user input based on the first feature of different templates and the semantic correlation between user input. Then, extraction instructions can be generated based on the determined templates. While meeting the extraction needs of different types and different scenarios, the complexity of extraction instructions is reduced, adaptive template matching is achieved, and the efficiency of information extraction is improved.
[0013] In conjunction with the first aspect, in some implementations of the first aspect, the step of extracting information from the user input based on the first template to obtain a first data set includes: determining an extraction instruction based on the third feature of the first template; and extracting information from the user input according to the extraction instruction to obtain a first data set, wherein the first data set includes information in the user input corresponding to the third feature of the first template.
[0014] Based on the above scheme, the extraction instructions can be enhanced based on the third feature of the template, so that the extraction instructions can better correspond to the user input and improve the accuracy of information extraction.
[0015] In conjunction with the first aspect, in some implementations of the first aspect, each of the plurality of templates further includes a fourth feature, the fourth feature being used to indicate feature extraction based on at least one first piece of information in the third feature of the first template; the step of determining the extraction instruction based on the third feature of the first template further includes: determining the extraction instruction based on the third feature and the fourth feature of the first template.
[0016] Based on the above scheme, optional or non-optional options can be configured in the third feature according to the fourth feature, so as to avoid the situation where the user input content corresponding to the first information cannot be obtained during the information extraction process, thereby reducing the performance of information extraction.
[0017] In conjunction with the first aspect, in some implementations of the first aspect, if the user input includes the same first information content corresponding to the third feature of the first template, the method further includes: extracting information from the user input based on the first template to obtain a second data set, wherein the second data set is different from the first data set and the second data set has an intersection with the first data set.
[0018] Based on the above scheme, when the user input includes multiple pieces of similar information (for example, the user input contains multiple pieces of the same first information that can correspond to the same template), the user input can be extracted multiple times based on the first template, and different information extraction results can be obtained. This avoids the omission of information during the extraction process and can further facilitate the structured management of data.
[0019] In conjunction with the first aspect, in some implementations of the first aspect, if the user input includes multiple application scenarios, the method further includes: determining a second template from a template set based on the user input, wherein the second feature of the second template and the second feature of the first template respectively indicate different application scenarios; and extracting information from the user input based on the second template to obtain a third data set.
[0020] Based on the above scheme, in some cases, user input can cover multiple scenarios, so different templates can be used to extract user input, avoiding information omissions during the extraction process and improving the accuracy of information extraction.
[0021] In a second aspect, a data processing apparatus is provided, the apparatus comprising: an acquisition module for acquiring user input;
[0022] The processing module is configured to perform the following operations: Based on the user input, determine a first template from a template set, the template set including multiple templates, each template including a first feature, a second feature, and a third feature; the first feature indicates the function of the template, the second feature indicates the application scenario of the template, and the third feature includes multiple pieces of first information and multiple pieces of second information; each piece of first information indicates an information category corresponding to the second feature, and each piece of second information corresponds one-to-one with each piece of first information; each piece of second information includes a description of the first information and / or an example of the extraction result based on the first information; and extract information from the user input based on the first template to obtain a first data set.
[0023] In conjunction with the second aspect, in some implementations of the second aspect, the third feature is determined based on the second feature, and the first feature is determined based on the second feature and the third feature.
[0024] In conjunction with the second aspect, in some implementations of the second aspect, the first feature is determined based on the second feature and the third feature, including: the first feature is based on a large language model (LLM) and is determined based on the second feature and the third feature.
[0025] In conjunction with the second aspect, in some implementations of the second aspect, the processing module is further configured to: determine the first template from the template set based on the semantic relevance between the first feature of each template and the user input.
[0026] In conjunction with the second aspect, in some implementations of the second aspect, the processing module is further configured to: determine an extraction instruction based on the third feature of the first template; and extract information from the user input according to the extraction instruction to obtain a first data set, the first data set including information in the user input corresponding to the third feature of the first template.
[0027] In conjunction with the second aspect, in some implementations of the second aspect, each of the plurality of templates further includes a fourth feature, the fourth feature being used to indicate feature extraction based on at least one first piece of information in the third feature of the first template; the processing module is further configured to: determine the extraction instruction based on the third feature and the fourth feature of the first template.
[0028] In conjunction with the second aspect, in some implementations of the second aspect, if the user input includes the same first information content corresponding to multiple third features of the first template, the processing module is further configured to: extract information from the user input based on the first template to obtain a second data set, wherein the second data set is different from the first data set and the second data set intersects with the first data set.
[0029] In conjunction with the second aspect, in some implementations of the second aspect, if the user input includes multiple application scenarios, the processing module is further configured to: determine a second template from a template set based on the user input, wherein the second feature of the second template and the second feature of the first template respectively indicate different application scenarios; and extract information from the user input based on the second template to obtain a third data set.
[0030] It should be noted that the technical effects of the second aspect and any of its implementations can be referred to the description of the first aspect and any of its implementations, which will not be repeated here.
[0031] Thirdly, a computing device is provided, including a processor and a memory, and optionally, an input / output interface. The processor controls the input / output interface to send and receive information, the memory stores a computer program, and the processor retrieves and runs the computer program from the memory, causing the program to execute the method of the first aspect or any possible implementation thereof.
[0032] Optionally, the processor can be a general-purpose processor, which can be implemented in hardware or software. When implemented in hardware, the processor can be a logic circuit, integrated circuit, etc.; when implemented in software, the processor can be a general-purpose processor that reads software code stored in memory. This memory can be integrated into the processor or located outside the processor and exist independently.
[0033] Fourthly, a computing device cluster is provided, including at least one computing device, each computing device including a processor and a memory; the processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device, such that the computing device cluster performs the method of the first aspect or any possible implementation thereof.
[0034] Fifthly, a chip is provided that acquires and executes instructions to implement the methods described in the first aspect and any implementation thereof.
[0035] Optionally, as one implementation, the chip includes a processor and a data interface, through which the processor reads instructions stored in the memory and executes the methods in the first aspect and any implementation thereof.
[0036] Optionally, as one implementation, the chip may further include a memory storing instructions, and the processor is used to execute the instructions stored in the memory. When the instructions are executed, the processor is used to perform the method in the first aspect and any implementation thereof.
[0037] In a sixth aspect, a computer program product containing instructions is provided, which, when executed by a computing device, cause the computing device to perform the methods described in the first aspect and any implementation thereof.
[0038] In a seventh aspect, a computer program product containing instructions is provided, which, when run by a cluster of computing devices, cause the cluster of computing devices to perform the methods described in the first aspect and any implementation thereof.
[0039] Eighthly, a computer-readable storage medium is provided, including computer program instructions that, when executed by a computing device, perform the method as described in the first aspect and any implementation thereof.
[0040] As examples, these computer-readable storage devices include, but are not limited to, one or more of the following: read-only memory (ROM), programmable ROM (PROM), erasable PROM (EPROM), flash memory, electrically EPROM (EEPROM), and hard drive.
[0041] Alternatively, as one implementation method, the aforementioned storage medium can specifically be a non-volatile storage medium.
[0042] A ninth aspect provides a computer-readable storage medium including computer program instructions that, when executed by a cluster of computing devices, perform the method as described in the first aspect and any implementation thereof.
[0043] As examples, these computer-readable storage devices include, but are not limited to, one or more of the following: read-only memory (ROM), programmable ROM (PROM), erasable PROM (EPROM), flash memory, electrically EPROM (EEPROM), and hard drive.
[0044] Alternatively, as one implementation method, the aforementioned storage medium can specifically be a non-volatile storage medium.
[0045] In a tenth aspect, a computing device cluster is provided, including at least one computing device, each computing device including a processor and a memory, wherein the processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device to cause the computing device cluster to perform the method as described in the first aspect and any implementation thereof. Attached Figure Description
[0046] Figure 1 This is a schematic diagram of the architecture 100 of a data processing system applicable to embodiments of this application.
[0047] Figure 2 This is a schematic diagram of the architecture 200 of the information extraction system applicable to embodiments of this application.
[0048] Figure 3 This is a schematic diagram of a data processing method 300 applicable to an embodiment of this application.
[0049] Figure 4 This is a schematic diagram of a template construction process applicable to an embodiment of this application.
[0050] Figure 5 This is a schematic diagram of an information extraction method 500 applicable to embodiments of this application.
[0051] Figure 6 This is a schematic block diagram of a data processing device 600 provided in an embodiment of this application.
[0052] Figure 7 This is a schematic diagram of the architecture of a computing device 700 provided in an embodiment of this application.
[0053] Figure 8 This is a schematic diagram of the architecture of a computing device cluster provided in an embodiment of this application. Detailed Implementation
[0054] The technical solutions in this application will now be described with reference to the accompanying drawings.
[0055] Artificial intelligence (AI) is the theory, methods, technology, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a branch of computer science that attempts to understand the essence of intelligence and produce a new kind of intelligent machine that can react in a way similar to human intelligence. AI studies the design principles and implementation methods of various intelligent machines, enabling them to have perception, reasoning, and decision-making capabilities. Research in the field of AI includes robotics, natural language processing, computer vision, decision-making and reasoning, human-computer interaction, recommendation and search, and fundamental AI theories.
[0056] The basic principle of AI is to combine massive amounts of data with powerful computing capabilities and intelligent algorithms to build an AI model that solves specific problems. This AI model can automatically summarize and learn potential patterns or features from the data, thereby achieving a way of thinking that is close to that of humans.
[0057] AI models, also known as AI algorithms (or AI operators), are a collective term for mathematical algorithms built upon the principles of artificial intelligence. They form the foundation for using AI to solve specific problems. Depending on the specific methods and / or technologies used to implement artificial intelligence, AI models can also be called machine learning models, deep learning models, or reinforcement learning models.
[0058] To facilitate understanding of the embodiments of this application, the terms involved in this application will be briefly explained first.
[0059] It should be understood that the related conceptual explanations may be limited by the specific circumstances of the embodiments of this application, but it does not mean that this application can only be limited to the specific circumstances. The specific circumstances of different embodiments may also differ, which are not limited here.
[0060] 1. Neural Networks
[0061] A neural network is a model that can be understood as a network composed of neurons, with input layers, hidden layers, and output layers. Generally, the first layer is the input layer, the last layer is the output layer, and the layers in between are hidden layers. The training process of a neural network is essentially learning how to control spatial transformations, thereby obtaining the weight matrices of all layers in the neural network.
[0062] 2. Large Model
[0063] Large models are used to provide large-scale model services. A large model refers to a neural network model containing an extremely large number of parameters. Large models can also be called foundation models. Large models play a crucial role in many fields and applications, with common applications including natural language processing, computer vision, speech recognition and synthesis, recommender systems, financial risk control, intelligent dialogue systems, games, artificial intelligence, and healthcare. In the future, large models will evolve towards multimodal models, which can handle data from multiple modalities; for example, multimodal large models can process natural language as well as text, images, or videos.
[0064] Large language models (LLMs) are a type of large-scale model, specifically neural network models with a large number of parameters trained on massive corpora. They can understand and generate natural language through training on large-scale corpora. Specifically, LLMs are typically based on neural network techniques (e.g., deep learning models), learning the syntax, semantics, and contextual information of a language by training on large amounts of text data. During training, the model continuously optimizes its parameters to improve its ability to understand and generate text. Due to their powerful ability to understand natural language, LLMs have been widely applied in many fields to solve natural language understanding and generation problems. LLMs have broad applications in artificial intelligence, performing various language tasks such as text generation, language understanding, question answering, translation, information extraction, and interactive dialogue.
[0065] 3. Prompt
[0066] Prompt is an interaction method based on natural language processing. It enables communication between users and machines by parsing natural language. The main implementation of prompts involves building a corpus and semantic parsing model to convert natural language into machine-recognizable instructions. For example, Prompt can use context, thought chains, or prompt words to construct hints from the original text, generating more granular tasks to guide larger models in completing tasks more effectively.
[0067] The design principles of prompts include: writing clear and specific instructions, and giving the model time to think.
[0068] The key design elements of a prompt include: Instruction, Context, Constraint, Example, and Input. Instruction provides the task instructions and states the specific goals. Context allows the AI (or large model) to understand the task from the user's perspective and provides context around the task. Constraint specifies the steps to complete the task (e.g., a chain of thought, COT), clearly defines the language style, and specifies the output template. Example provides concrete examples. It should be noted that this division of design elements in a prompt is merely an example; other division methods are not limited.
[0069] 4. Agent
[0070] An agent is an intelligent entity capable of perceiving its environment, making decisions, and executing actions. Typically based on machine learning and artificial intelligence technologies, it possesses autonomy and adaptability, enabling it to learn and improve autonomously in specific tasks or domains. Agents can not only quickly search for relevant information based on user needs but also leverage their learning capabilities to provide increasingly personalized and thoughtful solutions. An intelligent agent can be a computer system or part of a computer system within a specific environment, or it can be software or a combination of software and hardware.
[0071] Agents include Large Language Model-powered Agents (LLM-powered Agents). As a core technology in current AI applications, LLM-powered Agents leverage large language models to perform complex tasks. They execute tasks by combining large language models with key modules. For example, edge-side large model agents are a crucial foundation for driving the intelligence and personalization of edge devices. When building an LLM-powered Agent, the LLM acts as a control center or "brain," responsible for managing a series of operations required to complete tasks or respond to user requests. The construction of such agents also relies on key modules.
[0072] Specifically, during the execution of tasks by an LLM-powered Agent, key modules may include planning, memory, tool use, and action.
[0073] (1) Planning
[0074] Sub-goal decomposition: The agent breaks down large tasks into smaller, manageable sub-goals, thus enabling it to effectively handle complex tasks.
[0075] Reflection and Improvement: Agents can engage in self-criticism and self-reflection on their past actions, learn from mistakes, and improve in subsequent steps, thereby enhancing the quality of the final result.
[0076] (2) Memory
[0077] Short-term memory: Contextual learning is short-term memory learning that utilizes models.
[0078] Long-term memory: Provides agents with the ability to retain and recall long-term information, which can be achieved using external vector storage and retrieval.
[0079] (3) Tool usage
[0080] For information about missing model weights, the agent learns to call external application programming interfaces (APIs) to obtain additional information, including current information, code execution capabilities, and access to proprietary information sources.
[0081] (4) Action
[0082] The action module is the part of the intelligent agent that actually executes decisions or responses. Faced with different tasks, the intelligent agent system has a complete set of action strategies, allowing it to select the actions to be performed during decision-making. Examples include memory retrieval, reasoning, learning, and programming.
[0083] 5. Information Extraction (IE)
[0084] Information extraction is the process of automatically identifying and extracting specific types of information (such as entities, relationships, and events) from unstructured text, and transforming it into structured data for subsequent analysis and processing.
[0085] 6. Supervised Fine-Tuning (SFT)
[0086] Supervised fine-tuning involves using labeled data to further train a pre-trained model in order to optimize its performance on a specific task.
[0087] Figure 1 This is a schematic diagram of the architecture 100 of a data processing system applicable to embodiments of this application.
[0088] like Figure 1 As shown, the data acquisition device 160 is used to collect training data and store the training data in the database 130. The training device 120 trains the target model / rule 201 based on the training data maintained in the database 130.
[0089] It should be noted that the data acquisition device 160, execution device 110, and training device 120 may be the same or different devices. The training data may include multiple user input sample groups, each including input data and corresponding information extraction results. The information extraction results are the information that should be correctly extracted based on the input data. Optionally, each user input sample group may be pre-defined, or it may be generated using computer technology.
[0090] The following describes in more detail how the training device 120 obtains a target model / rule 101 based on training data, which can be used to implement the data processing method provided in the embodiments of this application.
[0091] It should be noted that, in practical applications, the training data maintained in the database 130 can come from the data acquisition device 160 or other devices. The training device 120 does not necessarily train the target model / rule 101 entirely based on the training data maintained in the database 130; it can also obtain training data from the cloud or other sources for model training. The above description should not be construed as limiting the embodiments of this application. The target model / rule 101 trained by the training device 120 can be applied to different systems or devices, for example, applied to... Figure 1 The execution device 110 shown.
[0092] It should be understood that the execution device 110 may be a terminal. For example, the terminal may be a digital camera, surveillance camera, mobile phone, personal computer (PC), laptop computer, server, tablet computer, smart TV, in-vehicle terminal, mobile internet device (MID), wearable device, virtual reality (VR) device, augmented reality (AR) device, wireless terminal in industrial control, wireless terminal in self-driving, wireless terminal in remote medical surgery, wireless terminal in smart grid, wireless terminal in transportation safety, wireless terminal in smart city, wireless terminal in smart home, etc., or it may be an edge device (e.g., a box carrying a chip with processing capabilities); the execution device 110 may also be a server or cloud, etc.
[0093] The execution device 110 is equipped with an I / O interface 112 for data interaction with external devices. Users can input data to the I / O interface 112 through the client device 140. Furthermore, the input data can be user-inputted data, data uploaded by the user through a camera, or data from a database; this application does not impose any limitations on these aspects.
[0094] As one possible embodiment, the execution device 110 and the training device 120 are different processors deployed on different physical devices (e.g., servers in a server or cluster). For example, the execution device 110 may be a graphics processing unit (GPU), a central processing unit (CPU), other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The training device 120 may be a graphics processing unit (GPU), a neural network processing unit (NPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits used to control the execution of the program of the present application. The training device 120 can configure the trained neural network to multiple execution devices 110. Each execution device 110 uses the trained neural network to perform functions such as information extraction.
[0095] In another possible embodiment, the execution device 110 and the training device 120 are deployed on the same physical device, or the execution device 110 and the training device 120 are on the same physical device. The computing device can configure the trained neural network to itself and use the trained neural network to perform functions such as information extraction.
[0096] Training device 120 is used to train a neural network using training data until the loss function in the neural network converges and its value is less than a specific threshold, at which point the neural network training is complete, thus achieving a certain level of accuracy. Alternatively, all training data in database 130 can be used for training, completing the neural network training and enabling it to perform functions such as information extraction. Then, training device 120 configures the trained neural network to execution device 110. Execution device 110 is used to implement the function of processing application data based on the trained neural network.
[0097] The preprocessing module 113 is used to preprocess the input data received by the I / O interface 112. In this embodiment, the preprocessing module 113 can be used to obtain user input (e.g., from conversations, SMS messages, memos, clipboard, etc.). During the preprocessing of input data by the execution device 110, or during the calculation module 111 of the execution device 110 performing calculations and other related processes, the execution device 110 can call data, code, etc., in the data storage system 150 for corresponding processing, or store the processed data, instructions, etc., into the data storage system 150. Finally, the I / O interface 112 returns the processing result to the client device 140, thereby providing it to the user.
[0098] It should be understood that Figure 1 This is merely a schematic diagram of a system architecture. The positional relationships between the devices, components, modules, etc., shown in the diagram do not constitute any limitation. For example, in Figure 1 In this case, the data storage system 150 is an external memory relative to the execution device 110. In other cases, the data storage system 150 may also be placed in the execution device 110.
[0099] Figure 2 This is a schematic diagram of the architecture 200 of the information extraction system applicable to embodiments of this application.
[0100] like Figure 2 As shown, Architecture 200 includes three stages: the construction of the memory schema, the adaptive matching of the scenario (Schema Retrieval), and the schema as Prompt information extraction.
[0101] The construction of memory templates is based on a unified paradigm template, depending on data type and scenario (for example, when Architecture 200 is applied to the client side, the corresponding scenarios may include: hotels, air tickets, express delivery, personal information, interpersonal relationships, etc., and data types may include memos, notifications, clipboard, search terms, SMS messages, conversations, OCR text, etc.). Scenario-adaptive matching is used for memory schema retrieval (for example, semantic similarity matching methods can be used). Template-enhanced information extraction generates a prompt based on the retrieved memory schema template and uses a large model for inference and extraction.
[0102] For example, based on architecture 200, input information can be extracted to form structured memory, which is then used to construct a user's personal knowledge memory graph.
[0103] It should be noted that, Figure 2This is a brief description of the system architecture that can be applied to the embodiments of this application. The specific implementation process and method of each link will be described in detail later, and will not be repeated here.
[0104] It should be understood that the system architecture and business scenarios described in the embodiments of this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided in the embodiments of this application. As those skilled in the art will know, with the evolution of system architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.
[0105] Memory, as a crucial capability of intelligent agents, can be defined as the process of acquiring, storing, retaining, and subsequently retrieving information. For example, taking edge-side intelligent agents as an example, memory capability is key to enhancing the personalized experience of edge-side intelligent devices and strengthening product competitiveness. Therefore, the ability of edge-side intelligent agents to extract memory is a crucial capability for constructing personal memory information on the edge and a decisive factor in determining the level of intelligence on the edge.
[0106] Current methods for extracting agent memories have many limitations.
[0107] (1) Commercial / open source solutions for memory lack adaptation and details for memory retrieval tasks.
[0108] For example, ChatGPT's Memory feature automatically saves key information provided by users during conversations with their authorization, enabling more personalized responses in subsequent conversations. For instance, ChatGPT's Memory feature records user-shared preferences, important events, and specific needs, referencing them appropriately in conversations to maintain contextual continuity. Users can view, manage, or delete these memories at any time, ensuring information control and privacy. However, ChatGPT's Memory primarily focuses on the extraction, updating, retrieval, and use of unstructured memories, lacking the ability to extract structured memories, thus making it difficult to construct structured memories. Furthermore, ChatGPT's Memory is primarily conversational in nature, lacking support and adaptation for other data types such as SMS messages, memos, and clipboard data, as well as broader scenarios like hotel bookings, flight bookings, and express delivery, thus lacking generalization capabilities for diverse memory extraction types and scenarios on the client side.
[0109] For example, mem0 can support multi-level memory (e.g., user-level, session-level, and AI agent-level memory retention), adaptive personalization (e.g., it can continuously improve based on user interaction to provide precise personalized memories), tool invocation (i.e., memories can be added, updated, and deleted through tool invocation), and graph memory (where users can create and utilize complex relationships between information fragments to obtain more granular and context-aware responses). Memory extraction tools, however, are limited in functionality, using fixed agent prompts and relying on tools for memory extraction. This fails to meet the diverse data and scenario extraction needs, thus restricting their application on the edge.
[0110] For example, LangChain can support different memory extraction, management, and usage functions, such as conversation buffer memory, conversation buffer window memory, conversation token buffer, conversation summary memory, entity memory, conversation knowledge graph, combined memory, and vector store-backed memory. However, it lacks a memory extraction solution adapted to multiple scenarios and data types on the client side, and lacks the ability to adaptively adjust to memory extraction requirements.
[0111] (2) For traditional information extraction tasks (e.g., extraction of entities, relationships, events, etc.), in order to adapt to the extraction of information data of multiple types and multiple scenarios, the prompts of large models are usually extremely long, resulting in poor scalability.
[0112] For example, information extraction schemes based on prompts concatenate information extraction prompts from different scenarios to complete the memory extraction task in one go. However, due to the rich variety of data types and scenarios for information extraction on the client side, each extraction scenario has a corresponding information extraction template paradigm. In order to cover all possible scenarios, all information extraction template paradigms for all scenarios need to be concatenated together, resulting in very lengthy extraction prompts, even exceeding the Context Window length limit of large models.
[0113] (3) The model needs to autonomously select the extraction objects. Due to the richness of information extraction scenarios, large models need to be able to autonomously judge the scenario based on the input information, which increases the complexity of the information extraction task and the requirements for the model's reasoning ability. In this case, if the overall capabilities of the large model are limited, it will lead to a higher error rate.
[0114] For example, example-based information extraction schemes rely on existing information extraction examples. Information extraction presupposes the existence of numerous sample examples and the known information extraction scenarios and their corresponding schemas. Therefore, the lack of examples for specific scenarios can limit the ability to extract information. For instance, client-side user data is rich in types and scenarios but also highly privacy-conscious. This may lead to high data sparsity in some scenarios, making it impossible for the client's own data to provide effective extraction examples, while data from others cannot be exported, thus limiting the scheme's capabilities.
[0115] (4) The current schema-based extraction task does not have a clear requirement for extracting key-value pairs (KV), which limits the accuracy of large models during the extraction process.
[0116] Most existing open-source and commercial solutions are based on cloud-based large-scale models and lack adaptive memory extraction solutions that adjust to the needs of various scenarios and types of data on the client side.
[0117] In light of this, current large-scale model-driven agent memory extraction processes suffer from problems such as limited memory types, limited data types, lack of adaptive adjustment capabilities to meet memory extraction needs, and lack of scalability for memory extraction scenarios. They typically rely on existing examples or a large number of prompts to match input information, resulting in low information extraction efficiency.
[0118] Therefore, embodiments of this application provide a data processing method that improves the efficiency and accuracy of information extraction based on a unified memory extraction paradigm template.
[0119] Figure 3 This is a schematic diagram of a data processing method 300 applicable to an embodiment of this application.
[0120] It should be understood that Figure 3 The steps or operations of the data processing method are illustrated, but these steps or operations are merely to help those skilled in the art understand the embodiments of this application, and are not intended to limit the embodiments of the application to... Figure 3 The specific numerical values or specific scenarios illustrated. Those skilled in the art will understand based on... Figure 3The examples given below can obviously be modified or varied in various ways, and such modifications and variations also fall within the scope of the embodiments of this application. The embodiments of this application can also perform other operations or... Figure 3 Variations of various operations within it.
[0121] It should be understood that the embodiments shown below do not particularly limit the specific structure of the execution subject of the method provided in the embodiments of this application. As long as a program containing the code of the method provided in the embodiments of this application can be run to generate virtual objects according to the method provided in the embodiments of this application, it is acceptable. For example, the method provided in the embodiments of this application can be executed by a processing device, which can be... Figure 1 The execution device in the text can also be a component of the execution device (e.g., a processor, chip, or chip system). This execution device can be a cloud device or a terminal device (e.g., a mobile phone). Of course, the method provided in the embodiments of this application can also be executed by a system that includes both cloud devices and terminal devices.
[0122] For ease of explanation, the following description uses a terminal device as the executing entity of method 300 as an example, which does not constitute a limitation on the executing entity of this application.
[0123] like Figure 3 As shown, method 300 may include the following steps:
[0124] S301: Obtain user input.
[0125] It should be noted that obtaining user input can be done directly or indirectly.
[0126] For example, users can directly input their needs into the terminal device through dialogue or other means, or the terminal device can indirectly obtain user input through the clipboard, notification bar (such as push messages), memos, or SMS.
[0127] It should be understood that the embodiments of this application do not limit the method by which the terminal device obtains user input.
[0128] S302: Determine a first template from the template set based on the user input.
[0129] The template set includes multiple templates, each template including a first feature, a second feature, and a third feature. The first feature indicates the function of the template, the second feature indicates the application scenario of the template, and the third feature includes multiple first pieces of information and multiple second pieces of information. Each piece of first information indicates the information category corresponding to the second feature, and each piece of second information corresponds one-to-one with each piece of first information. Each piece of second information includes a description of the first information and / or an example of the extraction result based on the first information.
[0130] In this scenario, the templates in the template set have the same structure (i.e., each template is determined according to a unified paradigm template), which allows for flexible configuration of templates based on system requirements and user scenario needs. Furthermore, the unified paradigm template can be extended to more application scenarios and business requirements to obtain new templates.
[0131] It should be noted that the template set can be pre-set in the terminal device; alternatively, it can be sent to the terminal device by other devices (e.g., servers or cloud devices); or it can be stored in the cloud device and retrieved by the terminal device through a corresponding interface after obtaining user input; or it can be obtained by the terminal device through software package updates, etc. Alternatively, the terminal device can directly send the user input to the cloud device, which will then execute subsequent steps and return the final result to the terminal device. This application embodiment does not limit the method of obtaining the template set.
[0132] It should also be noted that each template in the template set has a different first feature, that is, each template has a different function. The second features of each template in the template set can be the same or different. For example, if at least two templates in the template set have different second features, each template can be applied to different scenarios; if at least two templates in the template set have the same second feature (i.e., at least two templates have the same scenario), then the third features corresponding to these at least two templates are different. It should be understood that since the third feature includes multiple first pieces of information and multiple pieces of second information, and each piece of second information corresponds to one piece of first information, the difference in the third features corresponding to these at least two templates can also be understood as: there is at least one different piece of first information in the third features corresponding to these at least two templates (since the second information corresponds to the first information, different first information can also be considered as different second information).
[0133] Optionally, the second feature may correspond to scenarios such as logistics, orders, bills, alarms, reminders, to-do lists, notes, appointments, hotels, air tickets, trains, important days, cards, addresses, times, basic personal information, personal social attributes, personal economic attributes, social relationships with related persons, or interest preferences. It should be understood that the second feature may also correspond to more scenarios, and this application embodiment does not limit this.
[0134] Optionally, the third feature is determined based on the second feature.
[0135] For example, based on different scenarios (second features), the third feature can be understood as the relevant fields (keys) that can correspond to different scenarios. For instance, when the second feature corresponds to the air ticket scenario, the first information in the third feature can include content such as "category information," "flight number," and "airline." The second information in the third feature can be used to further explain the relevant content of the first information. For instance, if the first information is "category information," the corresponding second information can include a description of the "category information" (used to highly summarize the main intent of the air ticket information, such as air ticket change notification, air ticket booking success notification, air ticket booking failure notification, etc.), and the data type of the content extracted based on the "category information" and user input (i.e., the data type of the value corresponding to the key. For example, the content extracted based on the "category information" is in string format).
[0136] It should be understood that further details regarding the third characteristic can be found in the following text. Figure 4 The description of the key in this application will not be repeated here.
[0137] Optionally, the first feature is determined based on the second feature and the third feature.
[0138] In this context, different extraction content can be configured for different application scenarios, and templates can be configured based on the scenario and extraction content. This allows for the faster construction of the first dataset for specific application scenarios, providing high flexibility in template expansion.
[0139] Optionally, the first feature is determined based on the second feature and the third feature, including: the first feature is based on a large language model (LLM) and is determined based on the second feature and the third feature.
[0140] In other words, after determining the second feature and the second feature, the first feature of each template in the template set can be generated based on the second feature and the second feature, according to LLM.
[0141] For example, the first feature can be obtained directly from the second and third features by the LLM. That is, it can be understood as expanding and / or summarizing the contents of the second and third features through the LLM to obtain the first feature.
[0142] For example, each template in the template set may include a brief description of the template's functionality (Raw Description of Schema) (e.g., the Raw Description of Schema could be "event information can be extracted based on user input"). Thus, the first feature can also be understood as a rewrite of the Raw Description of Schema based on LLM. That is, the content of the Raw Description of Schema can be expanded using LLM by combining the content of the second and / or third features to obtain the first feature.
[0143] It should be understood that the specific implementation of the rewriting can also be referred to the relevant description of Table 2 below, and will not be repeated in the embodiments of this application.
[0144] Optionally, determining the first template from the template set based on the user input includes: determining the first template from the template set based on the semantic relevance between the first feature of each template and the user input.
[0145] For example, the semantic relevance of the first feature of the user input and each template in the template set can be determined, and the template corresponding to the first feature with the highest semantic relevance to the user input can be used as the first template.
[0146] It should be noted that the specific methods for determining semantic relevance can be found in the relevant content of the current technology, and the embodiments of this application do not limit them.
[0147] Based on the above scheme, compared with the current technology that uses the same extraction instructions for multiple scenarios, the scheme of this application can determine the template used to extract user input based on the first feature of different templates and the semantic correlation between user input. Then, extraction instructions can be generated based on the determined templates. While meeting the extraction needs of different types and different scenarios, the complexity of extraction instructions is reduced, adaptive template matching is achieved, and the efficiency of information extraction is improved.
[0148] Optionally, each of the plurality of templates further includes a fourth feature, the fourth feature being used to indicate feature extraction based on at least one first piece of information in the third feature of the first template.
[0149] For example, the way the fourth feature is used to "indicate feature extraction based on at least one first piece of information in the third feature of the first template" may include "indicating optional first information" and "indicating non-optional first information".
[0150] For example, when the fourth feature is used to indicate optional first information (the fourth feature may include zero or one or more pieces of first information), the first information included in the fourth feature is optional (or can also be understood as mandatory). If the fourth feature includes zero pieces of first information (e.g., the fourth feature is empty), it can be understood that all content of the third feature is mandatory, meaning the terminal device can extract information from the user input based on all content of the third feature. If the fourth feature includes one or more pieces of first information, then the one or more pieces of first information are optional, and the terminal device can extract information from the user input based on the first information in the third feature other than the first information included in the fourth feature.
[0151] For example, when the fourth feature is used to indicate unselectable first information (the fourth feature may include zero or one or more pieces of first information), the first information included in the fourth feature is unselectable (or can be understood as optional). If the fourth feature includes zero pieces of first information (e.g., the fourth feature is empty), it can be understood that all content of the third feature is optional. If the fourth feature includes one or more pieces of first information, then the one or more pieces of first information are optional, and the terminal device can preferentially extract information from the user input based on the first information in the third feature other than the first information included in the fourth feature.
[0152] S303: Extract information from the user input based on the first template to obtain a first data set.
[0153] The first data set includes structured data, which is the result of information extraction by the terminal device based on user input.
[0154] It should be noted that information extraction can also be called information extraction, memory extraction, or memory retrieval, etc., and the embodiments of this application do not limit it in this way.
[0155] It should be understood that in the process of determining the corresponding template based on user input, the presence of the first feature enables rapid template retrieval (matching), improving the efficiency of information extraction. The presence of this first information allows the model to more accurately classify the user input during information extraction, resulting in structured information extraction results. The presence of the second information enhances the model's understanding and reasoning abilities in the information extraction task, enabling more accurate extraction of user input and improving the accuracy of information extraction. Furthermore, the segmented collaborative approach of first matching the template and then extracting information based on the template improves task execution efficiency and accuracy while also reducing the demands on the model's capabilities during data processing to some extent.
[0156] In one possible implementation, the step of extracting information from the user input based on the first template to obtain a first data set includes: determining an extraction instruction based on the third feature of the first template; and extracting information from the user input according to the extraction instruction to obtain a first data set, wherein the first data set includes information in the user input corresponding to the third feature of the first template.
[0157] It should be understood that after determining the first template based on user input, an extraction instruction can be further determined based on the third feature of the first template (i.e., the extraction instruction includes the third feature of the first template), and the extraction instruction is called Prompt. In other words, the extraction instruction can be a complete instruction that includes the third feature of the first template. Further information on extraction instructions can be found below. Figure 5 The description of the template-enhanced Prompt in the previous embodiment will not be repeated here. In this case, the extraction instruction is enhanced based on the third feature of the template, so that the extraction instruction can better correspond to the user input and improve the accuracy of information extraction.
[0158] In addition, the "information corresponding to the third feature of the first template" can be understood as the value in the user input corresponding to each key (i.e., each piece of first information in the third feature of the first template) (i.e., the result of extracting information from the user input based on each key and the second information corresponding to the key).
[0159] Optionally, if the first template includes the fourth feature, determining the extraction instruction based on the third feature of the first template further includes: determining the extraction instruction based on the third feature and the fourth feature of the first template.
[0160] In this case, optional or non-optional options can be configured in the third feature based on the fourth feature to avoid the situation where user input content corresponding to the first information cannot be obtained during the information extraction process, thus reducing the performance of information extraction.
[0161] Optionally, if the user input includes the same first information content corresponding to multiple third features of the first template, the method 300 may further include step S304: extracting information from the user input based on the first template to obtain a second data set.
[0162] The second data set is different from the first data set, and the second data set and the first data set have an intersection.
[0163] It should be understood that different information extraction results can be obtained based on the same user input and the same template. When the user input includes multiple pieces of similar information (for example, the user input contains multiple pieces of the same first information that can correspond to the same template), information can be extracted from the user input multiple times based on the first template, and different information extraction results can be obtained. This avoids information omission during the extraction process and also facilitates the structured management of data.
[0164] For example, the user input may contain multiple contents that correspond to the same first information in the third feature of the first template. In this case, multiple sets of information extraction results can be obtained based on the first template. Each set of information extraction results includes different contents in the user input that correspond to the "same first information," as well as the same contents that correspond to other first information. Thus, the data sets obtained by extracting information based on the same user input and the same template have an intersection.
[0165] For example, the third feature of the first template includes first information A and first information B. The user input includes content A#1 and content A#2 corresponding to first information A, and content B#1 corresponding to first information B. Therefore, by extracting information from the user input based on the first template, data sets #1 and #2 can be obtained respectively. Data set #1 includes content A#1 and content B#1, and data set #2 includes content A#2 and content B#1. That is, data sets #1 and #2 include the same content (B#1 corresponding to first information B) and different content (content A#1 and content A#2 corresponding to first information A, respectively).
[0166] Optionally, during step S302, more templates can be determined from the template set based on the user input. In some cases, user input can cover multiple scenarios, allowing different templates to be used to extract user input, avoiding information omissions during extraction and improving the accuracy of information extraction.
[0167] For example, N templates can be determined from the template set based on the semantic relevance between the user input and the first feature of each template, and information can be extracted from the user input based on each of the N templates to obtain multiple information extraction results. Here, N is an integer greater than or equal to 1 and less than or equal to M, and M is the number of templates included in the template set.
[0168] Optionally, N can be directly determined (for example, the templates determined from the template set can be preset to be the top N templates whose semantic relevance to the user input is arranged in descending order); or N can be indirectly determined (for example, the templates determined from the template set can be preset to satisfy that their semantic relevance to the user input is higher than a first value). This application embodiment does not limit the value of N, the value of the first value, or the method of determining N.
[0169] For ease of understanding, the following description uses the example of determining a second template from the template set based on the user input during step S302. This does not constitute a limitation on the number of templates that can be determined from the template set based on user input in the embodiments of this application.
[0170] Optionally, if the user input includes multiple application scenarios, method 300 may further include steps S305-S306:
[0171] S305: Determine a second template from the template set based on the user input.
[0172] Optionally, the second feature of the second template is different from the second feature of the first template, that is, the second feature of the second template and the second feature of the first template respectively indicate different application scenarios.
[0173] Optionally, the first feature of the second template is different from the first feature of the first template.
[0174] It should be noted that the process of "determining the second template from the template set" can refer to the relevant description of "determining the first template from the template set" in step S302 above, and the corresponding "first template" can be replaced with "second template". This embodiment of the application will not be described in detail here.
[0175] S306: Extract information from the user input based on the second template to obtain a third data set.
[0176] It should be understood that, based on the same user input, different information extraction results can be obtained according to different templates.
[0177] It should be noted that the process of "extracting information from the user input based on the second template to obtain a third data set" can refer to the relevant description of "extracting information from the user input based on the first template to obtain a first data set" in step S303 above. The corresponding "first template" can be replaced with "second template". This application embodiment will not be described in detail here.
[0178] Figure 4 This is a schematic diagram of a template construction process applicable to an embodiment of this application.
[0179] It should be noted that the embodiments of this application provide a unified paradigm template that can extract information from data of various scenarios and / or various types (or data sources) to obtain corresponding structured information extraction results.
[0180] Optionally, the various scenarios may include at least one of the following: logistics, orders, bills, alarms, reminders, to-do lists, notes, appointments, hotels, air tickets, trains, important days, cards, addresses, times, basic personal information, personal social attributes, personal economic attributes, social relationships with related persons, or interests and preferences, etc. It should be understood that the templates provided in this application embodiment can also be applied to other more scenarios, and this application embodiment does not limit them.
[0181] Optionally, the various types of data may include at least one of the following: clipboard, notification bar, memo, SMS, or conversations, etc. It should be understood that the data sources applicable to the embodiments of this application may also include other sources, such as other applications obtaining information collection-related permissions, and the embodiments of this application do not limit this.
[0182] The unified paradigm template may include the following fields:
[0183] (1) name: The second feature corresponding to method 300 is used to indicate the application scenario of the template.
[0184] (2) keys: Keys can include one or more different keys (corresponding to the first information in the third feature of method 300). Each key can be understood as corresponding to the same name (i.e. in the same scenario). Information extraction may involve related fields.
[0185] (3) Value description: Corresponding to the second information in the third feature of method 300, each key in keys corresponds to a value description, and each value description includes a description of the corresponding key (e.g., including the data type of the value corresponding to the key and a functional description of the key) and / or an example of the extraction result based on the corresponding key.
[0186] (4) Schema description: The first feature corresponding to method 300 is used to indicate the function of the template.
[0187] (5) Required keys: Corresponding to the fourth feature of method 300, used to indicate feature extraction based on at least one of the keys in the template.
[0188] It should be noted that the above fields (1)-(5) are only used to illustrate the function of the fields included in the unified paradigm template. The field names are not limited in this application embodiment.
[0189] In addition, for the specific content of the above fields (1)-(5), you can refer to the relevant description of the first feature, the second feature, the third feature and the fourth feature in the method 300 above. This application embodiment will not repeat it here.
[0190] It should also be noted that in practical applications, templates corresponding to different application scenarios can be constructed based on the aforementioned unified paradigm template to obtain template set #1 (which includes multiple templates, corresponding to the template set in method 300). Each template has a different function (i.e., each template has a different schema description).
[0191] Optionally, template set #1 may include templates with the same name (i.e., for the same application scenario, there may be multiple templates (each template may correspond to different keys)).
[0192] like Figure 4The diagram illustrates the process of template construction based on the aforementioned unified paradigm template. Specifically, based on the unified paradigm template, corresponding keys (including one or more keys) can be determined for different scenarios (names), and a corresponding value description (including a description of the corresponding key and / or an example of the extraction results based on the corresponding key) can be determined for each key. Furthermore, a schema description can be determined based on the determined value description (and keys), and the corresponding required keys can be set. This completes the construction of a MemorySchema (memory template) corresponding to a specific scenario.
[0193] For ease of understanding, the following explanation will use the construction of a "flight information" template based on a unified paradigm template as an example.
[0194] First, for the "Flight Information" template, we can determine that the value of its "name" corresponds to "memory_flight".
[0195] Furthermore, in the "properties" section, relevant keys can be determined based on the "flight information" scenario, including fields such as ["memoryIntent", "flightNumber", "airline", "timeZone", "departureTime", "departureCity", "departureAirport", "departureTerminal", "arrivalline", "arrivalcity", "arrivalAirport", "arrivalTerminal", "connectingFlightNumber", "connectingAirline", "connectingTime", "connectingcity", "connectingAirport", "connectingTerminal"]. A corresponding value description can be determined for each key, expanding the data format, specific description, and examples for each key-value pair. For example, for "memoryIntent", its corresponding value description may include the data type of the value extracted based on "memoryIntent" as "string", and the functional description of "memoryIntent": "Category information, used to highly summarize the main intent in the flight information, such as: flight change success notification, flight booking success notification, flight booking failure notification, etc." It should be noted that other keys are similar to "memoryIntent", and will not be described in detail here.
[0196] Additionally, the "description" field can be used to add a thematic description of the template's usage scenarios and the content it covers.
[0197] In the "properties" section, you can also specify which information (keys) is required using the "required" parameter.
[0198] Specifically, regarding "flight information," you can refer to the following template:
[0199]
[0200]
[0201] It should be understood that the above explanation uses the unified paradigm template for constructing flight information templates as an example. This unified paradigm template can also be used to construct templates applicable to other scenarios. Table 1, using 20 different high-frequency scenarios (name) as examples, shows the methods (data sources) for obtaining user input in different scenarios, each key in the keys required to be extracted from the input data (as shown in "schema key-value information," where for "A": "B," A represents a key, and B is a simple description of A), and corresponding examples. That is, templates applicable to other scenarios can also be constructed based on the unified paradigm template, corresponding to the content in Table 1.
[0202] Table 1
[0203]
[0204]
[0205]
[0206]
[0207]
[0208] It should be noted that the content of Table 1 is for illustrative purposes only and does not constitute a limitation on the scenarios in which the unified paradigm template described in the embodiments of this application can be applied, nor does it constitute a limitation on the content of keys that can be included in different scenarios. Similarly, it does not constitute a limitation on the data sources that can be used to obtain user input in different scenarios.
[0209] Optionally, the Memory Schema may also include a Raw Description of Schema, which provides a concise overview of the Memory Schema. For example, the Raw Description of Schema for the "Event" scenario in Table 1 is: Event information can be extracted based on user input. The Raw Description of Schema for the "Train" scenario in Table 1 is: Train information can be extracted based on user input. The Raw Description of Schema for the "Reservation" scenario in Table 1 is: Reservation information can be extracted based on user input.
[0210] Optionally, determining the schema description further includes: rewriting the Raw Description of Schema based on the value description using LLM to determine the schema description. Table 2 shows the results of rewriting the Raw Description of Schema based on two LLMs, where Paraphrase v1 is rewritten using GPT-4 and Paraphrase v2 is rewritten using Kimi. Rewriting enriches the semantic information of the schema description, enabling rapid retrieval of the Memory Schema and better utilization of the Memory Schema for scenario matching.
[0211] Table 2
[0212]
[0213]
[0214] It should be understood that after the template is built, further information extraction can be performed based on the built template.
[0215] Figure 5 This is a schematic diagram of an information extraction method 500 applicable to embodiments of this application.
[0216] It should be understood that the embodiments shown below do not particularly limit the specific structure of the execution subject of the method provided in the embodiments of this application. As long as a program containing the code of the method provided in the embodiments of this application can be run to generate virtual objects according to the method provided in the embodiments of this application, it is acceptable. For example, the method provided in the embodiments of this application can be executed by a processing device, which can be... Figure 1 The execution device in the text can also be a component of the execution device (e.g., a processor, chip, or chip system). This execution device can be a cloud device or a terminal device (e.g., a mobile phone). Of course, the method provided in the embodiments of this application can also be executed by a system that includes both cloud devices and terminal devices.
[0217] For ease of explanation, the following description uses a terminal device as the executing entity of method 500 as an example, which does not constitute a limitation on the executing entity of this application.
[0218] like Figure 5 As shown, method 500 may include the following steps:
[0219] S501: Get user input.
[0220] It should be noted that obtaining user input can be done directly or indirectly.
[0221] For example, corresponding to Figure 4 The various types of input data (data sources) shown allow users to directly input their needs into the terminal device through dialogue or other means. Alternatively, the terminal device can indirectly obtain user input through the clipboard, notification bar (e.g., push notifications), memos, or SMS messages.
[0222] It should be understood that the embodiments of this application do not limit the method by which the terminal device obtains user input.
[0223] S502: Schema Retrieval.
[0224] Specifically, semantic relevance retrieval of templates can be performed based on user input, that is, the Memory Schema can be determined from template set #1 based on the semantic similarity between the user input and the schema description (optionally, as an example of the first template and / or the second template in method 300 above). Template set #1 includes multiple Memory Schemas (for example, it may include Memory Schemas corresponding to different scenarios as shown in Table 1).
[0225] It should be noted that template set #1 can be pre-set in the terminal device; alternatively, it can be sent to the terminal device by other devices (e.g., servers or cloud devices); or it can be stored in the cloud device and retrieved by the terminal device through a corresponding interface after obtaining user input; or it can be obtained by the terminal device through software package updates, etc. Alternatively, the terminal device can directly send the user input to the cloud device, which will then execute subsequent steps and return the final result to the terminal device. This application embodiment does not limit the method of obtaining template set #1.
[0226] In addition, regarding the specific methods for determining semantic relevance, please refer to the relevant content in the current technology; this application does not limit such methods in this embodiment.
[0227] In one possible implementation, the semantic relevance of the user input and the schema description of each template in the template set can be determined separately, and the user input can be matched with the template corresponding to the schema description with the highest semantic relevance (e.g., Memory Schema#1).
[0228] In another possible implementation, the semantic relevance between the user input and the schema description of each template in the template set can be determined separately, and N templates (e.g., Memory Schema#1, ..., Memory Schema#N) corresponding to the N schema descriptions with high semantic relevance to the user input can be matched. Here, N is an integer greater than or equal to 1 and less than or equal to M, and M is the number of Memory Schemas included in the template set #1.
[0229] Optionally, N can be directly determined (for example, the templates determined from template set #1 can be preset to be the top N templates whose semantic relevance to the user input is arranged in descending order); or N can be indirectly determined (for example, the templates determined from template set #1 can be preset to satisfy that their semantic relevance to the user input is higher than a first value). This application embodiment does not limit the value of N, the value of the first value, or the method of determining N.
[0230] S503: Template-enhanced information extraction (Schema as Prompt).
[0231] Specifically, after completing the adaptive matching of the template based on the user input, instructions can be filled in based on the matched MemorySchema to generate a template-enhanced Prompt (Schema as Prompt, corresponding to the extraction instructions in step S303 above), and information can be extracted from the user input based on the template-enhanced Prompt.
[0232] For example, a prompt generated based on current technology is as follows:
[0233] {"meta_prompt": ["You are an intelligent assistant that generates highly effective responses for users (including usefulness, factual accuracy, and harmlessness). You can extract relevant information from XML template input, associate information between different fields, and finally generate a response that meets the requirements of the template.", "Your name is Xiaoyi, an intelligent assistant developed by Huawei."]}
[0234] [{“instruction”:“<Task Description>\nBased on <Constraints> and <Execution Steps>, identify the scene and corresponding slot information based on <User Input>.\n<Task Description>\n\n<Execution Steps>\nstep1. Classify the <User Input> according to <Classification Scene>\nstep2. Based on the classification results of step1, combine the <User Input>, <Extraction Target>, and <Constraints> to complete the slot extraction for the corresponding scene\n,…\n<Constraints>\n1. Ensure that the extracted information is both complete and accurate.\n2. Output strictly according to the <Output Format> based on the classification results.\n3. If there is no information to be extracted in the <User Input>, ignore the slot.\n4. The extracted slot must come from the extraction target set for the corresponding scene\n,…”}]
[0235] In this embodiment of the application, the template-enhanced Prompt is generated by populating instructions based on the matched Memory Schema, as shown in the following example:
[0236] ["You are an intelligent assistant. You generate highly comprehensive and accurate responses for users (useful, factual, harmless). You are an information extractor that identifies the corresponding slot information based on user input and fills it strictly according to the output format.\nThe output format is:\n{"subCategory":", "subject":", "cardIssuer":", "validFrom":", "validTo":", "emailAddress":", "vin":"}\nDetailed explanation of each field in the output format is as follows:\n{"subcategory":{"type":"string","description":"card type, such as: ID card / vehicle registration certificate / bank card / driver's license / passport / invoice / business card / vehicle inspection certificate / social security card / other certificates / invoice header."}","subject":{"type":"string","description":"card holder, used to describe the recipient of the card information, including user name, pseudonym, user number, such as: I, Dad, Zhang San, number 12138, user 9573608, etc. "}", "cardNumber": {"type": "string", "description": "Card number, used to describe the specific number of the card. If multiple exist, they are presented using list."}, "cardIssuer": {"type": "string", "description": "Issuing institution, used to describe the organization that issued the card."}, "validFrom": {"type": "string", "description": "Effective date, used to describe the effective or issued date of the card."}, "validTo": {"type": "string", "description": "Expiration date, used to describe the expiration date of the card."}, "emailAddress": {"type": "string", "description": "Email address, used to describe the cardholder's email contact address. If multiple exist, they are presented using list."}, "vin": {"type": "string", "description": "Vehicle Identification Code or VIN code, the corresponding Vehicle Identification Code or VIN code on the vehicle registration certificate, which exists in the vehicle registration certificate.} ”}}\n{“required”:[“subCategory”]}”].
[0237] As can be seen from the above, the current technology requires setting execution steps and corresponding constraints in the prompt, and binding different scenarios based on different execution steps and constraints (using the same prompt to extract information from different scenarios). However, on the one hand, user input may not include information corresponding to the scenario, and on the other hand, the diversity of user input makes it difficult to extract information in a uniform format. Both of these factors will affect the information extraction results. In contrast to the current technology, the template-enhanced Prompt (Schema as Prompt) in this application presents different content for different scenarios. For each key, a detailed description and / or example is given, and the data format of each value to be extracted corresponding to the key is given. While de-redundantizing the prompt content, it effectively improves the flexibility and accuracy of information extraction.
[0238] Tables 3-5 show the template matching (template recall) results using 2855 sequences (as user input) and 11 templates, based on different descriptions of the user input. Table 3 shows the template matching results based on the Raw Description of Schema, while Tables 4-5 show the template matching results after rewriting and improving the Memory Schema Description (Table 4 corresponds to the rewrite of Paraphrase v1 (GPT-4), and Table 5 corresponds to the rewrite of Paraphrase v2 (Kimi)). Here, recall@1 represents the recall rate of the top-ranked template (i.e., the template with the highest semantic relevance to the user input) after adaptive scene matching of the user input, sorted in descending order of semantic relevance. recall@3 represents the recall rate of the top-ranked template (the one with the highest semantic relevance to the user input) after adaptive scene matching of the user input, sorted in descending order of semantic relevance. recall@5 represents the recall rate of the top-ranked template (the one with the highest semantic relevance) after adaptive scene matching of the user input, sorted in descending order of semantic relevance.
[0239] Table 3
[0240]
[0241] Table 4
[0242]
[0243] Table 5
[0244]
[0245]
[0246] As shown in Table 3-5, rewriting and improving the Memory Schema Description helps to improve the Memory Schema retrieval recall effect. Furthermore, the latency for adaptive scene matching of a single user input is low (on the order of tens of milliseconds), which can meet the latency requirements for Memory Schema retrieval on the client side.
[0247] Based on the test results in Table 3-5, a preferred method for determining the schema description is to use the bge-m3 or bge-reranker-large model and rewrite the Raw Description of Schema based on Paraphrase v1 (GPT-4).
[0248] Similarly, the SFT training data can be modified using Schema as Prompt to further improve the model's ability to extract structured information. Table 6 shows a comparison of the effectiveness of information extraction using the current technology and the Memory Schema provided in this application embodiment for the same user input. Specifically, 130 sets of training data (including four major scenarios: address, important date, card, and event) were set up. Each set of training data includes a query (as user input) and the correct information extraction result corresponding to that query. As shown in Table 6, the Memory Schema provided in this application embodiment can improve the accuracy of information extraction. Taking GPT-3.5 as an example, for 130 sets of training data, the current technology solution only had 32 information extraction results that matched the correct information extraction results, while the Memory Schema-based solution had 105 queries that were correctly extracted. Furthermore, training optimization can also be performed using SFT training data modified based on Memory Schema. Table 7 shows some results of information extraction for the Qwen2-1.5B-Instruct model using SFT training data modified based on Memory Schema. As shown in Table 6, for the same model (e.g., Qwen2-1.5B-Instruct), modifying the training data based on Memory Schema (e.g., Qwen2-1.5B-Instruct(SFT)) resulted in a significant improvement in information extraction accuracy (from 44 / 130 (33.8%) to 124 / 130 (95.4%)). Therefore, extracting structured memory information based on the Memory Schema provided in this application can effectively improve the information extraction capabilities of various models.
[0249] Table 6
[0250] Model Current technology Memory Schema GPT-3.5 32 / 130(24.6%) 105 / 130(80.7%) GPT-4 75 / 130(57.7%) 109 / 130(83.8%) Qwen2-1.5B-Instruct 24 / 130(18.5%) 44 / 130(33.8%) Qwen2-7B-Instruct 36 / 130(27.7%) 73 / 130(53.2%) Qwen2-1.5B-Instruct(SFT) - 124 / 130(95.4%) Pangu-pi-1.5B(SFT) - 127 / 130(97.7%)
[0251] Table 7
[0252]
[0253]
[0254] To facilitate understanding of the above embodiments provided in this application, the following points are made.
[0255] (1) In the embodiments of this application, "instruction" may include direct instruction, indirect instruction, explicit instruction, and implicit instruction. When describing a certain instruction information for indicating A, it can be understood that the instruction information carries A, directly indicates A, or indirectly indicates A. In this application, the information indicated by the instruction information is called the information to be instructed. In the specific implementation process, there are many ways to indicate the information to be instructed, such as, but not limited to, directly indicating the information to be instructed, such as the information to be instructed itself or the index of the information to be instructed. It is also possible to indirectly indicate the information to be instructed by indicating other information, wherein there is an association between the other information and the information to be instructed. It is also possible to indicate only a part of the information to be instructed, while the other parts of the information to be instructed are known or agreed in advance. For example, the instruction of specific information can also be achieved by using the arrangement order of various information agreed in advance (e.g., stipulated by the protocol), thereby reducing the instruction overhead to a certain extent. In addition, the information to be instructed can be sent as a whole or divided into multiple sub-information to be sent separately, and the sending period and / or sending time of these sub-information can be the same or different.
[0256] (2) In the various embodiments of this application, unless otherwise specified or logically conflicting, the terms and / or descriptions of different embodiments are consistent and can be referenced by each other. The technical features of different embodiments can be combined to form new embodiments according to their inherent logical relationship.
[0257] (3) In this application, "first" and "second" are used for descriptive convenience only to distinguish objects and are not intended to limit the scope of the embodiments of this application. They are not used to describe the order or sequence of features. It should be understood that the objects described in this way can be interchanged where appropriate so as to describe solutions other than those in the embodiments of this application.
[0258] (4) In this application, “predefined” can be achieved by pre-storing the corresponding code, table or other means that can be used to indicate relevant information in the device. This application does not limit the specific implementation method.
[0259] (5) In this application, the words “exemplary,” “for example,” “exemplary,” “as another example,” etc., are used to indicate that they are examples, illustrations, or descriptions. Any embodiment or design that is described as an “exemplary” in this application should not be construed as being more preferred or advantageous than other embodiments or designs.
[0260] (6) In this application, “comprising,” “including,” “having,” and variations thereof mean “including but not limited to,” unless otherwise specifically emphasized. “At least one” means one or more, and “more” means two or more.
[0261] (7) In this application, "and / or" describes the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist simultaneously, or B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the related objects before and after are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, and c can mean: a, or, b, or, c, or, a and b, or, a and c, or, b and c, or, a, b, and c. Where a, b, and c can be single or multiple.
[0262] (8) Some optional features in the various embodiments of this application may not depend on other features in some scenarios, or may be combined with other features in some scenarios, without limitation.
[0263] In the above text, combined with Figures 3 to 5 The methods of the embodiments of this application have been described in detail. In order to implement the functions of the methods provided in this application, both the transmitting device and the receiving device may include hardware structures and / or software modules, and the above functions may be implemented in the form of hardware structures, software modules, or hardware structures plus software modules. Whether a certain function is implemented in the form of hardware structures, software modules, or hardware structures plus software modules depends on the specific application and design constraints of the technical solution.
[0264] The following is combined Figures 6 to 8 This application describes a data processing apparatus according to embodiments of the present application.
[0265] Figure 6 This is a schematic block diagram of a data processing device 600 provided in an embodiment of this application.
[0266] The device 600 can be implemented through software, hardware, or a combination of both. The device 600 provided in this application embodiment can implement the embodiments of this application. Figure 3The method flow shown includes an acquisition module 610 and a processing module 620.
[0267] The acquisition module 610 is used to acquire user input.
[0268] The processing module 620 is configured to: determine a first template from a template set based on the user input, the template set including multiple templates, each of the multiple templates including a first feature, a second feature and a third feature, the first feature indicating the function of the template, the second feature indicating the application scenario of the template, the third feature including multiple first pieces of information and multiple pieces of second information, each of the multiple first pieces of information indicating the information category corresponding to the second feature, each of the multiple second pieces of information corresponding one-to-one with each of the multiple first pieces of information, each of the second pieces of information including a description of the first information and / or an example of the extraction result based on the first information; and extract information from the user input based on the first template to obtain a first data set.
[0269] Optionally, the processing module 620 is further configured to: determine the first template from the template set based on the semantic relevance between the first feature of each template and the user input.
[0270] Optionally, the processing module 620 is further configured to: determine an extraction instruction based on the third feature of the first template; and extract information from the user input according to the extraction instruction to obtain a first data set, wherein the first data set includes information in the user input corresponding to the third feature of the first template.
[0271] Optionally, the processing module 620 is further configured to: determine the extraction instruction based on the third feature and the fourth feature of the first template.
[0272] Optionally, if the user input includes the same first information content corresponding to the third feature of the first template, the processing module 620 is further configured to: extract information from the user input based on the first template to obtain a second data set, wherein the second data set is different from the first data set and the second data set has an intersection with the first data set.
[0273] Optionally, if the user input includes multiple application scenarios, the processing module 620 is further configured to: determine a second template from the template set based on the user input, wherein the second feature of the second template and the second feature of the first template respectively indicate different application scenarios; and extract information from the user input based on the second template to obtain a third data set.
[0274] The device 600 here may be embodied in the form of a functional module. The term "module" here can be implemented in software and / or hardware, without specific limitation.
[0275] For example, a "module" can be a software program, a hardware circuit, or a combination of both that implements the above functions. For instance, the implementation of the acquisition module 610 in device 600 will be described below. Similarly, the implementation of other modules in device 600, such as the processing module 620, can refer to the implementation of the acquisition module 610.
[0276] As an example of a software functional unit, the acquisition module 610 may include code running on a computing instance. The computing instance may include at least one of a physical host (computing device), a virtual machine, or a container. Further, the aforementioned computing instance may be one or more. For example, the acquisition module 610 may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code may be distributed in the same region or in different regions. Further, the multiple hosts / virtual machines / containers used to run the code may be distributed in the same availability zone (AZ) or in different AZs, each AZ including one or more geographically proximate data centers. Typically, a region may include multiple AZs.
[0277] Similarly, multiple hosts / virtual machines / containers used to run this code can be distributed within the same Virtual Private Cloud (VPC) or across multiple VPCs. Typically, a VPC is set up within a region. Communication between two VPCs within the same region, as well as between VPCs in different regions, requires a communication gateway to be set up within each VPC to enable interconnection between VPCs.
[0278] As an example of a hardware functional unit, the acquisition module 610 may include at least one computing device, such as a server. Alternatively, the acquisition module 610 may also be a device implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be implemented using a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), generic array logic (GAL), or any combination thereof.
[0279] The multiple computing devices included in the acquisition module 610 can be distributed in the same region or in different regions. Similarly, the multiple computing devices included in the acquisition module 610 can be distributed in the same Availability Zone (AZ) or in different AZs. Likewise, the multiple computing devices included in the acquisition module 610 can be distributed in the same Virtual Private Cloud (VPC) or in multiple VPCs. These multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.
[0280] Therefore, the modules of the various examples described in the embodiments of this application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0281] It should be noted that the above embodiments of the device 600, when executing the above methods, are only illustrative examples of the division of functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device 600 can be divided into different functional modules to complete all or part of the functions described above. For example, the acquisition module 610 can be used to execute any step in the above methods, and the processing module 620 can be used to execute any step in the above methods. The steps implemented by the acquisition module 610 and the processing module 620 can be specified as needed, and all the functions of the device 600 can be realized by implementing different steps in the above methods through the acquisition module 610 and the processing module 620 respectively.
[0282] Furthermore, the apparatus and method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process can be found in the method embodiments above, which will not be repeated here.
[0283] The method provided in this application can be executed by a computing device, which can also be referred to as a computer system. It includes a hardware layer, an operating system layer running on top of the hardware layer, and an application layer running on the operating system layer. The hardware layer includes hardware such as processing units, memory, and memory control units; the functions and structure of this hardware will be described in detail later. The operating system can be any one or more computer operating systems that implement business processing through processes, such as Linux, Unix, Android, iOS, or Windows. The application layer includes applications such as browsers, address books, word processing software, and instant messaging software. Optionally, the computer system can be a handheld device such as a smartphone, or a terminal device such as a personal computer; this application does not particularly limit this, as long as the method provided in this application can be used. The executing entity of the method provided in this application can be a computing device, or a functional module within the computing device capable of calling and executing programs.
[0284] The following is combined Figure 7 This application provides a detailed description of a computing device provided in an embodiment.
[0285] Figure 7 This is a schematic diagram of the architecture of a computing device 700 provided in an embodiment of this application.
[0286] The computing device 700 can be a server, a computer, or other device with computing capabilities. Figure 7 The computing device 700 shown includes at least one processor 710 and a memory 720.
[0287] It should be understood that this application does not limit the number of processors and memories in the computing device 700.
[0288] The processor 710 executes instructions in the memory 720, causing the computing device 700 to implement the method provided in this application. Alternatively, the processor 710 executes instructions in the memory 720, causing the computing device 700 to implement the various functional modules provided in this application, thereby implementing the method provided in this application.
[0289] Optionally, the computing device 700 also includes a communication interface 730. The communication interface 730 uses a transceiver module, such as, but not limited to, a network interface card or a transceiver, to enable communication between the computing device 700 and other devices or communication networks.
[0290] Optionally, the computing device 700 also includes a system bus 740, wherein the processor 710, memory 720, and communication interface 730 are respectively connected to the system bus 740. The processor 710 can access the memory 720 through the system bus 740; for example, the processor 710 can perform data read / write or code execution in the memory 720 through the system bus 740. The system bus 740 is a peripheral component interconnect express (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The system bus 740 is divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0291] In one possible implementation, the processor 710 primarily functions to interpret the instructions (or code) of a computer program and process data within the computer software. The instructions of the computer program and the data within the computer software can be stored in memory 720 or cache 716.
[0292] Optionally, the processor 710 may be an integrated circuit chip with signal processing capabilities. By way of example and not limitation, the processor 710 may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. Among these, a general-purpose processor is a microprocessor, etc. For example, the processor 710 may be a central processing unit (CPU).
[0293] Optionally, each processor 710 includes at least one processing unit 712 and a memory control unit 714.
[0294] Optionally, the processing unit 712, also known as the core, is the most important component of the processor. The processing unit 712 is manufactured from single-crystal silicon using a specific production process. All calculations, command reception, command storage, and data processing are performed by the core. Each processing unit independently executes program instructions, utilizing parallel computing capabilities to accelerate program execution. Various processing units have fixed logical structures; for example, a processing unit includes logical units such as a Level 1 cache, a Level 2 cache, an execution unit, an instruction-level unit, and a bus interface.
[0295] In one implementation example, the memory control unit 714 controls the data interaction between the memory 720 and the processing unit 712. Specifically, the memory control unit 714 receives memory access requests from the processing unit 712 and controls access to memory based on the memory access requests. By way of example and not limitation, the memory control unit is a device such as a memory management unit (MMU).
[0296] In one implementation example, each memory control unit 714 addresses the memory 720 via the system bus. An arbitrator is configured in the system bus. Figure 7 (Not shown in the image), the arbitrator is responsible for handling and coordinating competing accesses by multiple processing units 712.
[0297] In one implementation example, the processing unit 712 and the memory control unit 714 are connected via internal chip connection lines, such as address lines, thereby enabling communication between the processing unit 712 and the memory control unit 714.
[0298] Optionally, each processor 710 also includes a cache 716, which is a buffer for data exchange (called a cache). When the processing unit 712 needs to read data, it first looks for the required data in the cache. If the data is found, it is executed directly; otherwise, it looks for the data in memory. Since the cache operates much faster than memory, its role is to help the processing unit 712 run faster.
[0299] The memory 720 provides runtime space for processes in the computing device 700. For example, the memory 720 stores the computer program (specifically, the program code) used to generate the process. After the computer program is run by the processor to generate a process, the processor allocates corresponding storage space for the process in the memory 720. Furthermore, the aforementioned storage space further includes text segments, initialized data segments, bit initialized data segments, stack segments, heap segments, etc. The memory 720 stores data generated during the process's execution, such as intermediate data or process data, in the aforementioned process-specific storage space.
[0300] Optionally, the memory, also known as RAM, is used to temporarily store the data processed by the processor 710, as well as data exchanged with external storage devices such as hard disks. As long as the computer is running, the processor 710 will load the data that needs to be processed into RAM for processing, and after the processing is completed, the processing unit 712 will send the result out.
[0301] By way of example and not limitation, memory 720 may be non-transitory memory, which may include volatile memory or non-volatile memory, or both. Non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory is random access memory (RAM) used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (SLDRAM), and direct rambus RAM (DRRAM). It should be noted that the memory 720 of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0302] The structures of the computing device 700 listed above are merely illustrative and are not limited thereto. The computing device 700 in this application includes various hardware components in existing computer systems. For example, the computing device 700 also includes other memories besides the memory 720, such as disk storage. Those skilled in the art should understand that the computing device 700 may also include other devices necessary for normal operation. Furthermore, depending on specific needs, those skilled in the art should understand that the computing device 700 may also include hardware devices for implementing other additional functions. In addition, those skilled in the art should understand that the computing device 700 may only include the devices necessary for implementing the embodiments of this application, and may not necessarily include... Figure 7 All the devices shown.
[0303] Figure 8 This is a schematic diagram of the architecture of a computing device cluster provided in an embodiment of this application.
[0304] The computing device cluster includes at least one computing device. This computing device may be a server. In some embodiments, the computing device may also be a terminal device such as a desktop computer, laptop computer, or smartphone.
[0305] like Figure 8 As shown, the computing device cluster includes at least one computing device 700. The memory 720 of one or more computing devices 700 in the computing device cluster may store the same instructions for performing the methods described above.
[0306] In some possible implementations, the memory 720 of one or more computing devices 700 in the computing device cluster may also each store a portion of the instructions for executing the above-described method. In other words, a combination of one or more computing devices 700 can jointly execute the instructions of the above-described method.
[0307] It should be noted that the memories 720 in different computing devices 700 within the computing device cluster can store different instructions, each used to execute a portion of the functions of the aforementioned apparatus. That is, the instructions stored in the memories 720 of different computing devices 700 can implement the functions of one or more modules within the aforementioned apparatus.
[0308] In some possible implementations, one or more computing devices in a computing device cluster can be connected via a network. This network can be a wide area network (WAN) or a local area network (LAN), etc.
[0309] For example, two computing devices 700A and 700B are connected via a network. Specifically, they are connected to the network through communication interfaces in each computing device.
[0310] It should be understood that the functions of computing device 700A can also be performed by multiple computing devices 700. Similarly, the functions of computing device 700B can also be performed by multiple computing devices 700.
[0311] This application also provides a data processing system, which may include the data processing device 600 described above.
[0312] This application also provides a computer program product containing instructions, which may be a software or program product containing instructions capable of running on a computing device or stored on any usable medium. When run on a computing device, it causes the computing device to perform the methods provided above, or causes the computing device to perform the functions of the apparatus provided above.
[0313] This application also provides a computer-readable storage medium, which can be any available medium capable of being stored by a computing device or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive). The computer-readable storage medium includes instructions that, when executed on a computing device, cause the computing device to perform the method provided above.
[0314] It should be understood that in the various embodiments of this application, the order of the above-mentioned processes does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0315] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0316] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0317] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0318] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0319] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0320] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0321] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A data processing method, characterized in that, include: Get user input; Based on the user input, a first template is determined from a template set, the template set including multiple templates, each template including a first feature, a second feature and a third feature, the first feature indicating the function of the template, the second feature indicating the application scenario of the template, the third feature including multiple first pieces of information and multiple second pieces of information, each of the multiple first pieces of information indicating the information category corresponding to the second feature, each of the multiple second pieces of information corresponding one-to-one with each of the multiple first pieces of information, each of the multiple second pieces of information including a description of the first information and / or an example of the extraction result based on the first information; Based on the first template, information is extracted from the user input to obtain a first data set.
2. The method according to claim 1, characterized in that, The third feature is determined based on the second feature, and the first feature is determined based on the second feature and the third feature.
3. The method according to claim 2, characterized in that, The first feature is determined based on the second feature and the third feature, and includes: The first feature is based on the Large Language Model (LLM) and is determined according to the second and third features.
4. The method according to any one of claims 1 to 3, characterized in that, The step of determining the first template from the template set based on the user input includes: The first template is determined from the template set based on the semantic relevance between the first feature of each template and the user input.
5. The method according to any one of claims 1 to 4, characterized in that, The step of extracting information from the user input based on the first template to obtain a first data set includes: Based on the third feature of the first template, an extraction instruction is determined; Information is extracted from the user input according to the extraction instruction to obtain a first data set, the first data set including information in the user input corresponding to the third feature of the first template.
6. The method according to claim 5, characterized in that, Each of the plurality of templates further includes a fourth feature, the fourth feature being used to indicate feature extraction based on at least one first piece of information in the third feature of the first template; The step of determining the extraction instruction based on the third feature of the first template further includes: The extraction instruction is determined based on the third and fourth features of the first template.
7. The method according to any one of claims 1 to 6, characterized in that, If the user input includes the same first information content corresponding to multiple third features of the first template, the method further includes: Information is extracted from the user input based on the first template to obtain a second data set. The second data set is different from the first data set, and the second data set has an intersection with the first data set.
8. The method according to any one of claims 1 to 7, characterized in that, If the user input includes multiple application scenarios, the method further includes: Based on the user input, a second template is determined from the template set, and the second feature of the second template and the second feature of the first template respectively indicate different application scenarios; Based on the second template, information is extracted from the user input to obtain a third data set.
9. A data processing apparatus, characterized in that, include: The acquisition module is used to acquire user input; The processing module is used to perform the following operations: Based on the user input, a first template is determined from a template set, the template set including multiple templates, each template including a first feature, a second feature and a third feature, the first feature indicating the function of the template, the second feature indicating the application scenario of the template, the third feature including multiple first pieces of information and multiple second pieces of information, each of the multiple first pieces of information indicating the information category corresponding to the second feature, each of the multiple second pieces of information corresponding one-to-one with each of the multiple first pieces of information, each of the multiple second pieces of information including a description of the first information and / or an example of the extraction result based on the first information; Based on the first template, information is extracted from the user input to obtain a first data set.
10. The apparatus according to claim 9, characterized in that, The third feature is determined based on the second feature, and the first feature is determined based on the second feature and the third feature.
11. The apparatus according to claim 10, characterized in that, The first feature is determined based on the second feature and the third feature, and includes: The first feature is based on the Large Language Model (LLM) and is determined according to the second and third features.
12. The apparatus according to any one of claims 9 to 11, characterized in that, The processing module is also used for: The first template is determined from the template set based on the semantic relevance between the first feature of each template and the user input.
13. The apparatus according to any one of claims 9 to 12, characterized in that, The processing module is also used for: Based on the third feature of the first template, an extraction instruction is determined; Information is extracted from the user input according to the extraction instruction to obtain a first data set, the first data set including information in the user input corresponding to the third feature of the first template.
14. The apparatus according to claim 13, characterized in that, Each of the plurality of templates further includes a fourth feature, the fourth feature being used to indicate feature extraction based on at least one first piece of information in the third feature of the first template; The processing module is also used for: The extraction instruction is determined based on the third and fourth features of the first template.
15. The apparatus according to any one of claims 9 to 14, characterized in that, If the user input includes the same first information content corresponding to multiple third features of the first template, the processing module is further configured to: Information is extracted from the user input based on the first template to obtain a second data set. The second data set is different from the first data set, and the second data set has an intersection with the first data set.
16. The apparatus according to any one of claims 9 to 15, characterized in that, If the user input includes multiple application scenarios, the processing module is further configured to: Based on the user input, a second template is determined from the template set, and the second feature of the second template and the second feature of the first template respectively indicate different application scenarios; Based on the second template, information is extracted from the user input to obtain a third data set.
17. A data processing apparatus, characterized in that, include: Memory, used to store computer programs; A processor for executing a computer program stored in the memory to cause the apparatus to perform the method as described in any one of claims 1 to 8.
18. A data processing system, characterized in that, The apparatus includes the data processing apparatus as described in any one of claims 9 to 16.
19. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed by a computer, enables the implementation of the method as described in any one of claims 1 to 8.
20. A chip or chip system, characterized in that, Includes: a circuit for performing the method as described in any one of claims 1 to 8.
21. A computer program product, characterized in that, The computer program product includes computer program code that, when run on a computer, enables the implementation of the method as described in any one of claims 1 to 8.