Classification task processing method and device based on large model and related equipment

By constructing a classification label prefix tree to limit the decoding space of large models, the problem of inaccurate output results of large models in classification tasks is solved, and the quality and consistency of results are improved.

CN118779761APending Publication Date: 2024-10-15IFLYTEK CO LTD
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202410989208.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-23
Publication Date
2024-10-15

AI Technical Summary

Technical Problem

Large models have poor instruction following ability when processing classification tasks, resulting in output results with format errors, redundant content, and incomplete results. Even after supervised fine-tuning, the phenomenon of 'large model hallucination' cannot be completely avoided, resulting in classification results. Not high quality.

Method used

By building a classification label prefix tree based on the target classification task, the decoding space of the large model is limited so that the tokens it outputs are only within the range of candidate classification labels, avoiding format errors and content redundancy, and ensuring that the output results match predefined labels.

Benefits of technology

It improves the quality of the output results of large models in classification tasks, ensures the accuracy and consistency of the output results, and avoids the problems of format errors and redundant content.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118779761A_ABST
    Figure CN118779761A_ABST
Patent Text Reader

Abstract

The invention discloses a classification task processing method and device based on a large model, related equipment and a computer program product, a corresponding classification label prefix tree is configured in combination with a candidate classification label set of a target classification task to be processed, and in the process of calling the large model to decode a classification result of the target classification task, the classification result of the target classification task is decoded by the large model. When the i token is decoded, the probability distribution of each token in the vocabulary space is calculated, the classification label prefix tree is utilized to prune the probability distribution, and the vocabulary space when the large model decodes and outputs the token each time is limited, so that the final decoding result of the large model is limited in each candidate classification label contained in the classification label prefix tree; the problems of format errors, content redundancy, mismatching with the candidate classification labels and the like of results output by the large model are avoided, and the quality of the results output when the large model processes the classification task is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of natural language processing technology, and more specifically, to a classification task processing method, apparatus, related equipment and computer program product based on a large model. Background Art

[0002] In the field of natural language processing, classification tasks are a common task. The task goal is to predict the corresponding classification results given a part of the input information. Classification tasks include but are not limited to: intent slot extraction (i.e. determining the intent category and extracting slot information), sentiment classification, etc.

[0003] With the rapid development of artificial intelligence big models and the natural real-time, interactivity, and strong semantic understanding capabilities of generative big models, more and more users are beginning to use the capabilities of big models to handle classification tasks. Taking the intent slot task as an example, the human-computer dialogue data can be fed into the big model, and the big model can be used to generate the user's intent category and extract key slot information from the input, such as the entities, time, and place mentioned by the user, to provide basic data for subsequent dialogue processing and execution.

[0004] However, as a generative model, the large model has poor instruction-following ability when it is not fine-tuned by supervised SFT. There will be problems such as format errors, redundant content, incomplete results, and fabricated answers when outputting. When using the large model to process classification tasks, it is easy for the output classification results to not match the predefined classification labels. In addition, although supervised fine-tuning SFT can alleviate the above problems, due to the existence of the "large model hallucination" phenomenon, it is found in actual test scenarios that such problems cannot be completely avoided, resulting in low-quality classification results output by the large model when processing classification tasks. Summary of the invention

[0005] In view of the above problems, this application is proposed to provide a classification task processing method, apparatus, related equipment and computer program product based on a large model to improve the quality of the output classification results when performing classification tasks based on a large model. The specific scheme is as follows:

[0006] In a first aspect, a classification task processing method based on a large model is provided, comprising:

[0007] Obtaining data to be processed related to the target classification task;

[0008] Get the configured classification label prefix tree, which is obtained by converting the candidate classification label set of the target classification task. The root node in the classification label prefix tree is the set decoding start symbol, each node corresponds to a character token, and the token sequence on the path from the root node to each leaf node corresponds to a candidate classification label in the set;

[0009] The configured large model is called to decode token by token based on the data to be processed and output the classification result of the target classification task, wherein when decoding the i-th token, the probability distribution of each token in the vocabulary space is calculated, and the probability distribution is pruned using the classification label prefix tree, and the i-th token to be output is determined based on the pruned probability distribution.

[0010] In a possible design, in another implementation of the first aspect of the embodiments of the present application, the process of pruning the probability distribution using the classification label prefix tree includes:

[0011] The probability values ​​of tokens other than the first token set in the probability distribution are set to preset infinitesimal values, wherein the first token set is a token set consisting of nodes in the i-th layer in the subtree where a token string consisting of the first i-1 tokens of the decoded output in the classification label prefix tree is located.

[0012] In a possible design, in another implementation of the first aspect of the embodiment of the present application, if the end of a candidate classification label contains target text content of variable length, a first setting symbol is used to replace the token of the target text content;

[0013] Correspondingly, before pruning the probability distribution using the classification label prefix tree, the method further includes:

[0014] Determine whether the first token set contains the first setting symbol;

[0015] If not, executing the step of pruning the probability distribution using the classification label prefix tree;

[0016] If so, for the i-th and subsequent tokens to be decoded, stop using the classification label prefix tree to prune the probability distribution.

[0017] In a possible design, in another implementation of the first aspect of the embodiment of the present application, the method further includes:

[0018] After decoding and outputting the i-th token, determine whether there is only one branch node in the i+1th layer in the subtree where the token string composed of the first i tokens that have been decoded and outputted in the classification label prefix tree is located. If so, stop the decoding process, determine the target path from the root node to the leaf node where the only branch node in the i+1th layer is located, and use the candidate classification label corresponding to the target path as the classification result of the target classification task.

[0019] In a possible design, in another implementation of the first aspect of the embodiment of the present application, when the target classification task is a single-label classification task type, the classification label prefix tree obtained is specifically a single-classification label prefix tree;

[0020] When the target classification task is a multi-label classification task type, the classification label prefix tree obtained is specifically a multi-classification label prefix tree;

[0021] Compared with the single-class label prefix tree, the multi-class label prefix tree adds two branches at each leaf node in the single-class label prefix tree, one of which contains a set decoding terminator, and the other is the single-class label prefix tree after pruning the path branch from the root node to the current leaf node.

[0022] In a possible design, in another implementation of the first aspect of the embodiments of the present application, the process of constructing the single-class label prefix tree includes:

[0023] Obtaining a set of candidate classification labels for the target classification task;

[0024] Traversing each candidate classification label in the candidate classification label set, and inserting the candidate classification labels into the single classification label prefix tree one by one, wherein the root node of the single classification label prefix tree is a set decoding start symbol;

[0025] For each of the candidate classification labels, starting from the root node, each token in the candidate classification label is traversed, and a corresponding node path is constructed in the single classification label prefix tree, wherein each node corresponds to a token.

[0026] In a possible design, in another implementation of the first aspect of the embodiment of the present application, each leaf node of the classification label prefix tree is a set decoding terminator;

[0027] The termination conditions of the large model decoding include: decoding to obtain the decoding terminator, or the length of the token sequence output by decoding reaches a set length threshold.

[0028] In one possible design, in another implementation of the first aspect of the embodiment of the present application, the target classification task includes: intent classification and slot extraction tasks, and correspondingly, the candidate classification label is a label composed of each candidate intent and its slot value.

[0029] In a second aspect, a classification task processing device based on a large model is provided, comprising:

[0030] A data acquisition unit, used to acquire data to be processed related to the target classification task;

[0031] A prefix tree acquisition unit is used to acquire a configured classification label prefix tree, wherein the classification label prefix tree is obtained by converting a candidate classification label set of a target classification task, wherein a root node in the classification label prefix tree is a set decoding start symbol, each node corresponds to a character token, and a token sequence on a path from the root node to each leaf node corresponds to a candidate classification label in the set;

[0032] A decoding unit is used to call the configured large model to decode token by token based on the data to be processed and output the classification result of the target classification task, wherein when decoding the i-th token, the probability distribution of each token in the vocabulary space is calculated, and the probability distribution is pruned using the classification label prefix tree, and the i-th token to be output is determined based on the pruned probability distribution.

[0033] In a third aspect, an electronic device is provided, comprising: a memory and a processor;

[0034] The memory is used to store programs;

[0035] The processor is used to execute the program to implement the various steps of the large model-based classification task processing method described in any one of the first aspects of the present application.

[0036] In a fourth aspect, a readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the various steps of the large model-based classification task processing method described in any one of the first aspects of the present application are implemented.

[0037] In a fifth aspect, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the various steps of the large model-based classification task processing method described in any one of the aforementioned first aspects of the present application.

[0038] With the help of the above technical scheme, the present application configures a corresponding classification label prefix tree in combination with the candidate classification label set of the target classification task to be processed. In the process of calling the large model to decode the classification result of the target classification task, when decoding the i-th token, the probability distribution of each token in the vocabulary space is calculated, and the probability distribution is pruned using the classification label prefix tree to limit the vocabulary space of the large model each time it decodes and outputs a token, so that the final decoding result of the large model is limited to the candidate classification labels contained in the classification label prefix tree, avoiding problems such as format errors, content redundancy, and mismatch with candidate classification labels in the output results of the large model, thereby improving the quality of the output results of the large model when processing classification tasks. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present application. Also, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0040] Figure 1 A schematic diagram of an implementation system architecture of a classification task processing method based on a large model provided in an embodiment of the present application;

[0041] Figure 2 A schematic diagram of a terminal structure provided in an embodiment of the present application;

[0042] Figure 3 A schematic diagram of a server structure provided in an embodiment of the present application;

[0043] Figure 4 A schematic diagram of a process flow of a classification task processing method based on a large model provided in an embodiment of the present application;

[0044] Figure 5 An example of a structural diagram of a single-category label prefix tree is shown;

[0045] Figure 6 Example Figure 5 A schematic diagram of the structure of a subtree contained in the prefix tree shown;

[0046] Figure 7 Example Figure 5 A schematic diagram of the structure of another subtree contained in the prefix tree shown;

[0047] Figure 8 An example of a structural diagram of a multi-classification label prefix tree is shown;

[0048] Fig. 9 A schematic diagram of the structure of a classification task processing device based on a large model provided in an embodiment of the present application;

[0049] Fig.10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0050] Before introducing this application solution, the relevant concepts involved in this article are first explained:

[0051] prompt: Instructions. When interacting with AI (such as an artificial intelligence model), you need to send instructions to AI. It can be a text description, such as "Please recommend me a pop song" when you interact with AI, or it can be a parameter description in a certain format. For example, if you want AI to draw in a certain format, you need to describe the relevant drawing parameters.

[0052] Large models: In the field of artificial intelligence, large models usually refer to large-scale pre-trained models. Such models are called "large" because they can be pre-trained on a large amount of data and can be transferred to a variety of downstream tasks. Their full English name is Large Pre-Trained Models or Large-Scale Pre-Training Models. Large models are characterized by their large scale and contain billions or even more parameters, which help them learn complex patterns in the data. The emerging capabilities of large models include but are not limited to: contextual learning, instruction following, code generation, step-by-step reasoning capabilities, etc. Large models can include large language models (LLMs) and multimodal large models. Large language models are mainly used to process text modal data. Multimodal large models further integrate multimodal capabilities on the basis of large language models and can process information in multiple modalities, such as images, text, audio, etc.

[0053] Large model hallucination: The large model hallucination problem is a behavior that may occur when a large model generates text, in which the content generated by the model does not match the real-world knowledge, previous conversation history, or input prompts. The causes of large model hallucination are complex and may generally be related to inconsistent training data distribution, overfitting, label noise, and other reasons.

[0054] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0055] This application provides a classification task processing method based on a large model, which can be applied to Figure 1 The system architecture shown in FIG. 1 may include a terminal 100 and a server 200. The server 200 may include one or more servers ( Figure 1 A server is included as an example for explanation).

[0056] The terminal 100 or the server 200 can be used alone to execute the classification task processing method based on the large model provided in the embodiment of the present application. In addition, the terminal 100 and the server 200 can also be used in collaboration to execute the classification task processing method based on the large model provided in the embodiment of the present application.

[0057] Next describe Figure 1 The product form of the mid-terminal 100;

[0058] The terminal 100 in the embodiment of the present application can be a mobile phone, a tablet computer, a teaching screen, a wearable device, a vehicle-mounted device, a conference terminal, an augmented reality (AR) / virtual reality (VR) device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), etc., and the embodiment of the present application does not impose any restrictions on this.

[0059] Figure 2 An optional hardware structure diagram of the terminal 100 is shown.

[0060] refer to Figure 2 As shown, the terminal 100 may include a radio frequency unit 110, a memory 120, an input unit 130, a display unit 140, a camera 150 (optional), an audio circuit 160, a speaker 161, a microphone 162, an earphone jack 163 (optional), a processor 170, an external interface 180, a power supply 190 and other components. Those skilled in the art will appreciate that Figure 2 These are merely examples of terminals or multi-function devices and do not constitute limitations on the terminals or multi-function devices, which may include more or fewer components than those shown in the figures, or combinations of certain components, or different components.

[0061] The input unit 130 can be used to receive input digital or character information, and generate key signal input related to the user settings and function control of the portable multifunctional device. Specifically, the input unit 130 may include a touch screen 131 and / or other input devices 132. The touch screen 131 can collect the user's touch operations on or near it (such as the user's operation on or near the touch screen using any suitable object such as fingers, joints, stylus, etc.), and drive the corresponding connection device according to a pre-set program. The touch screen can detect the user's touch action on the touch screen, convert the touch action into a touch signal and send it to the processor 170, and can receive and execute the command sent by the processor 170; the touch signal at least includes the touch point coordinate information. The touch screen 131 can provide an input interface and an output interface between the terminal 100 and the user. In addition, the touch screen can be implemented using multiple types such as resistive, capacitive, infrared and surface acoustic wave. In addition to the touch screen 131, the input unit 130 can also include other input devices. Specifically, other input devices 132 may include, but are not limited to, one or more of a physical keyboard, function keys (such as a volume control key, a switch key, etc.), a trackball, a mouse, a joystick, and the like.

[0062] Among them, the input device 132 can receive input data and the like.

[0063] The display unit 140 may be used to display information input by the user or provided to the user, various menus of the terminal 100, interactive interfaces, file display, and / or playback of any multimedia file. In the embodiment of the present application, the display unit 140 may be used to display various interactive interfaces, processing results, etc. in the classification task processing method based on the large model.

[0064] The memory 120 can be used to store instructions and data. The memory 120 can mainly include an instruction storage area and a data storage area. The data storage area can store various data, such as multimedia files, texts, etc.; the instruction storage area can store software units such as operating systems, applications, instructions required for at least one function, or their subsets and extensions. It can also include a non-volatile random access memory; provide the processor 170 with hardware, software and data resources including management of computing and processing equipment, and support control software and applications. It is also used for the storage of multimedia files, and the storage of running programs and applications.

[0065] The processor 170 is the control center of the terminal 100. It uses various interfaces and lines to connect various parts of the entire terminal 100. By running or executing instructions stored in the memory 120 and calling data stored in the memory 120, it executes various functions of the terminal 100 and processes data, thereby controlling the terminal device as a whole. Optionally, the processor 170 may include one or more processing units; preferably, the processor 170 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface and application program, and the modem processor mainly processes wireless communication. It is understandable that the above-mentioned modem processor may not be integrated into the processor 170. In some embodiments, the processor and the memory may be implemented on a single chip, and in some embodiments, they may also be implemented separately on separate chips. The processor 170 may also be used to generate corresponding operation control signals, send them to corresponding components of the computing and processing device, read and process data in the software, especially read and process data and programs in the memory 120, so that each functional module therein performs corresponding functions, thereby controlling the corresponding components to act according to the requirements of the instructions.

[0066] Among them, the memory 120 can be used to store software codes related to the classification task processing method based on a large model, the processor 170 can execute the steps of the classification task processing method based on a large model, and can also schedule other units (such as the above-mentioned input unit 130 and the display unit 140) to realize corresponding functions.

[0067] The radio frequency unit 110 (optional) can be used for receiving and sending information or receiving and sending signals during a call, for example, after receiving the downlink information of the base station, it is sent to the processor 170 for processing; in addition, the designed uplink data is sent to the base station. Generally, the RF circuit includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (Low Noise Amplifier, LNA), a duplexer, etc. In addition, the radio frequency unit 110 can also communicate with network devices and other devices through wireless communication. The wireless communication can use any communication standard or protocol, including but not limited to Global System of Mobile communication (Global System of Mobile communication, GSM), General Packet Radio Service (General Packet Radio Service, GPRS), Code Division Multiple Access (Code Division Multiple Access, CDMA), Wideband Code Division Multiple Access (Wideband Code Division Multiple Access, WCDMA), Long Term Evolution (Long Term Evolution, LTE), email, Short Messaging Service (SMS), etc.

[0068] In the embodiment of the present application, the radio frequency unit 110 can send data to the server 200 and receive the processing result sent by the server 200. Exemplarily, the radio frequency unit 110 sends the received user conversation data to the server 200, and the server 200 calls the large model to decode and output the classification result of the target classification task based on the user conversation data, and returns the classification result to the terminal 100.

[0069] It should be understood that the radio frequency unit 110 is optional and can be replaced by other communication interfaces, such as a network port.

[0070] The terminal 100 also includes a power supply 190 (such as a battery) for supplying power to various components. Preferably, the power supply can be logically connected to the processor 170 through a power management system, so that the power management system can manage functions such as charging, discharging, and power consumption.

[0071] The terminal 100 further includes an external interface 180 , which may be a standard Micro USB interface or a multi-pin connector, and may be used to connect the terminal 100 to communicate with other devices, or to connect a charger to charge the terminal 100 .

[0072] Although not shown, the terminal 100 may also include a flashlight, a wireless fidelity (WiFi) module, a Bluetooth module, sensors with different functions, etc., which are not described in detail here. Some or all of the methods described below may be applied in the following embodiments. Figure 2 In the terminal 100 shown.

[0073] Next describe Figure 1 The product form of the server 200;

[0074] Figure 3 A structural diagram of a server 200 is provided, such as Figure 3 As shown, the server 200 includes a bus 201, a processor 202, a communication interface 203, and a memory 204. The processor 202, the memory 204, and the communication interface 203 communicate with each other via the bus 201.

[0075] The bus 201 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0076] The processor 202 may be any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).

[0077] The memory 204 may include a volatile memory, such as a random access memory (RAM). The memory 204 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard drive (HDD), or a solid state drive (SSD).

[0078] Among them, the memory 204 can be used to store software codes related to the classification task processing method based on a large model, the processor 202 can execute the steps of the classification task processing method based on a large model, and can also schedule other units to realize corresponding functions.

[0079] It should be understood that the above-mentioned terminal 100 and server 200 can be centralized or distributed devices, and the processors in the above-mentioned terminal 100 and server 200 (such as processor 170 and processor 202) can be hardware circuits (such as application specific integrated circuit (ASIC), field-programmable gate array (FPGA), general-purpose processor, digital signal processor (DSP), microprocessor or microcontroller, etc.), or a combination of these hardware circuits. For example, the processor can be a hardware system with an instruction execution function, such as a CPU, DSP, etc., or a hardware system without an instruction execution function, such as an ASIC, FPGA, etc., or a combination of the above-mentioned hardware systems without an instruction execution function and hardware systems with an instruction execution function.

[0080] As a common task in the field of natural language understanding, classification tasks cover a wide range of scenarios, such as intent-slot tasks (intent classification and slot extraction tasks) and sentiment classification tasks. Some methods use traditional models (such as BERT models) to handle classification tasks. With the emergence of large artificial intelligence models, more and more studies use large models to handle classification tasks, given their real-time, interactive, and strong semantic understanding capabilities.

[0081] Take the intention slot task as an example to illustrate:

[0082] The intent-slot task includes two subtasks: intent classification and slot information extraction. When the BERT model is traditionally used for intent-slot extraction, the input interaction data is encoded, and the encoding result is divided into an overall representation and a sequence representation of the interaction data. The former is used for intent classification, and the latter is used to mark the start and end positions of each slot information. That is, intent recognition and slot information extraction are regarded as two discriminative tasks of joint learning. With the emergence of large models, such methods have gradually been replaced.

[0083] The intent-based method based on a large model transforms the traditional discriminative task into a generative task, and the large model directly decodes and outputs the intent-based result based on the input interaction data. The semantic understanding ability of the large model makes it more capable of understanding interaction data and more accurate in understanding intent, but it cannot avoid the hallucination problem of the large model.

[0084] The current intent-proposing solution based on a large model basically provides candidate intent labels and slot sets in the prompt, together with the interaction data as the input of the large model, and then the large model outputs the intent-proposing result. The disadvantage of this technical solution is that for large models that have not undergone supervised fine-tuning SFT, their ability to follow instructions is not stable enough. Even if the output content and format are strictly required in the prompt, the large model will have format errors, redundant content, incomplete results, fabricated answers, and other problems during output.

[0085] Performing domain data SFT on large models can effectively alleviate this problem, but it cannot be completely avoided in actual tests. In actual applications, after using domain data SFT on large models with parameter magnitudes of 2.6B and 13B, it was found during testing that there were still a small number of missing characters in intent names and confusion between similar slots.

[0086] To this end, the present application provides a classification task processing method that limits the decoding space of a large model. It can construct a classification label prefix tree in combination with the candidate classification label set of the target classification task. When calling the large model decoding process, the classification label prefix tree is used to prune the decoding space of the large model and limit it to the range of each candidate classification label contained in the classification label prefix tree, thereby ensuring that the final output result matches the candidate classification label, thereby improving the classification quality.

[0087] The present invention provides a classification task processing method based on a large model, and the method is applied to Figure 1 Taking the computer device in the example as an example, the computer device can be Figure 1 The terminal 100 or the system consisting of the terminal 100 and the server 200. Figure 4 , the classification task processing method based on the large model specifically includes the following steps:

[0088] Step S100: Obtain data to be processed related to the target classification task.

[0089] Specifically, the target classification task is the classification task to be handled by this application, which can be any type of classification task, such as an intention classification task, a sentiment classification task, etc.

[0090] The data to be processed related to the target classification task is the data referenced when processing the target classification task. Depending on the specific scenario, the data to be processed can have many different forms. Taking the intention-based task in the human-computer dialogue process as an example, the data to be processed can be the historical dialogue data input by the user.

[0091] Step S110: Obtain a configured classification label prefix tree, where the classification label prefix tree is converted based on a candidate classification label set of a target classification task.

[0092] The present application can predetermine a set of candidate classification labels of the target classification task, that is, determine all possible label sets of the classification results of the classification task, and then convert the candidate classification label set into a classification label prefix tree.

[0093] Table 1 below illustrates a set of candidate classification labels for an intent slot extraction task.

[0094] Table 1

[0095]

[0096] Each row in Table 1 represents a candidate classification label. It can be seen that each candidate classification label is composed of an intent category and a slot value. As shown in Table 1 above, there may be no slot value under some intent categories, so a null value can be taken.

[0097] In addition, not all classification tasks have slot values. For example, in sentiment classification tasks, candidate classification labels consist only of specific sentiment types, such as positive, negative, and neutral.

[0098] For the candidate classification label set of the target classification task, it can be converted into the form of a classification label prefix tree. The classification label prefix tree is a tree structure. The root node of the tree is the set decoding start symbol (such as "BOS" to represent the decoding start symbol), indicating the start of decoding. The root node itself does not represent the character token actually to be decoded. In addition to the root node, the classification label prefix tree contains several levels of nodes. Each node in each layer corresponds to a character token. The token sequence on the path from the root node to each leaf node corresponds to a candidate classification label in the candidate classification label set.

[0099] Combination Figure 5 , which illustrates an optional structure of the classification label prefix tree after the candidate classification label set of the intention slot task shown in Table 1 above is converted.

[0100] The root node is represented by "BOS", and the token sequence on the path branch from the root node to each leaf node is combined into a candidate classification label in the candidate classification label set.

[0101] In a possible implementation, each leaf node of the classification label prefix tree can be represented by setting a decoding terminator, such as Figure 5 The "EOS" in the code indicates the decoding termination symbol, which is used to indicate that decoding can be terminated when the decoding reaches the current node.

[0102] Of course, leaf nodes may not be represented by decoding terminators, and the specific decoding termination conditions may be controlled by the large model itself. For example, the large model may terminate decoding after determining that the length of the token sequence output by the decoding reaches a set length threshold, etc.

[0103] In order to simplify the structure of the classification label prefix tree, starting from the root node, if there are branches with the same prefix, they can be merged together, such as Figure 5 As shown, for the two candidate classification labels "inter-bank transfer" and "cross-border finance", they contain the common prefix "cross", so they are represented by the same node in the classification label prefix tree.

[0104] In addition, it should be noted that Figure 5 Report lost bank card and report lost bank card number " as two candidate classification labels, indicating that in actual scenarios, only the intent category can be predicted, or the intent category and slot value can be predicted at the same time.

[0105] Further, Figure 5 "Report lost bank card number "The branch finally contains a node" ",Should" " can be the first setting symbol, which can also be represented by other symbols. In the actual application process, if the end of a candidate classification label contains target text content of uncertain length, the first setting symbol can be used to replace the token of the target text content, that is, the first setting symbol indicates that the length of the corresponding token is uncertain. Therefore, the decoding sequence of each subsequent node is not constrained by the length and decoding space, and the length and content of the output can be independently decided based on the semantic understanding ability of the large model.

[0106] by Figure 5 As shown, since the length and content of the specific card number are not fixed, a node corresponding to the first setting symbol can be added after the node corresponding to the "number".

[0107] Step S120, calling the configured large model to decode each token based on the data to be processed and output the classification result of the target classification task, wherein, when decoding the i-th token, the probability distribution of each token in the vocabulary space is calculated, and the probability distribution is pruned using the classification label prefix tree, and the i-th token to be output is determined based on the pruned probability distribution.

[0108] Specifically, the prompt instruction prompt can be sent to the large model to instruct the large model to decode and output the classification result of the target classification task. The prompt contains the data to be processed and the prompt instruction, which is used to instruct the large model to refer to the data to be processed and generate the classification result of the target classification task.

[0109] Under normal circumstances, the traditional decoding process based on large models decodes token by token in the vocabulary space. The vocabulary space is the set of all character tokens used when training the large model and is also the set of all tokens that the model supports for output. At each time step, based on the input data to be processed and the content that has been decoded and output, a probability is calculated for each token in the vocabulary space to obtain the probability distribution of each token in the vocabulary space. Then, based on a specific selection strategy (such as the greedy algorithm commonly used), the token to be output at the current time step is selected, and this process is repeated until the decoding ends.

[0110] Different from the traditional solution, in this step, when calling the large model for decoding, during the decoding process, for the i-th time step, the probability distribution of each character token in the vocabulary space is calculated, and the classification label prefix tree is used to prune the calculated probability distribution. That is, the decoding space is restricted within the scope of the classification label prefix tree. Based on the pruned probability distribution, the decoding result of the i-th time step is determined. Until the decoding end condition is met, the token sequence decoded at each time step is obtained as the classification result of the target classification task.

[0111] An example of a possible pruning strategy is to set the probability values of tokens other than the first token set in the calculated probability distribution of each token in the vocabulary space to a preset infinitesimal value, for example, set to 0.

[0112] Among them, the first token set is the token set composed of the nodes at the i-th layer in the subtree where the token string composed of the first i - 1 tokens decoded and output in the classification label prefix tree is located.

[0113] For the convenience of understanding, the following example is used for illustration:

[0114] Suppose the classification result of a certain intention slotting task is "bank card application", then the process of calling the large model for decoding is as follows:

[0115] 1. First, calculate the probability distribution of the first character (i = 1) token, and the size is the length of the vocabulary space.

[0116] 2. Determine the current first token set. Since no token has been decoded and output before this, the subtree determined according to the above method is the original classification label prefix tree, and the token set composed of the nodes at the 1st layer is taken: {across, silver, surplus, loan}.

[0117] 3. Set the probability values of tokens other than the current first token set in the probability distribution of the tokens calculated in the first step to 0, that is, limit the decoding space to the current first token set for decoding, and the first decoded token is "银" (yin).

[0118] 4. Calculate the probability distribution of the second (i = 2) token, and the size is still the length of the vocabulary space.

[0119] 5. Determine the current first token set. The token string decoded before the current moment is "银" (yin). Determine the subtree in the original classification label prefix tree where the node corresponding to the decoded "银" (yin) is located. This subtree can be referred to Figure 6 as shown, and determine the token set composed of the second-layer nodes in it: {行 (hang), 联 (lian)}.

[0120] 6. Set the probability values of tokens other than the current first token set in the probability distribution of the tokens calculated in the fourth step to 0, that is, limit the decoding space to the current first token set for decoding, and the second decoded token is "行" (hang).

[0121] Repeat this process until decoding is completed, and the final decoding result is "银行卡办理" (Bank card application).

[0122] It can be seen from this that by using the method of this embodiment, the decoding space can be dynamically restricted and pruned during the decoding process, and the decoding result can be gradually obtained, avoiding problems such as incorrect formatting, redundant content, and mismatch with candidate classification labels in the output of the large model, and improving the quality of the output result of the large model when processing classification tasks.

[0123] In some embodiments of the present application, according to different types of target classification tasks, the lengths of the candidate classification labels in the candidate classification label set may be fixed or unfixed. For example, for the candidate classification label "银行卡挂失 - 卡号" (Bank card loss reporting - Card number) in Table 1 above, since the length and content of the specific card number are both unfixed, the target text content with an unfixed length at the end of this candidate classification label is caused. For such candidate classification labels, in the constructed classification label prefix tree, the first set symbol (example: " ") can be used to replace the tokens of the target text content with an unfixed length, specifically referring to Figure 5 as shown.

[0124] Correspondingly, in the process of calling the large model for decoding in the above step S120, before pruning the probability distribution using the classification label prefix tree, the following processing steps can also be added:

[0125] Determine whether the first set of tokens contains the first predefined symbol. The process of determining the first set of tokens is as described above and will not be elaborated here.

[0126] If the judgment result is negative, it means that there is a limited decoding space for the token to be decoded at the current time step i, that is, each token included in the first set of tokens. Therefore, the step of pruning the probability distribution using the classification label prefix tree can be executed.

[0127] Conversely, if the judgment result is positive, it means that the tokens to be decoded at the current time step i and subsequent time steps may be a token with an unfixed length, and it may not exist in the classification label prefix tree. Therefore, the operation of pruning the probability distribution using the classification label prefix tree can be stopped. That is, for the tokens to be decoded at the current time step i and subsequent time steps, the length and content output by the large model can be autonomously determined, that is, directly according to the probability distribution of each token in the vocabulary space calculated by the model, the decoding result to be output is selected.

[0128] The method provided in this embodiment is particularly applicable to the case where there are candidate classification labels with unfixed lengths in the candidate classification label set of the target classification task, and can selectively use the classification label prefix tree to prune the probability distribution calculated by the model, so as to maximize the quality of the results output by the large model when processing the classification task.

[0129] In some embodiments of the present application, in combination with Figure 5 As shown, for some candidate classification label branches, such as the "progress query" branch in "balance query" and "loan processing progress query", when decoding to certain nodes, the final classification result can already be determined. For example, for the "balance query" branch, when decoding to "yu", the final classification result can be determined as "balance query"; for the "progress query" branch in "loan processing progress query", when decoding to "jin", the final classification result can be determined as "loan processing progress query".

[0130] Based on the above findings, another optional implementation manner of the method for processing the target classification task based on the large model is provided in this embodiment. Specifically, during the process of calling the large model for decoding, after the i-th token is decoded and output, the following judgment step can be added:

[0131] Determine whether there is only one branch node in the (i + 1)-th layer of the subtree where the token string composed of the first i tokens decoded and output is located in the classification label prefix tree.

[0132] If the judgment result is yes, stop the decoding process, determine the target path from the root node to the leaf node where the only branch node in the i+1th layer is located, and use the candidate classification label corresponding to the target path as the classification result of the target classification task.

[0133] Of course, if the judgment result is no, decoding can continue according to the decoding method introduced in the above embodiment.

[0134] To make it easier to understand, let's use a specific example to illustrate:

[0135] Combination Figure 5 As shown in , if the first token obtained by decoding is "surplus", then the token string composed of the decoded output tokens in the classification label prefix tree is determined to be: surplus. Determine the subtree where the token string is located, such as Figure 7 As shown in the figure, there is only one branch node "Amount" in the second layer of the subtree, so "Balance Query" can be directly used as the final classification result.

[0136] In the method provided in this embodiment, if it is found during the decoding process that there is only one current decoding path, the decoding can be terminated in advance and the candidate classification label corresponding to the unique decoding path can be directly output. This can further speed up the decoding and output of the classification results of the large model while ensuring the accuracy of the classification results.

[0137] Figure 5 The classification label prefix tree shown is specifically a single classification label prefix tree, that is, when the target classification task is a single label classification task type, the corresponding classification label prefix tree. The single label classification task type means that the classification result of the target classification task can only be one candidate classification label. Taking the text sentiment classification task as an example, the candidate classification label set contains three sentiment labels: "positive", "negative" and "neutral", then the sentiment type of the input text can only belong to one sentiment label.

[0138] In addition, the target classification task may also be a multi-label classification task type, that is, the classification result of the target classification task may contain more than one candidate classification label. Taking the movie classification task as an example, a movie may belong to multiple different candidate category labels at the same time, for example, it may belong to both "action" and "comedy" candidate category labels.

[0139] When the target classification task is a multi-label classification task type, the obtained classification label prefix tree may specifically be a multi-classification label prefix tree.

[0140] Compared with the single-class label prefix tree, the multi-class label prefix tree adds two branches at each leaf node in the single-class label prefix tree, one of which contains the set decoding terminator, and the other branch is the single-class label prefix tree after pruning the path branch from the root node to the current leaf node (that is, the single-class label prefix tree after pruning the currently decoded candidate category label, indicating that the subsequent decoding space does not contain the candidate category label that has been decoded and output).

[0141] Combination Figure 8 As shown, for Figure 5 The single-classification label prefix tree shown in the figure takes the "cross-border finance" branch as an example. Two branches are added to the leaf node of the branch. One of the branches contains the set decoding terminator "EOS", indicating that the classification result may only contain the candidate classification label "cross-border finance"; the other branch is as follows Figure 8 The branch from the "Melting" node downwards can be a Figure 5 The single-class label prefix tree shown, from which the subtree after pruning the "cross-border finance" branch is removed.

[0142] It should be noted that Figure 8 What is shown in the figure is not a complete multi-classification label prefix tree. It only takes the result after expanding the "cross-border finance" branch as an example.

[0143] When the target classification task is a multi-label classification task type, the aforementioned Figure 4 The execution of the method of the corresponding embodiment only requires obtaining the multi-classification label prefix tree corresponding to the target classification task in step S110.

[0144] According to the above scheme introduction, this application can pre-configure the corresponding single-classification label prefix tree or multi-classification label prefix tree according to whether the target classification task belongs to a single-label classification task or a multi-label classification task, thereby realizing the prediction of the classification result of the target classification task.

[0145] Furthermore, in the embodiment of the present application, an optional implementation method of the construction process of a single-category label prefix tree is introduced, which may specifically include the following steps:

[0146] S1. Obtain a set of candidate classification labels for the target classification task.

[0147] S2. Traverse each candidate classification label in the candidate classification label set, and insert the candidate classification labels into the single classification label prefix tree one by one, wherein the root node of the single classification label prefix tree is the set decoding start symbol.

[0148] S3. For each candidate classification label, starting from the root node, traverse each token in the candidate classification label and build the corresponding node path in the single classification label prefix tree, where each node corresponds to a token.

[0149] Optionally, after completing the above steps, you can also add a decoding terminator node at the end of each branch, that is, Figure 5 The "EOS" node shown in the figure indicates the end of decoding.

[0150] For the construction process of the multi-class label prefix tree, two branches can be added to each leaf node in the single-class label prefix tree based on the constructed single-class label prefix tree, one of which contains the set decoding terminator, and the other branch is the single-class label prefix tree after pruning the path branch from the root node to the current leaf node (that is, the single-class label prefix tree after pruning the currently decoded candidate category label, indicating that the subsequent decoding space does not contain the candidate category label that has been decoded and output).

[0151] The following describes a classification task processing device based on a large model provided in an embodiment of the present application. The classification task processing device based on a large model described below and the classification task processing method based on a large model described above can refer to each other.

[0152] See also Fig. 9 , Fig. 9 A schematic diagram of the structure of a classification task processing device based on a large model disclosed in an embodiment of the present application.

[0153] like Fig. 9 As shown, the device may include:

[0154] A data acquisition unit 11 is used to acquire the data to be processed related to the target classification task;

[0155] The prefix tree acquisition unit 12 is used to acquire a configured classification label prefix tree, wherein the classification label prefix tree is obtained by converting a candidate classification label set based on a target classification task, wherein a root node in the classification label prefix tree is a set decoding start symbol, each node corresponds to a character token, and a token sequence on a path from the root node to each leaf node corresponds to a candidate classification label in the set;

[0156] The decoding unit 13 is used to call the configured large model to decode each token based on the data to be processed and output the classification result of the target classification task, wherein when decoding the i-th token, the probability distribution of each token in the vocabulary space is calculated, and the probability distribution is pruned using the classification label prefix tree, and the i-th token to be output is determined based on the pruned probability distribution.

[0157] In an optional implementation, the process of the decoding unit pruning the probability distribution using the classification label prefix tree includes:

[0158] The probability values ​​of tokens other than the first token set in the probability distribution are set to preset infinitesimal values, wherein the first token set is a token set consisting of nodes in the i-th layer in a subtree where a token string consisting of the first i-1 tokens of the decoded output in the classification label prefix tree is located.

[0159] In an optional implementation, if the end of a candidate classification label contains target text content of variable length, a first setting symbol is used to replace the token of the target text content; correspondingly, before the decoding unit uses the classification label prefix tree to prune the probability distribution, it is also used to:

[0160] Determine whether the first token set contains the first setting symbol;

[0161] If not, executing the step of pruning the probability distribution using the classification label prefix tree;

[0162] If so, for the i-th and subsequent tokens to be decoded, stop using the classification label prefix tree to prune the probability distribution.

[0163] In an optional implementation, the above decoding unit may also be used for:

[0164] After decoding and outputting the i-th token, determine whether there is only one branch node in the i+1th layer in the subtree where the token string composed of the first i tokens that have been decoded and outputted in the classification label prefix tree is located. If so, stop the decoding process, determine the target path from the root node to the leaf node where the only branch node in the i+1th layer is located, and use the candidate classification label corresponding to the target path as the classification result of the target classification task.

[0165] In an optional implementation, when the target classification task is a single-label classification task type, the classification label prefix tree acquired by the prefix tree acquisition unit is specifically a single-classification label prefix tree;

[0166] When the target classification task is a multi-label classification task type, the classification label prefix tree obtained by the prefix tree acquisition unit is specifically a multi-classification label prefix tree;

[0167] Compared with the single-class label prefix tree, the multi-class label prefix tree adds two branches at each leaf node in the single-class label prefix tree, one of which contains a set decoding terminator, and the other is the single-class label prefix tree after pruning the path branch from the root node to the current leaf node.

[0168] In an optional implementation, the apparatus of the present application may further include: a single-classification label prefix tree construction unit, configured to construct the single-classification label prefix tree. The process may include:

[0169] Obtaining a set of candidate classification labels for the target classification task;

[0170] Traversing each candidate classification label in the candidate classification label set, and inserting the candidate classification labels into the single classification label prefix tree one by one, wherein the root node of the single classification label prefix tree is a set decoding start symbol;

[0171] For each of the candidate classification labels, starting from the root node, each token in the candidate classification label is traversed, and a corresponding node path is constructed in the single classification label prefix tree, wherein each node corresponds to a token.

[0172] In an optional implementation, each leaf node of the classification label prefix tree is a set decoding terminator; then the termination conditions of the large model decoding include: decoding to obtain the decoding terminator, or the length of the token sequence output by decoding reaches a set length threshold.

[0173] In an optional implementation, the target classification task includes: intent classification and slot extraction tasks, and correspondingly, the candidate classification label is a label composed of each candidate intent and its slot value.

[0174] The present application also provides an electronic device in an embodiment. Fig.10 As shown, it shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiment of the present application. The electronic device in the embodiment of the present application may include but is not limited to fixed terminals such as mobile phones, tablet computers, intelligent robots, wearable devices, etc. Fig.10 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0175] like Fig.10As shown, the electronic device may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 to a random access memory (RAM) 603, so as to implement the classification task processing method based on a large model of the aforementioned embodiment of the present application. When the electronic device is powered on, various programs and data required for the operation of the electronic device are also stored in the RAM 603. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0176] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a memory card, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although Fig.10 An electronic device having various devices is shown, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0177] Also provided in an embodiment of the present application is a computer program product including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements any large model-based classification task processing method provided in an embodiment of the present application.

[0178] A computer-readable storage medium is also provided in an embodiment of the present application. The storage medium carries one or more computer programs. When one or more computer programs are executed by an electronic device, the electronic device can implement any large model-based classification task processing method provided in an embodiment of the present application.

[0179] It should also be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the drawings of the device embodiments provided by the present application, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines.

[0180] Through the description of the above implementation mode, the technicians in the field can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course, it can also be implemented by special hardware including special integrated circuits, special CPUs, special memories, special components, etc. In general, all functions completed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be various, such as analog circuits, digital circuits or special circuits. However, for the present application, software program implementation is a better implementation mode in more cases. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer floppy disk, a U disk, a mobile hard disk, a ROM, a RAM, a disk or an optical disk, etc., including a number of instructions to enable a computer device (which can be a personal computer, a training device, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0181] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.

[0182] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a training device, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, training device, or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device, a data center, etc. that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.

[0183] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can refer to each other.

Claims

1. A classification task processing method based on a large model, characterized in that: include: Obtaining data to be processed related to the target classification task; Get the configured classification label prefix tree, which is obtained by converting the candidate classification label set of the target classification task. The root node in the classification label prefix tree is the set decoding start symbol, each node corresponds to a character token, and the token sequence on the path from the root node to each leaf node corresponds to a candidate classification label in the set; The configured large model is called to decode token by token based on the data to be processed and output the classification result of the target classification task, wherein when decoding the i-th token, the probability distribution of each token in the vocabulary space is calculated, and the probability distribution is pruned using the classification label prefix tree, and the i-th token to be output is determined based on the pruned probability distribution.

2. The method according to claim 1, characterized in that: The process of pruning the probability distribution using the classification label prefix tree includes: The probability values ​​of tokens other than the first token set in the probability distribution are set to preset infinitesimal values, wherein the first token set is a token set consisting of nodes in the i-th layer in the subtree where a token string consisting of the first i-1 tokens of the decoded output in the classification label prefix tree is located.

3. The method according to claim 2, characterized in that If the end of a candidate classification label contains target text content of variable length, the first setting symbol is used to replace the token of the target text content; Correspondingly, before pruning the probability distribution using the classification label prefix tree, the method further includes: Determine whether the first token set contains the first setting symbol; If not, executing the step of pruning the probability distribution using the classification label prefix tree; If so, for the i-th and subsequent tokens to be decoded, stop using the classification label prefix tree to prune the probability distribution.

4. The method according to claim 2, characterized in that: Also includes: After decoding and outputting the i-th token, determine whether there is only one branch node in the i+1th layer in the subtree where the token string composed of the first i tokens that have been decoded and outputted in the classification label prefix tree is located. If so, stop the decoding process, determine the target path from the root node to the leaf node where the only branch node in the i+1th layer is located, and use the candidate classification label corresponding to the target path as the classification result of the target classification task.

5. The method according to claim 1, characterized in that When the target classification task is a single-label classification task type, the classification label prefix tree obtained is specifically a single-classification label prefix tree; When the target classification task is a multi-label classification task type, the classification label prefix tree obtained is specifically a multi-classification label prefix tree; Compared with the single-class label prefix tree, the multi-class label prefix tree adds two branches at each leaf node in the single-class label prefix tree, one of which contains a set decoding terminator, and the other is the single-class label prefix tree after pruning the path branch from the root node to the current leaf node.

6. The method according to claim 5, characterized in that The process of constructing the single-category label prefix tree includes: Obtaining a set of candidate classification labels for the target classification task; Traversing each candidate classification label in the candidate classification label set, and inserting the candidate classification labels into the single classification label prefix tree one by one, wherein the root node of the single classification label prefix tree is a set decoding start symbol; For each of the candidate classification labels, starting from the root node, each token in the candidate classification label is traversed, and a corresponding node path is constructed in the single classification label prefix tree, wherein each node corresponds to a token.

7. The method according to claim 1, characterized in that Each leaf node of the classification label prefix tree is a set decoding terminator; The termination conditions of the large model decoding include: decoding to obtain the decoding terminator, or the length of the token sequence output by decoding reaches a set length threshold.

8. The method according to any one of claims 1 to 7, characterized in that: The target classification task includes: intent classification and slot extraction tasks, and correspondingly, the candidate classification label is a label composed of each candidate intent and its slot value.

9. A classification task processing device based on a large model, characterized in that: include: A data acquisition unit, used to acquire data to be processed related to the target classification task; A prefix tree acquisition unit is used to acquire a configured classification label prefix tree, wherein the classification label prefix tree is obtained by converting a candidate classification label set of a target classification task, wherein a root node in the classification label prefix tree is a set decoding start symbol, each node corresponds to a character token, and a token sequence on a path from the root node to each leaf node corresponds to a candidate classification label in the set; A decoding unit is used to call the configured large model to decode token by token based on the data to be processed and output the classification result of the target classification task, wherein when decoding the i-th token, the probability distribution of each token in the vocabulary space is calculated, and the probability distribution is pruned using the classification label prefix tree, and the i-th token to be output is determined based on the pruned probability distribution.

10. An electronic device, characterized in that: include: Memory and processor; The memory is used to store programs; The processor is used to execute the program to implement the various steps of the large model-based classification task processing method as described in any one of claims 1 to 8.

11. A readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, each step of the large model-based classification task processing method as described in any one of claims 1 to 8 is implemented.

12. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, each step of the large model-based classification task processing method as described in any one of claims 1 to 8 is implemented.

Citation Information

Cited By

  • Numerical control turning machining parameter recommendation method and device

    CN120447463A

  • Method and device for realizing conversion from xml tiled structure to nested structure by using prefix tree and medium

    CN122174796A

  • Text classification method and related device

    WO2026189490A1