Data processing method and device based on large language model and electronic equipment

Through large language models of different scales, the problem of insufficient accuracy and speed of understanding complex requirements in the prior art is solved, and the ability to respond quickly and efficiently understand complex requirements is achieved.

CN118939771APending Publication Date: 2024-11-12SHANGHAI XIAODU TECHNOLOGY CO LTD
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202410980878.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-19
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

The existing large language models have insufficient accuracy and speed in understanding and responding to user complex needs, making it difficult to quickly and accurately understand and respond to user complex needs of multiple rounds of conversations and context-dependent.

Method used

Use large language models of different scales to process user input data together, use large language models with smaller scales to judge the intent complexity of input data, and use large-scale models to understand and split complex requirements when necessary to achieve rapid Responsive and accurate understanding.

Benefits of technology

While ensuring the rapid response of simple requirements, it improves the ability to understand complex requirements and improves the efficiency and accuracy of user demand response.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118939771A_ABST
    Figure CN118939771A_ABST
Patent Text Reader

Abstract

The invention provides a data processing method and device based on a large language model and electronic equipment, and relates to the technical field of artificial intelligence, in particular to the technical fields of AIGC (artificial intelligence generation content), large language models, deep learning and the like. The data processing method based on the large language model comprises the following steps: determining the complexity of an intention included in input data of a user by utilizing a first large language model; in response to the complexity indicating that the input data only comprises one intention, determining reply data of the input data based on the intention; or in response to the complexity indicating that the input data comprises a plurality of intentions: determining an intention sequence corresponding to the input data by using a second large language model, the scale of the second large language model being greater than that of the first large language model; and determining reply data of the input data based on the intention sequence.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence technology, in particular to technical fields such as AIGC (artificial intelligence generated content), large language models, and deep learning, and specifically to a data processing method and device based on a large language model, an electronic device, a computer-readable storage medium, and a computer program product. Background Art

[0002] Artificial intelligence is a discipline that studies how to use computers to simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.). It includes both hardware-level and software-level technologies. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, and big data processing; artificial intelligence software technologies mainly include computer vision technology, speech recognition technology, natural language processing technology, as well as machine learning / deep learning, big data processing technology, knowledge graph technology, and other major directions.

[0003] A large language model (LLM, also known as a large language model or large model) is a deep learning model trained using a large amount of text data, which can realize the understanding and generation of natural language text.

[0004] The methods described in this section are not necessarily methods that have been previously conceived or employed. Unless otherwise indicated, it should not be assumed that any method described in this section is considered to be prior art simply because it is included in this section. Similarly, unless otherwise indicated, the issues mentioned in this section should not be considered to have been recognized in any prior art. Summary of the invention

[0005] The present disclosure provides a data processing method and device based on a large language model, an electronic device, a computer-readable storage medium, and a computer program product.

[0006] According to one aspect of the present disclosure, a data processing method based on a large language model is provided, comprising: using a first large language model to determine the complexity of intents included in user input data; in response to the complexity indicating that the input data only includes one intent, determining reply data for the input data based on the intent; or in response to the complexity indicating that the input data includes multiple intents: using a second large language model to determine an intent sequence corresponding to the input data, wherein the scale of the second large language model is greater than that of the first large language model; and determining reply data for the input data based on the intent sequence.

[0007] According to one aspect of the present disclosure, a data processing device based on a large language model is provided, including: a first determination module, configured to determine the complexity of the intent included in the user's input data using the first large language model; a second determination module, configured to determine reply data of the input data based on the intent in response to the complexity indicating that the input data only includes one intent; and a third determination module, configured to determine, in response to the complexity indicating that the input data includes multiple intents: using the second large language model to determine an intent sequence corresponding to the input data, wherein the scale of the second large language model is larger than that of the first large language model; and determining reply data of the input data based on the intent sequence.

[0008] According to one aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor performs the above method.

[0009] According to one aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause a computer to execute the above method.

[0010] According to one aspect of the present disclosure, a computer program product is provided, comprising computer program instructions, which implement the above method when executed by a processor.

[0011] According to one or more embodiments of the present disclosure, it is possible to respond to user needs quickly and accurately.

[0012] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] The accompanying drawings exemplarily illustrate the embodiments and constitute a part of the specification, and together with the text description of the specification, are used to explain the exemplary implementation of the embodiments. The embodiments shown are for illustrative purposes only and do not limit the scope of the claims. In all drawings, the same reference numerals refer to similar but not necessarily identical elements.

[0014] Figure 1 A schematic diagram showing an exemplary system in which various methods described herein may be implemented according to an embodiment of the present disclosure;

[0015] Figure 2A flowchart of a data processing method based on a large language model according to an embodiment of the present disclosure is shown;

[0016] Figure 3 A schematic diagram showing a data processing process of an interactive system according to an embodiment of the present disclosure;

[0017] Figure 4 A structural block diagram of a data processing device based on a large language model according to an embodiment of the present disclosure is shown; and

[0018] Figure 5 A structural block diagram of an exemplary electronic device that can be used to implement the embodiments of the present disclosure is shown. DETAILED DESCRIPTION

[0019] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope of the present disclosure. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0020] In the present disclosure, unless otherwise specified, the use of the terms "first", "second", etc. to describe various elements is not intended to limit the positional relationship, temporal relationship, or importance relationship of these elements, and such terms are only used to distinguish one element from another element. In some examples, the first element and the second element may refer to the same instance of the element, and in some cases, based on the description of the context, they may also refer to different instances.

[0021] The terms used in the description of various examples in this disclosure are only for the purpose of describing specific examples and are not intended to be limiting. Unless the context clearly indicates otherwise, if the number of elements is not specifically limited, the element can be one or more. In addition, the term "and / or" used in this disclosure covers any one of the listed items and all possible combinations. "Multiple" refers to two or more.

[0022] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are all subject to the provisions of relevant laws and regulations and do not violate public order and good morals.

[0023] With the popularization of smart devices (such as mobile phones, smart speakers, smart watches, etc.), the interaction needs between users and smart devices have become more complex. It is an important prerequisite for smart devices to quickly and accurately understand user needs and respond to user needs quickly and accurately.

[0024] Traditional methods use predefined rules and templates to match user conversation texts to perform intent analysis on user conversation texts. This method can understand and respond to simple user needs (e.g., "play song A"), but it lacks generalization and is difficult to accurately understand and respond to complex needs expressed by users that have conditional dependencies (e.g., "If it rains tomorrow, remind me to bring an umbrella at 9 a.m. tomorrow") and context dependencies (e.g., entity references in multiple rounds of conversations).

[0025] With the development of large language model technology, an interactive system based on large language models has emerged. This interactive system uses a pre-trained large language model to identify the needs of users in the conversation text. However, the interactive system in the related art simply calls the pre-trained large language model without optimizing it for the human-computer interaction scenario, resulting in the understanding results of the large language model being relatively one-sided and inaccurate, making it difficult to meet user expectations. At the same time, due to the large scale of the large language model (i.e., the model includes a huge number of parameters), its reasoning speed is slow, making it difficult to quickly understand and respond to user needs.

[0026] In response to the above problems, an embodiment of the present disclosure provides a data processing method based on a large language model. The method uses a smaller large language model (i.e., the first largest language model) to determine whether the user's input data expresses a simple demand (i.e., a single intent) or a complex demand (i.e., multiple intents). If the user expresses a simple demand, the demand is directly responded to, thereby achieving a quick response to the simple demand. If the user expresses a complex demand (i.e., multiple intents), a larger large language model with stronger understanding ability (i.e., the second largest language model) is further used to understand and split the user's complex demands, thereby achieving accurate understanding and response to complex demands.

[0027] The embodiments of the present disclosure utilize large language models of different sizes to collaboratively process user input data, which can quickly respond to simple user demands while improving the ability to understand complex demands, thereby ensuring the efficiency and accuracy of responding to user demands.

[0028] The embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.

[0029] Figure 1 FIG. 1 is a schematic diagram of an exemplary system 100 in which various methods and apparatuses described herein may be implemented according to an embodiment of the present disclosure. Figure 1, the system 100 includes one or more client devices 101, 102, 103, 104, 105, and 106, a server 120, and one or more communication networks 110 coupling the one or more client devices to the server 120. The client devices 101, 102, 103, 104, 105, and 106 may be configured to execute one or more applications.

[0030] In an embodiment of the present disclosure, the client devices 101 , 102 , 103 , 104 , 105 , and 106 and the server 120 may run one or more services or software applications that enable execution of the data processing method.

[0031] In some embodiments, server 120 may also provide other services or software applications, which may include non-virtualized environments and virtualized environments. In some embodiments, these services may be provided as web-based services or cloud services, such as provided to users of client devices 101, 102, 103, 104, 105, and / or 106 under a software as a service (SaaS) model.

[0032] exist Figure 1 In the configuration shown, the server 120 may include one or more components that implement the functions performed by the server 120. These components may include software components, hardware components, or a combination thereof that can be executed by one or more processors. Users operating client devices 101, 102, 103, 104, 105, and / or 106 may in turn utilize one or more client applications to interact with the server 120 to utilize the services provided by these components. It should be understood that a variety of different system configurations are possible, which may differ from the system 100. Therefore, Figure 1 is one example of a system for implementing the various methods described herein and is not intended to be limiting.

[0033] Client devices 101, 102, 103, 104, 105, and / or 106 may provide an interface that enables a user of the client device to interact with the client device. The client device may also output information to the user via the interface. Figure 1 Only six client devices are depicted, but one skilled in the art will appreciate that the present disclosure may support any number of client devices.

[0034] Client devices 101, 102, 103, 104, 105 and / or 106 may include various types of computer devices, such as portable handheld devices, general-purpose computers (such as personal computers and laptop computers), workstation computers, wearable devices, smart screen devices, self-service terminal devices, service robots, vehicle-mounted devices, game systems, thin clients, various messaging devices, sensors or other sensing devices, etc. These computer devices may run various types and versions of software applications and operating systems, such as MICROSOFT Windows, APPLE iOS, UNIX-like operating systems, Linux or Linux-like operating systems; or include various mobile operating systems, such as MICROSOFT Windows Mobile OS, iOS, Windows Phone, Android. Portable handheld devices may include cellular phones, smart phones, tablet computers, personal digital assistants (PDAs), etc. Wearable devices may include head-mounted displays (such as smart glasses) and other devices. Game systems may include various handheld game devices, Internet-enabled game devices, etc. Client devices are capable of executing various different applications, such as various Internet-related applications, communication applications (such as email applications), short message service (SMS) applications, and may use various communication protocols.

[0035] The network 110 may be any type of network known to those skilled in the art that may support data communications using any of a variety of available protocols, including but not limited to TCP / IP, SNA, IPX, etc. By way of example only, the one or more networks 110 may be a local area network (LAN), an Ethernet-based network, a token ring, a wide area network (WAN), the Internet, a virtual network, a virtual private network (VPN), an intranet, an extranet, a blockchain network, a public switched telephone network (PSTN), an infrared network, a wireless network (e.g., Bluetooth, Wi-Fi), and / or any combination of these and / or other networks.

[0036] Server 120 may include one or more general purpose computers, dedicated server computers (e.g., PC (personal computer) servers, UNIX servers, mid-range servers), blade servers, mainframe computers, server clusters, or any other suitable arrangement and / or combination. Server 120 may include one or more virtual machines running virtual operating systems, or other computing architectures involving virtualization (e.g., one or more flexible pools of logical storage devices that may be virtualized to maintain a server's virtual storage device). In various embodiments, server 120 may run one or more services or software applications that provide the functionality described below.

[0037] The computing units in the server 120 may run one or more operating systems including any of the above operating systems and any commercially available server operating systems. The server 120 may also run any of a variety of additional server applications and / or middle-tier applications, including HTTP servers, FTP servers, CGI servers, JAVA servers, database servers, etc.

[0038] In some implementations, server 120 may include one or more applications to analyze and consolidate data feeds and / or event updates received from users of client devices 101, 102, 103, 104, 105, and / or 106. Server 120 may also include one or more applications to display data feeds and / or real-time events via one or more display devices of client devices 101, 102, 103, 104, 105, and / or 106.

[0039] In some embodiments, the server 120 may be a server of a distributed system, or a server combined with a blockchain. The server 120 may also be a cloud server, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology. A cloud server is a host product in a cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and virtual private servers (VPS) services.

[0040] The system 100 may also include one or more databases 130. In some embodiments, these databases may be used to store data and other information. For example, one or more of the databases 130 may be used to store information such as audio files and video files. The databases 130 may reside in various locations. For example, the database used by the server 120 may be local to the server 120, or may be remote from the server 120 and may communicate with the server 120 via a network-based or dedicated connection. The databases 130 may be of different types. In some embodiments, the databases used by the server 120 may be, for example, relational databases. One or more of these databases may store, update, and retrieve data to and from the databases in response to commands.

[0041] In some embodiments, one or more of the databases 130 may also be used by applications to store application data. The databases used by the applications may be different types of databases, such as a key-value store, an object store, or a conventional store backed by a file system.

[0042] Figure 1 The system 100 may be configured and operated in various ways to enable the application of various methods and apparatuses described in the present disclosure.

[0043] According to some embodiments, the user can interact with the client device 101-106 to input natural language data expressing his / her interaction needs, i.e., input data. The client device 101-106 or the server 120 can obtain reply data of the input data by executing the data processing method based on the large language model of the embodiment of the present disclosure using large language models of different scales, and output the reply data to the user through the client device 101-106.

[0044] Figure 2 2 shows a flow chart of a data processing method 200 based on a large language model according to an embodiment of the present disclosure. The execution subject of the method 200 may be a server, for example Figure 1 The server 120 shown in FIG. 1 may also be a client device, such as Figure 1 Client devices 101-106 are shown in FIG.

[0045] like Figure 2 As shown, method 200 includes steps S210 - S240 .

[0046] In step S210 , the complexity of the intention included in the user's input data is determined using the first language model.

[0047] In response to the complexity indicating that the input data only includes one intent, step S220 is executed. In step S220, reply data of the input data is determined based on the intent.

[0048] In response to the complexity indicating that the input data includes multiple intents, steps S230-S240 are executed.

[0049] In step S230, the second largest language model is used to determine the intention sequence corresponding to the input data, wherein the scale of the second largest language model is larger than the scale of the first largest language model.

[0050] In step S240 , based on the intention sequence, reply data of the input data is determined.

[0051] According to an embodiment of the present disclosure, a large language model with a smaller scale (i.e., the first large language model) is used to determine whether the user's input data expresses a simple demand (i.e., a single intent) or a complex demand (i.e., multiple intents). If the user expresses a simple demand, the demand is directly responded to, thereby achieving a quick response to the simple demand. If the user expresses a complex demand (i.e., multiple intents), a large language model with a larger scale and stronger understanding ability (i.e., the second largest language model) is further used to understand and split the user's complex demand, thereby achieving accurate understanding and response to the complex demand.

[0052] The embodiments of the present disclosure utilize large language models of different sizes to collaboratively process user input data, which can quickly respond to simple user demands while improving the ability to understand complex demands, thereby ensuring the efficiency and accuracy of responding to user demands.

[0053] In the embodiment of the present disclosure, the scales of the first large language model and the second large language model are different. The scale of the first large language model is smaller than the scale of the second large language model. It should be noted that in the embodiment of the present disclosure, the scale of the large language model (including the first large language model, the second large language model and the third large language model described below) refers to the scale of the parameters included in the large language model. The scale of the large language model can be expressed as the number of parameters included in the large language model, such as tens of billions, hundreds of billions, etc.; it can also be expressed as the storage space occupied by the parameters of the large language model, such as 1MB, 20MB, etc.

[0054] The large language model used in the embodiments of the present disclosure (including the first large language model, the second large language model, and the third large language model described below) can be obtained by fine-tuning a basic large language model of corresponding scale. The basic large language model can be obtained by pre-training using a large amount of unlabeled natural language corpus through an autoregressive unsupervised training method. That is, the basic large language model is a pre-trained large language model.

[0055] According to some embodiments, the large language model may adopt a decoder structure (Decoder-Only). The large language model of the decoder structure only includes a decoder (Decoder) in a transformer (Transformer) structure, but does not include an encoder (Encoder). The large language model of the decoder structure usually has good performance on text generation tasks. According to other embodiments, the large language model may also adopt a transformer structure including an encoder and a decoder.

[0056] In the embodiment of the present disclosure, the first large language model is a lightweight (i.e., small-scale) large language model, which is used to understand the user's input data and determine whether the user's input data expresses a simple demand or a complex demand. The first large language model may include, for example, 1MB of parameters.

[0057] The first large language model can be obtained by fine-tuning the lightweight first basic large language model. According to some embodiments, the training data used in fine-tuning can be a data pair consisting of the user's sample input data (which can also include sample historical conversation data, sample user portraits) and intent complexity labels (for example, including simple intent labels and complex intent labels). According to other embodiments, the training data used in fine-tuning can also be a data pair consisting of the user's sample input data (which can also include sample historical conversation data, sample user portraits) and intent type labels (for example, including single intent labels and complex intent labels such as song intent, weather query intent, device control intent, etc.).

[0058] In an embodiment of the present disclosure, the scale of the second largest language model is larger than that of the first largest language model, which is used to understand and split the complex needs of users. The second largest language model can be a medium-sized (i.e., medium-sized) large language model, which, for example, includes 10M or 20M parameters. In some embodiments, the second largest language model can also be a heavyweight (i.e., large-scale) large language model, which, for example, includes 400M parameters.

[0059] The second largest language model can be obtained by fine-tuning the medium-sized second basic large language model. According to some embodiments, the training data used in fine-tuning can be a data pair consisting of the user's sample input data (which can also include sample historical conversation data, sample user portraits) and intent sequence labels, so that the second largest language model has the ability to split the input data that expresses complex requirements. According to other embodiments, the training data used in fine-tuning can also be a data pair consisting of sample interface return data and reply data labels, so that the second largest language model has the ability to summarize the interface return data.

[0060] In step S210 , the complexity of the intention included in the user's input data is determined using the first language model.

[0061] The user can have multiple rounds of dialogue with the interactive system. According to some embodiments, the user's input data may be data input by the user in the current round of dialogue, that is, current dialogue data. The current dialogue data may be, for example, natural language text, voice, etc. input by the user. According to some embodiments, when the user's current dialogue data is voice, the voice may be recognized as text using voice recognition technology (for example, using a trained voice recognition model), and the text may be used as the above-mentioned input data of the interactive system.

[0062] When a user conducts multiple rounds of dialogue with an interactive system, the user's multiple rounds of dialogue data usually have contextual associations. For example, an abbreviation or alias is used in the following text to refer to an entity that has appeared in the previous text. If you only focus on the current dialogue data, you may not be able to understand the exact meaning of the current dialogue data. For example, in the first round of dialogue, the user's dialogue data is "Who is A?" Correspondingly, the interactive system outputs A's profile "A is a singer, ..." In the second round of dialogue, the user's dialogue data is "Play one of his songs." In the user's second round of dialogue data, "he" is used to refer to "singer A." If you only analyze the current dialogue data (i.e., the second round of dialogue data) without paying attention to the previous context, you may not understand who "he" in the dialogue data specifically refers to.

[0063] In addition, when the user's conversation data is voice, the recognized text may contain errors (such as typos or missing words) due to the user's use of dialect, unclear voice, or the limited recognition ability of the voice recognition model itself, which may not match the user's original needs. Therefore, it is impossible to accurately understand the user's needs. For example, the user's voice conversation data may be "Play a song by A", but the text after voice recognition is "Play a song by A'". A is a singer, and A' is an actor, which leads to a misunderstanding of the user's needs.

[0064] Considering that the original data input by the user may have the above-mentioned problems, it is impossible to accurately understand the user's needs. Therefore, according to some embodiments, the original data (text) input by the user can be processed to achieve text error correction and entity reference resolution, and then the processed text is used as the input data in step S210.

[0065] According to some embodiments, the input data in step S210 may be obtained by processing original data input by the user using the third language model.

[0066] According to some embodiments, the third largest language model may be used to perform error correction and coreference resolution on the original data input by the user to obtain the input data in step S210. The scale of the third largest language model is smaller than that of the second largest language model.

[0067] According to the above embodiment, the smaller third language model is used to quickly correct errors and resolve references on the original data input by the user, which can ensure the accuracy and completeness of the input data, thereby improving the accuracy of the intent recognition results of the input data.

[0068] The third language model is a lightweight large language model, which is used to rewrite the original data input by the user. For example, the third language model can correct the original text data "Play a song of A'" with speech recognition errors to "Play a song of A", or rewrite the original text data "Play a song of him" that refers to an entity to "Play a song of A".

[0069] According to some embodiments, the third language model can be obtained by fine-tuning the lightweight third basic language model. According to some embodiments, the training data used in fine-tuning can be a data pair consisting of the user's sample original data (which can also include sample historical conversation data and sample user portrait) and the rewritten sample input data.

[0070] According to some embodiments, the third basic large language model may be the same as the first basic large language model described above. Accordingly, the third large language model may be a lightweight large language model having the same scale as the first large language model.

[0071] According to some embodiments, the original data input by the user is the current conversation data between the user and the interactive system. Accordingly, using the third language model to perform error correction and reference resolution on the original data input by the user may include: inputting the original data (i.e., the current conversation data), the user's historical conversation data, and the user's user portrait into the third language model to obtain input data output by the third language model.

[0072] According to the above embodiment, the user's current conversation data is rewritten in combination with the user's historical conversation data and user portrait, which can improve the accuracy of the rewriting result (ie, input data).

[0073] After rewriting the original data input by the user using the third language model, accurate and complete rewritten input data is obtained. Further, in step S210, the first language model is used to understand the intent of the rewritten input data, thereby improving the accuracy of intent understanding.

[0074] According to some embodiments, step S210 may include steps S211 - S213 .

[0075] In step S211, the input data and the user's historical conversation data are input into the first language model. The input data may be the original data input by the user (i.e., the current conversation data), or may be the rewritten data obtained by rewriting the original data input by the user using the third language model.

[0076] In step S212, the intent type of the input data output by the first language model is obtained. The intent type may include, for example, complex intent, song intent, weather query intent, device control intent, etc. It can be understood that, except for complex intent, other intents such as song intent, weather query intent, device control intent, etc. are all single intents.

[0077] In step S213, based on the intent type, the complexity of the intent included in the input data is determined. Specifically, if the intent type is "complex intent", it means that the input data includes multiple intents and has high complexity. If the intent type is any intent type other than "complex intent", it means that the input data only includes a single intent of the intent type and has low complexity.

[0078] According to the above embodiment, the first language model has the ability to recognize a single intent. It can not only determine whether the user's needs only include a single intent, but also output the specific intent type of the single intent, thereby achieving rapid recognition and response to the single intent.

[0079] In step S220 , reply data of the input data is determined based on the single intention.

[0080] According to some embodiments, step S220 may include steps S221 and S222.

[0081] In step S221, the interface corresponding to a single intent is called to obtain the return data of the interface.

[0082] In step S222, reply data of the input data is generated based on the return data.

[0083] According to the above embodiment, the response data of simple requirements is generated by calling the corresponding interface, thereby improving the flexibility and scalability of the interactive system.

[0084] According to some embodiments, in step S221, interface parameters can be extracted from the input data, the interface corresponding to the intent is called based on the interface parameters, and the return data of the interface is obtained. For example, the intent type of the input data "Play a song by A" is "song", and the interface parameter "singer = A" of the song interface is extracted from the input data, and the interface parameter is sent to the song interface to call the song interface, and the address (e.g., URL) of song B returned by the song interface is obtained.

[0085] According to some embodiments, in step S222, the second largest language model may be used to generate reply data, thereby utilizing the powerful language understanding and generation capabilities of the second largest language model of larger scale to generate natural and fluent reply data. Specifically, the return data of the interface may be input into the second largest language model to obtain summary data generated by the second largest language model, such as "Song B will be played for you". The return data of the interface and the summary data generated by the large language model are combined as reply data to be fed back to the user.

[0086] In step S230, the second largest language model is used to determine the intention sequence corresponding to the input data.

[0087] According to some embodiments, input data may be input into a second largest language model to obtain an intention sequence output by the second largest language model.

[0088] In step S240 , based on the intention sequence, reply data of the input data is determined.

[0089] According to some embodiments, the intent sequence includes multiple intents and dependency relationships between the multiple intents. The dependency relationships between the multiple intents can be represented as a directed graph.

[0090] Accordingly, step S240 may include steps S241 and S242.

[0091] In step S241, based on the dependency relationship between multiple intents, the interfaces corresponding to the multiple intents are called in sequence to obtain the return data of each interface.

[0092] For example, for the input data expressing complex requirements, "play a song by A, and adjust the volume to 3", the second largest language model is used to obtain the intent sequence of {intent: song, device control-set volume, dependency: null}. There is no dependency between the song intent and the device control intent, and the corresponding song interface and device control interface can be called separately and in parallel to obtain the return data, that is, the URL address of song B and the volume control instruction.

[0093] For example, for the input data expressing complex requirements, "If it rains tomorrow, remind me to bring an umbrella at 9 o'clock tomorrow morning", the second largest language model is used to obtain its intent sequence as {Intent: weather query, device control-set reminder, dependency: weather query→device control-set reminder}. There is a dependency relationship between the weather query intent and the device control intent. It is necessary to call the weather query interface to query the weather first, and then determine whether the device control interface needs to be called based on the weather data returned by the weather query interface. It can be understood that if the weather data indicates that it will rain tomorrow, the device control interface is called to obtain the reminder setting instruction; if the weather data indicates that it will not rain tomorrow, there is no need to call the device control interface.

[0094] In step S242, reply data of the input data is generated based on the return data of the interfaces corresponding to the plurality of intents.

[0095] According to the above embodiment, based on the dependency relationship between multiple intentions, corresponding interfaces are called in sequence to generate reply data for complex requirements, which not only improves the flexibility and scalability of the interactive system, but also ensures the accuracy of the reply data.

[0096] According to some embodiments, the above step S222 or step S242 may include steps S1 and S2.

[0097] In step S1, the returned data of one or more interfaces are summarized using the second largest language model to generate summary data.

[0098] In step S2 , a combination of the summary data and the return data of the one or more interfaces is determined as reply data of the input data.

[0099] According to the above embodiment, the powerful language understanding and generation capabilities of the second largest language model of a larger scale are utilized to generate reply data, thereby improving the naturalness and fluency of the reply data.

[0100] For steps S1 and S2, for a single intent, the return data of an interface corresponding to the intent can be obtained. The return data is summarized using the second largest language model to obtain summary data. The interface return data and the summary data generated by the second largest language model are then combined to obtain reply data to be fed back to the user.

[0101] For example, the intent type of the input data "Play a song by A" is "song". By calling the song interface, the URL address of song B is obtained as the return data. The return data is input into the second largest language model to obtain the summary data generated by the second largest language model, such as "will play song B for you". The URL address of song B and the summary data "will play song B for you" generated by the large language model are used as the reply data to be fed back to the user.

[0102] For steps S1 and S2, for complex intents, the interfaces of each intent in the intent sequence can be called in sequence according to the intent sequence corresponding to the complex intent to obtain the return data of each interface. The return data of each interface is input into the second largest language model to obtain the summary data generated by the second largest language model. Then, the interface return data and the summary data generated by the second largest language model are combined to obtain the reply data to be fed back to the user.

[0103] For example, the intent sequence of the input data "If it rains tomorrow, remind me to bring an umbrella at 9 a.m. tomorrow" is {Intent: Weather Query, Device Control-Set Reminder, Dependency: Weather Query→Device Control-Set Reminder}. First, call the weather query interface to get tomorrow's weather. If it rains tomorrow, further call the device control interface so that the device control interface generates a reminder setting instruction for reminding the user to bring an umbrella at 9 a.m. tomorrow. The second largest language model is used to summarize the data returned by the weather query interface and the device control interface to generate summary data "The weather has been queried for you, and a to-do reminder has been set". The return data of the weather query interface and the device control interface and the summary data are combined to obtain the reply data to be fed back to the user "The weather has been queried for you, and it will rain tomorrow; the to-do reminder has been set, and you will be reminded to bring an umbrella at 9 a.m. tomorrow". If it does not rain tomorrow, there is no need to call the device control interface. The second largest language model is used to summarize the weather data returned by the weather query interface to generate summary data "The weather has been queried for you". Based on the summary data and weather data, the reply data to be fed back to the user "The weather has been queried for you, and it will be sunny and rainless tomorrow" is generated.

[0104] According to some embodiments, method 200 may further include steps S250 and S260.

[0105] In step S250, the return data of any interface is verified based on the preset security rule base.

[0106] In step S260, in response to the returned data passing verification, reply data is output.

[0107] According to the above embodiment, the security of the data returned by the interface is detected, and the reply data is output to the user only when the data security is confirmed, thereby ensuring the security of the interaction.

[0108] According to some embodiments, the security rule base may include a first security rule for verifying the security of resource content and a second security rule for verifying whether a device control instruction issued by a user is abnormal, thereby comprehensively verifying the interface return data to ensure the security of the interaction.

[0109] According to some embodiments, the security rule library may also include prompt information corresponding to the security rules. When the interface return data fails to pass the verification of a certain security rule, the prompt information corresponding to the security rule may be output, thereby prompting the user of possible security risks.

[0110] According to some embodiments, the returned data of the interface includes multimedia resources, such as text (including news, papers, novels, etc.), images, videos, audios, etc. Accordingly, the method 200 may further include step S270.

[0111] In step S270, in response to the multimedia resource failing to pass the verification of the first security rule in the security rule library, security risk prompt information corresponding to the first security rule is output.

[0112] According to the above embodiment, if the multimedia resources (such as text, images, etc.) returned by the interface are not safe, corresponding words (ie, security risk warning information) are output to remind the user of the security risks of the multimedia resources.

[0113] For example, the first security rule may be "filter text containing sensitive word X", and the corresponding security risk prompt information may be "this text contains sensitive words and is not displayed according to regulations", "sorry, no relevant resources found", etc. If the text resource returned by the interface contains sensitive word X, the text resource fails to pass the verification of the first security rule, and the corresponding security risk prompt information "this text contains sensitive words and is not displayed according to regulations" or "sorry, no relevant resources found" is output.

[0114] According to some embodiments, the return data of the interface includes device control instructions. Accordingly, the method 200 may further include steps S281-S283.

[0115] In step S281, in response to the device control instruction failing to pass the verification of the second security rule in the security rule base, output confirmation guidance information, which is used to guide the user to confirm whether to execute the device control instruction.

[0116] In step S282, the confirmation information input by the user in response to the confirmation guidance information is obtained.

[0117] In step S283, based on the user's confirmation information, it is determined whether to execute the device control instruction.

[0118] According to the above embodiment, if the interface returns a device control instruction (for example, starting a speaker, increasing the volume, etc.), a confirmation is initiated to the user to prevent the erroneous execution of erroneous device control instructions generated due to misunderstanding of the requirements of the speech recognition model, large language model or intent interface.

[0119] The second security rule is used to verify the device control instruction returned by the device control interface to determine whether the device control instruction is consistent with the user's current scene. For example, the second security rule may be "the instruction to turn on the speaker conflicts with the sleep scene", and the corresponding confirmation guidance information may be "please confirm whether you want to turn on the speaker". If the device control instruction returned by the interface is an instruction to start the speaker, then according to the second security rule, the user's current scene is obtained (for example, obtained through a mobile phone, smart watch, or other device) to determine whether the user is in a sleep scene. If the user is in a sleep scene, the instruction to start the speaker may be misidentified (for example, the user's sleep talk is mistakenly recognized to generate an instruction to start the speaker), and the corresponding confirmation guidance information "Please confirm whether you want to turn on the speaker" is output if the verification of the above second security rule is not passed. If the confirmation information "yes" input by the user is obtained within a certain time (for example, 1 minute, 3 minutes, etc.), the instruction to start the speaker is executed. If the user's confirmation information is not obtained within a certain time, or the user's confirmation information is "no"

[0120] Figure 3 A schematic diagram showing a data processing process of the interactive system 300 according to an embodiment of the present disclosure is shown.

[0121] like Figure 3 As shown, the interactive system 300 includes an error correction and rewriting module 310 , an intention recognition module 320 , a memory module 330 , a central control module 340 , a plug-in (interface) scheduling module 350 , a summary module 360 ​​and a security filtering module 370 .

[0122] Figure 3 The left side shows the offline preparation process of the interactive system 300 , that is, based on the large language model (LLM) system 380 , a lightweight error correction model 381 , a lightweight understanding model 382 , and a heavyweight summary model 383 are trained.

[0123] The LLM system includes multiple pre-trained basic large language models of different sizes. By fine-tuning the smaller lightweight basic large language model using different training data, a lightweight error correction model 381 and an understanding model 382 are obtained. By fine-tuning the medium-sized medium-sized basic large language model, a medium-sized summary model 383 is obtained.

[0124] In the online task of the interactive system 300, the error correction model 381 is called by the error correction and rewriting module 310 in the interactive system 300 to correct and rewrite the speech recognition results of the user dialogue data in combination with its previous context information to obtain the rewritten user text (corresponding to the input data in the above step S210) to solve the recognition bias of speech recognition and the reference resolution problem of multi-round dialogues.

[0125] In the online task of the interactive system 300, the understanding model 382 is called by the intention recognition module 320 in the interactive system 300 to perform simple demand judgment on the rewritten user text to identify a single intention in the user text and determine whether there is a complex intention in the user text.

[0126] In the online task of the interactive system 300, the summary model 383 is called by the central control module 340 and the summary module 360 ​​in the interactive system 300 to split the complex intent identified by the understanding model 383 into multiple single intents, analyze the dependencies between the single intents, and summarize the interface return data of each intent to obtain the reply data to be fed back to the user.

[0127] In the offline preparation process of the interactive system 300, in addition to preparing the error correction model 381, the understanding model 382 and the summary model 383 based on the LLM system 380, it is also necessary to establish a security rule base. The security rule base can include content security rules and instruction security rules. In the online task of the interactive system 300, the security rule base is called by the security filtering module 370 of the interactive system 300 to detect the content security and behavior (instruction) security of the output results of the summary module 360, and intercept the results with security risks.

[0128] The online data processing process of the interactive system 300 is described below.

[0129] The user can have a voice conversation with the interactive system 300. By performing voice recognition on the user's current conversation data, a recognition text (query) is obtained.

[0130] The error correction and rewriting module 310 obtains the user portrait and the context information of the user's multi-round dialogue provided by the memory module 330, combines the two with the user's recognition text, and inputs them into the lightweight error correction model 381. The error correction model 381 is used to determine whether the user semantics of the speech recognition is accurate, and rewrites the sentences with speech recognition errors and multi-round references to obtain the rewritten user text with a complete main body and correct semantics.

[0131] The intention recognition module 320 obtains the context information of multiple rounds of dialogue provided by the memory module 330, and combines it with the rewritten user text and inputs it into the lightweight understanding model 382, ​​so as to understand the user's needs by using the model 382. If the user's needs are identified as a single intention, the intention recognition result of the model 382 is provided to the central control module 340 for processing. If the user's needs are identified as complex needs, the rewritten user text is provided to the summary module 360 ​​for intention splitting.

[0132] The memory module 330 is used to provide each module with dialogue context information and user portrait information (such as user attributes, preferences, etc.), and to store the current human-computer dialogue information and extract user portrait information after the central control module 340 completes plug-in scheduling.

[0133] The central control module 340 is used to process the output results of the intent recognition module 320. For a single intent, it is output to the plug-in scheduling module 350 so as to call the corresponding plug-in (such as information retrieval plug-in, resource acquisition plug-in, instruction issuance plug-in, etc.) to obtain the return data of the plug-in (such as real-time search results, multimedia resources, device control instructions, etc.), and the return data is output to the summary module 360 ​​for screening and summarization. For complex intents, the rewritten user text is provided to the summary module 360 ​​for complex demand splitting, and the intent sequence returned by the summary module 360 ​​is obtained. The intents in the intent sequence are scheduled by plug-ins one by one to obtain the return data of each plug-in, and the return data is output to the summary module 360 ​​for screening and summarization. After the current round of dialogue interaction is completed, the dialogue information of this round is stored in the storage system through the memory module 330.

[0134] The plug-in scheduling module 350 is used to schedule different plug-ins based on the scheduling instructions issued by the central control module 340, such as information retrieval plug-ins, resource (news, music, etc.) acquisition plug-ins, weather query plug-ins, instruction issuance plug-ins (used to issue device control instructions, such as instructions for adjusting device volume, screen brightness, instructions for remotely controlling associated devices, etc.), etc., and provide the return data of the plug-in to the central control module 340 to construct the input of the summary model 383.

[0135] The summary module 360 ​​is used to split the complex intent sent by the central control module 340 into intent sequences, and summarize, filter and polish the return data of each plug-in sent by the central control module 340 to obtain reply data to be fed back to the user.

[0136] The security filtering module 370 uses the security rule base established offline to perform security checks on the reply data output by the summary module 360, including checking the security of multimedia resources and the rationality of device control instructions. If the security check passes, the reply data is output to the user through the smart device. If it is detected that the multimedia resources are not safe, the reply data is intercepted, that is, the reply data is not output to the user, but the corresponding words are output, for example, "This text contains sensitive words and is not displayed according to regulations", "Sorry, no relevant resources are found", etc. If it is detected that the device control instruction is unreasonable, a confirmation is initiated to the user through the smart device. If the user confirms that the device control instruction is correct within a period of time (for example, 1 minute), the reply data is output; if the user does not feedback the confirmation information within a period of time or confirms that the device control instruction is incorrect, the reply data is intercepted and not output.

[0137] According to an embodiment of the present disclosure, a data processing device based on a large language model is also provided. Figure 4 FIG. 4 shows a structural block diagram of a data processing device 400 according to an embodiment of the present disclosure. Figure 4 As shown, the apparatus 400 includes a first determination module 410 , a second determination module 420 and a third determination module 430 .

[0138] The first determination module 410 is configured to determine the complexity of the intention included in the user's input data by using a first large language model.

[0139] The second determination module 420 is configured to determine reply data of the input data based on the intent in response to the complexity indicating that the input data only includes one intent.

[0140] The third determination module 430 is configured to, in response to the complexity indicating that the input data includes multiple intents: determine an intent sequence corresponding to the input data using a second large language model, wherein the scale of the second large language model is larger than the scale of the first large language model; and determine reply data for the input data based on the intent sequence.

[0141] According to an embodiment of the present disclosure, a large language model with a smaller scale (i.e., the first large language model) is used to determine whether the user's input data expresses a simple demand (i.e., a single intent) or a complex demand (i.e., multiple intents). If the user expresses a simple demand, the demand is directly responded to, thereby achieving a quick response to the simple demand. If the user expresses a complex demand (i.e., multiple intents), a large language model with a larger scale and stronger understanding ability (i.e., the second largest language model) is further used to understand and split the user's complex demand, thereby achieving accurate understanding and response to the complex demand.

[0142] The embodiments of the present disclosure utilize large language models of different sizes to collaboratively process user input data, which can quickly respond to simple user demands while improving the ability to understand complex demands, thereby ensuring the efficiency and accuracy of responding to user demands.

[0143] According to some embodiments, the first determination module includes: an input unit, configured to input the input data and the user's historical conversation data into the first large language model; an acquisition unit, configured to acquire the intent type of the input data output by the first large language model; and a determination unit, configured to determine the complexity of the intent included in the input data based on the intent type.

[0144] According to some embodiments, the second determination module includes: a first calling unit, configured to call the interface corresponding to the intent to obtain return data of the interface; and a first generating unit, configured to generate reply data of the input data based on the return data.

[0145] According to some embodiments, the intention sequence includes multiple intentions and dependencies between the multiple intentions, and wherein the third determination module includes: a second calling unit, configured to call the interfaces corresponding to the multiple intentions in sequence based on the dependencies to obtain return data of each interface; and a second generating unit, configured to generate reply data of the input data based on the return data of the interfaces corresponding to the multiple intentions.

[0146] According to some embodiments, the first generation unit or the second generation unit includes: a summarizing subunit, configured to summarize the obtained return data of one or more interfaces using the second large language model to generate summary data; and a determining subunit, configured to determine a combination of the summary data and the return data of the one or more interfaces as the reply data.

[0147] According to some embodiments, the device 400 further includes: a verification module configured to verify the return data of any interface based on a preset security rule base; and a first output module configured to output the reply data in response to the return data passing the verification.

[0148] According to some embodiments, the returned data includes multimedia resources, and the device 400 also includes: a second output module, configured to output security risk warning information corresponding to the first security rule in the security rule library in response to the multimedia resource failing to pass the verification of the first security rule.

[0149] According to some embodiments, the return data includes device control instructions, and the apparatus 400 further includes: a third output module, configured to output confirmation guidance information in response to the device control instruction failing to pass the verification of the second security rule in the security rule base, wherein the confirmation guidance information is used to guide the user to confirm whether to execute the device control instruction; an acquisition module, configured to acquire confirmation information input by the user for the confirmation guidance information; and a fourth determination module, configured to determine whether to execute the device control instruction based on the confirmation information.

[0150] According to some embodiments, the device 400 further includes: a rewriting module configured to use a third largest language model to perform error correction and reference resolution on original data input by the user to obtain the input data, wherein the scale of the third largest language model is smaller than the scale of the second largest language model.

[0151] According to some embodiments, the original data is the user's current conversation data, and wherein the rewriting module is further configured to: input the original data, the user's historical conversation data and the user's user portrait into the third largest language model to obtain the input data output by the third largest language model.

[0152] It should be understood that Figure 4 The various modules and units of the apparatus 400 shown in FIG. 4 can be compared with those of the reference Figure 2 The steps in the method 200 described above correspond to each other. Therefore, the operations, features and advantages described above for the method 200 are also applicable to the device 400 and the modules and units included therein. For the sake of brevity, some operations, features and advantages are not repeated here.

[0153] Although specific functionality is discussed above with reference to specific modules, it should be noted that the functionality of the various modules discussed herein may be separated into multiple modules, and / or at least some functionality of multiple modules may be combined into a single module.

[0154] It should also be understood that various techniques may be described herein in the general context of software hardware elements or program modules. Figure 4 The various units described can be implemented in hardware or in hardware in combination with software and / or firmware. For example, these units can be implemented as computer program codes / instructions, which are configured to be executed in one or more processors and stored in a computer-readable storage medium. Alternatively, these units can be implemented as hardware logic / circuits. For example, in some embodiments, one or more of modules 410-430 can be implemented together in a system on chip (System on Chip, SoC). SoC can include an integrated circuit chip (which includes a processor (e.g., a central processing unit (CPU), a microcontroller, a microprocessor, a digital signal processor (DSP), etc.), a memory, one or more communication interfaces, and / or one or more components in other circuits), and can optionally execute the received program code and / or include embedded firmware to perform functions.

[0155] According to an embodiment of the present disclosure, there is also provided an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor, the memory storing instructions executable by the at least one processor, the instructions being executed by the at least one processor so that the at least one processor executes the data processing method based on a large language model of an embodiment of the present disclosure.

[0156] According to an embodiment of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is also provided. The computer instructions are used to enable a computer to execute the data processing method based on a large language model of an embodiment of the present disclosure.

[0157] According to an embodiment of the present disclosure, a computer program product is also provided, including computer program instructions, which, when executed by a processor, implement the data processing method based on a large language model of an embodiment of the present disclosure.

[0158] refer to Figure 5 , a block diagram of an electronic device 500 that can be used as a server or client of the present disclosure will now be described, which is an example of a hardware device that can be applied to various aspects of the present disclosure. The electronic device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0159] like Figure 5 As shown, the electronic device 500 includes a computing unit 501, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 502 or a computer program loaded from a storage unit 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic device 500 can also be stored. The computing unit 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0160] Multiple components in the electronic device 500 are connected to the I / O interface 505, including: an input unit 506, an output unit 507, a storage unit 508, and a communication unit 509. The input unit 506 can be any type of device that can input information to the electronic device 500. The input unit 506 can receive input digital or character information and generate key signal input related to user settings and / or function control of the electronic device, and can include but is not limited to a mouse, a keyboard, a touch screen, a track pad, a track ball, a joystick, a microphone, and / or a remote controller. The output unit 507 can be any type of device that can present information, and can include but is not limited to a display, a speaker, a video / audio output terminal, a vibrator, and / or a printer. The storage unit 508 can include but is not limited to a disk, an optical disk. The communication unit 509 allows the electronic device 500 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks, and can include but is not limited to a modem, a network card, an infrared communication device, a wireless communication transceiver, and / or a chipset, such as a Bluetooth device, an 802.11 device, a Wi-Fi device, a WiMAX device, a cellular communication device, and / or the like.

[0161] The computing unit 501 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 501 performs the various methods and processes described above, such as method 200. For example, in some embodiments, the method 200 may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 508. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 500 via the ROM 502 and / or the communication unit 509. When the computer program is loaded into the RAM 503 and executed by the computing unit 501, one or more steps of the method 200 described above may be performed. Alternatively, in other embodiments, the computing unit 501 may be configured to perform the method 200 in any other appropriate manner (e.g., by means of firmware).

[0162] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0163] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0164] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0165] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0166] The systems and techniques described herein can be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), the Internet, and a blockchain network.

[0167] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.

[0168] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0169] Although the embodiments or examples of the present disclosure have been described with reference to the accompanying drawings, it should be understood that the above-mentioned methods, systems and devices are merely exemplary embodiments or examples, and the scope of the present disclosure is not limited by these embodiments or examples, but is only limited by the claims after authorization and their equivalent scope. Various elements in the embodiments or examples may be omitted or replaced by their equivalent elements. In addition, each step may be performed in an order different from that described in the present disclosure. Further, the various elements in the embodiments or examples may be combined in various ways. It is important that with the evolution of technology, many of the elements described herein may be replaced by equivalent elements that appear after the present disclosure.

Claims

1. A data processing method based on a large language model, include: Determine the complexity of the intent included in the user's input data using the first language model; In response to the complexity indicating that the input data includes only one intent, determining reply data for the input data based on the intent; or In response to the complexity indicating that the input data includes a plurality of intents: Determining the intent sequence corresponding to the input data using a second largest language model, wherein the scale of the second largest language model is greater than the scale of the first largest language model; as well as Based on the intention sequence, reply data for the input data is determined.

2. The method according to claim 1, in, The method of using the first language model to determine the complexity of the intent included in the user's input data includes: Inputting the input data and the user's historical conversation data into the first language model; Obtaining the intent type of the input data output by the first language model; and Based on the intent type, the complexity of the intent included in the input data is determined.

3. The method according to claim 1 or 2, in, The determining of the reply data of the input data based on the intention comprises: Calling the interface corresponding to the intent to obtain return data of the interface; and Based on the returned data, reply data of the input data is generated.

4. The method according to any one of claims 1 to 3, in, The intention sequence includes multiple intentions and dependencies between the multiple intentions, and wherein determining the reply data of the input data based on the intention sequence includes: Based on the dependency relationship, calling the interfaces corresponding to the multiple intents in sequence to obtain return data of each interface; and Based on the return data of the interfaces corresponding to the multiple intents, reply data of the input data is generated.

5. The method according to claim 3 or 4, in, The generating of the reply data of the input data comprises: Summarizing the returned data of the one or more interfaces using the second largest language model to generate summary data; and A combination of the summary data and the return data of the one or more interfaces is determined as the reply data.

6. The method according to any one of claims 3 to 5, further comprising: include: Verify the return data of any interface based on the preset security rule base; as well as In response to the return data passing the verification, the reply data is output.

7. The method according to claim 6, in, The returned data includes multimedia resources, and the method further includes: In response to the multimedia resource failing to pass the verification of the first security rule in the security rule library, outputting security risk prompt information corresponding to the first security rule.

8. The method according to claim 6, in, The returned data includes a device control instruction, and the method further includes: In response to the device control instruction failing to pass the verification of the second security rule in the security rule base, outputting confirmation guidance information, wherein the confirmation guidance information is used to guide the user to confirm whether to execute the device control instruction; Acquiring confirmation information input by the user in response to the confirmation guidance information; and Based on the confirmation information, it is determined whether to execute the device control instruction.

9. The method according to any one of claims 1 to 8, further comprising: include: The original data input by the user is corrected and reference resolved by using a third largest language model to obtain the input data, wherein the scale of the third largest language model is smaller than the scale of the second largest language model.

10. The method according to claim 9, in, The original data is the current conversation data of the user, and wherein the using the third language model to perform error correction and reference resolution on the original data input by the user comprises: The original data, the user's historical conversation data and the user's user portrait are input into the third language model to obtain the input data output by the third language model.

11. A data processing device based on a large language model, include: A first determination module is configured to determine the complexity of the intention included in the user's input data using a first large language model; a second determination module, configured to, in response to the complexity indicating that the input data only includes one intent, determine reply data for the input data based on the intent; as well as A third determining module is configured to: in response to the complexity indicating that the input data includes multiple intents: Determining the intent sequence corresponding to the input data using a second largest language model, wherein the scale of the second largest language model is greater than the scale of the first largest language model; as well as Based on the intention sequence, reply data for the input data is determined.

12. The device according to claim 11, in, The first determining module comprises: An input unit, configured to input the input data and the user's historical conversation data into the first language model; an acquiring unit, configured to acquire the intention type of the input data output by the first language model; and A determination unit is configured to determine the complexity of the intent included in the input data based on the intent type.

13. The device according to claim 11 or 12, in, The second determining module comprises: A first calling unit is configured to call an interface corresponding to the intent to obtain return data of the interface; and The first generating unit is configured to generate reply data of the input data based on the returned data.

14. The device according to any one of claims 11 to 13, in, The intention sequence includes multiple intentions and dependencies between the multiple intentions, and wherein the third determination module includes: A second calling unit is configured to call the interfaces corresponding to the plurality of intents in sequence based on the dependency relationship to obtain return data of each interface; and The second generating unit is configured to generate reply data of the input data based on the return data of the interfaces corresponding to the multiple intentions.

15. The device according to claim 13 or 14, in, The first generating unit or the second generating unit comprises: a summarizing subunit, configured to summarize the returned data of the one or more interfaces using the second largest language model to generate summary data; and The determining subunit is configured to determine a combination of the summary data and the return data of the one or more interfaces as the reply data.

16. The device according to any one of claims 13 to 15, further comprising: include: A verification module is configured to verify the return data of any interface based on a preset security rule base; as well as The first output module is configured to output the reply data in response to the return data passing the verification.

17. The device according to claim 16, in, The returned data includes multimedia resources, and the device further includes: The second output module is configured to output security risk prompt information corresponding to the first security rule in the security rule library in response to the multimedia resource failing to pass the verification of the first security rule.

18. The device according to claim 16, in, The returned data includes a device control instruction, and the apparatus further includes: A third output module is configured to output confirmation guidance information in response to the device control instruction failing to pass the verification of the second security rule in the security rule library, wherein the confirmation guidance information is used to guide the user to confirm whether to execute the device control instruction; an acquisition module, configured to acquire confirmation information input by the user for the confirmation guidance information; and The fourth determination module is configured to determine whether to execute the device control instruction based on the confirmation information.

19. The device according to any one of claims 11 to 18, further comprising: include: The rewriting module is configured to use a third largest language model to perform error correction and reference resolution on original data input by the user to obtain the input data, wherein the scale of the third largest language model is smaller than the scale of the second largest language model.

20. The device according to claim 19, in, The original data is the current conversation data of the user, and wherein the rewriting module is further configured to: The original data, the user's historical conversation data and the user's user portrait are input into the third language model to obtain the input data output by the third language model.

21. An electronic device, include: at least one processor; as well as a memory communicatively coupled to the at least one processor; in The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 10.

22. A non-transitory computer-readable storage medium storing computer instructions, in, The computer instructions are used to make a computer execute the method according to any one of claims 1-10.

23. A computer program product comprising computer program instructions, in, The computer program instructions implement the method of any one of claims 1-10 when executed by a processor.

Citation Information

Cited By

  • Method and device for outputting data processing result, equipment, medium and product

    CN119148891A

  • Method, device, equipment, medium and product for outputting data processing results

    CN119148891B

  • Intelligent complex intention recognition method and system based on large model

    CN120950649A