An event processing method and system based on large language model
Through the event processing method based on the large language model, the event trigger word and argument extraction is used to use the bilateral branch BERT model to solve the problem of low event processing efficiency in the existing technology, realize the complete and real-time processing of events, and improve the processing efficiency.
Patent Information
- Application Number
- CN202410690438.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-30
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2044-05-30
AI Technical Summary
The prior art is less efficient in event processing, especially due to the complex data relationship and the numerous influencing factors, it is difficult to find definite expressions. It is difficult to use general mathematical modeling methods, resulting in low event processing efficiency.
Using the event processing method based on the large language model, the event stream to be processed is input to the model database through the large language model as the overall framework, the initial processing model is determined, and the target processing model is obtained based on the network structure parameters and model weight parameters. Deploy in the optimal processing node, perform event trigger word extraction and event argument extraction, and use the bilateral branch BERT model to achieve the acquisition of event description text.
The extraction difficulties caused by semantic differences between special event structure and pre-trained model upstream and downstream tasks are solved, and the complete and real-time processing of event streams from different sources is achieved, which greatly improves the efficiency of event processing.
Smart Images

Figure CN118535718B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of artificial intelligence and natural language processing, and in particular to an event processing method and system based on a large language model. Background Art
[0002] The real-time event processing system regards the original data events as atomic events, and processes the atomic events in real time through event-driven processing services. It mines data events through modeling, filtering, analysis, grouping and aggregation, so as to find the events of interest to users among a large number of events, that is, compound events. In the process of processing atomic events, using deep neural networks for modeling and calling models can not only solve the difficulties in data processing, but also provide real-time guarantee for event processing.
[0003] In the field of natural language technology, how to mine the value of text data and process data reasonably has become the focus of data technology development. Because data sources are diverse and data structures are diverse, it is very inconvenient to use it directly and it needs to be processed in a certain way. In the processing process, the biggest difficulty is that the data relationship is complex and there are many influencing factors. It is difficult to find a definite expression. It is difficult to use general mathematical modeling methods, resulting in low efficiency in event processing. Summary of the invention
[0004] In order to solve the technical problem of low efficiency of event processing in the prior art, the embodiment of the present invention provides an event processing method and system based on a large language model. By using the large language model as the overall framework, it is possible to implement a corresponding processing method for event streams from different sources to achieve complete and real-time processing of events. In order to achieve the above purpose, the technical solution adopted by the embodiment of the present invention is as follows:
[0005] In a first aspect, a method for event processing based on a large language model is provided, the method comprising:
[0006] Inputting the event stream to be processed into a model database set in the large language model, and determining an initial processing model matching the event stream through the model database; the event stream includes multiple atomic events, the model database includes model description information, the model description information includes network structure parameters and model weight parameters, and the initial processing model is obtained by training based on homologous data corresponding to the event stream;
[0007] Adjusting the initial processing model based on the network structure parameters and the model weight parameters to obtain a target processing model, and deploying the target processing model on an optimal processing node;
[0008] The event stream input is dispatched to the optimal processing node, and event trigger words and event arguments are extracted from the event stream based on the target processing model to obtain an event description text.
[0009] Optionally, the model database also includes preprocessing parameters;
[0010] Before adjusting the initial processing model based on the network structure parameters and the model weight parameters, the method further includes:
[0011] Preprocessing the event stream based on the preprocessing parameters specifically includes:
[0012] The event stream is subjected to data cleaning and normalization processing, wherein the data cleaning removes invalid data and incomplete data in the event stream based on the preprocessing parameters, and the normalization processing normalizes the event stream based on the normalization parameters in the preprocessing parameters.
[0013] Optionally, adjusting the initial processing model based on the network structure parameters and the model weight parameters to obtain a target processing model includes:
[0014] Based on the network structure parameters and the model weight parameters, the initial processing model is adjusted using the interface of the MXNet framework to obtain a target processing model.
[0015] Optionally, deploying the target processing model on an optimal processing node includes:
[0016] Acquire the maximum processing capacity of the plurality of processing nodes and the current load values of the plurality of processing nodes, and determine the current load ratio value of each processing node based on the maximum processing capacity and the current load value;
[0017] The distribution weight of each processing node is determined based on the current load ratio of each processing node, the optimal processing node is determined based on the distribution weight of each processing node, and the target processing model is deployed on the optimal processing node.
[0018] Optionally, obtaining the maximum processing capabilities of the multiple processing nodes includes:
[0019] Get the number of CPUs, processing rates, disk I / O rates, memory capacity, and maximum network bandwidth of multiple processing nodes, and get the maximum processing capacity of the processing nodes based on the following formula:
[0020] ;
[0021] in, represents the number of CPUs of the i-th processing node, represents the processing rate of the i-th processing node, represents the disk I / O rate of the i-th processing node, represents the memory capacity of the i-th processing node, represents the maximum network bandwidth of the ith processing node, Indicates the weight of the number of CPUs and processing rate. Indicates the weight of the disk I / O rate. Indicates the weight of the disk I / O rate. Indicates the weight of the maximum network bandwidth.
[0022] Optionally, determining a current load value of each processing node includes:
[0023] The current load value of each processing node is determined based on the following formula:
[0024] ;
[0025] in, Represents the average data of the number of CPUs and the average data of the processing rate of the i-th processing node, Represents the average disk I / O rate data of the i-th processing node, represents the average memory capacity data of the i-th processing node, Represents the average disk I / O rate data of the i-th processing node, Indicates the weight of the average data of the number of CPUs and the average data of the processing rate. Indicates the weight of the average disk I / O rate data. Represents the weight of the average data of memory capacity, Indicates the weight of the average disk I / O rate data.
[0026] Optionally, determining the distribution weight of each processing node based on the current load ratio of each processing node includes:
[0027] The distribution weight of each processing node is determined based on the following formula and the current load ratio of each processing node:
[0028] ,in represents the current load ratio of the i-th processing node, where the current load ratio of the i-th processing node is expressed based on the following formula:
[0029]
[0030] in, represents the maximum processing capacity of the i-th processing node, Represents the current load value of the i-th processing node.
[0031] Optionally, the structure of the target processing model is a bilateral branch BERT model;
[0032] Before extracting event trigger words and event arguments from the event stream based on the target processing model, the method further includes: reconstructing text and event annotation inputs of the multiple atomic events in the event stream through separators, wherein the constructed input has the following structure:
[0033] [CLS] <sentence>[SEP]<event annotation> [SEP];
[0034] Among them, [CLS] represents special classification representation, [SEP] represents separated special representation, <sentence>represents the tokenized input sentence,<event annotation> Indicates the event classification label.
[0035] Optionally, extracting event trigger words and event arguments from the event stream based on the target processing model includes:
[0036] After extracting event trigger words from the event stream based on the target processing model, a softmax classifier is used to predict event classification labels, and conditional random fields (CRF) are used to extract arguments from the event stream.
[0037] In a second aspect, an event processing system based on a large language model is provided, the system comprising: an initial processing model determining device, which is used to input an event stream to be processed into a model database set in the large language model, and determine an initial processing model matching the event stream through the model database; the event stream contains multiple atomic events, the model database includes model description information, the model description information includes network structure parameters and model weight parameters, and the initial processing model is obtained by training based on homologous data corresponding to the event stream;
[0038] A model adjustment device, used to adjust the initial processing model based on the network structure parameters and the model weight parameters to obtain a target processing model, and deploy the target processing model on an optimal processing node;
[0039] The processing device is used to dispatch the event stream input to the optimal processing node, extract event trigger words and event arguments from the event stream based on the target processing model, and obtain event description text.
[0040] According to a third aspect, a terminal device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any of the above-described methods when executing the computer program.
[0041] According to a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in any one of the above items is implemented.
[0042] The present invention has the following beneficial effects compared with the prior art:
[0043] In the technical solution provided by the embodiment of the present invention, the specific feature information of the event stream information to be processed is determined to match the corresponding initial processing model, and the initial processing model is optimized according to the event stream information to obtain the final target processing model, and the optimal processing node is determined based on the node carrying capacity in the current processing cluster, and the event stream is subjected to trigger word extraction and event argument extraction through the bilateral branch BERT model through the processing node and based on the target processing model to obtain the event description text, which solves the extraction difficulty caused by the special event structure and the extraction difficulty caused by the semantic difference of the upstream and downstream tasks of the pre-trained model, realizes the corresponding processing method of event streams from different sources to realize complete and real-time processing of events, and greatly improves the efficiency of event processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0045] The methods, systems and / or programs in the accompanying drawings will be further described according to exemplary embodiments. These exemplary embodiments will be described in detail with reference to the drawings. These exemplary embodiments are non-limiting exemplary embodiments, wherein example numbers represent similar mechanisms in the various views of the accompanying drawings.
[0046] Figure 1 It is a flow chart of an event processing method provided by an embodiment of the present invention;
[0047] Figure 2 is a schematic diagram of the structure of an event processing system provided by an embodiment of the present invention;
[0048] Figure 3 It is a schematic diagram of the structure of an event processing device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0049] In order to better understand the above technical scheme, the technical scheme of the present invention is described in detail below through the accompanying drawings and specific embodiments. It should be understood that the embodiments of the present invention and the specific features in the embodiments are detailed descriptions of the technical scheme of the present invention, rather than limitations on the technical scheme of the present invention. In the absence of conflict, the embodiments of the present invention and the technical features in the embodiments can be combined with each other.
[0050] In the following detailed description, numerous specific details are set forth by way of example in order to provide a thorough understanding of the relevant teachings. However, it will be apparent to one skilled in the art that the present invention may be practiced without these details. In other cases, well-known methods, procedures, systems, compositions and / or circuits have been described at a relatively high level, without detail, in order to avoid unnecessarily obscuring aspects of the present invention.
[0051] The present invention uses a flow chart to illustrate the execution process performed by the system according to an embodiment of the present invention. It should be clearly understood that the execution process of the flow chart may not be performed in sequence. On the contrary, these execution processes may be performed in reverse order or simultaneously. In addition, at least one other execution process may be added to the flow chart. One or more execution processes may be deleted from the flow chart.
[0052] Before further describing the embodiments of the present invention in detail, the nouns and terms involved in the embodiments of the present invention are described. The nouns and terms involved in the embodiments of the present invention are subject to the following interpretations.
[0053] (1) In response to, it is used to indicate the conditions or states on which the executed operation depends. When the dependent conditions or states are met, one or more operations executed may be in real time or with a set delay. Unless otherwise specified, there is no restriction on the order in which the multiple operations executed are executed.
[0054] (2) Based on: used to indicate the conditions or states on which the executed operations depend. When the dependent conditions or states are met, one or more operations executed may be in real time or with a set delay. Unless otherwise specified, there is no restriction on the order in which the multiple operations executed are executed.
[0055] The real-time event processing system regards the original data events as atomic events, and processes the atomic events in real time through event-driven triggering processing services. It mines data events through modeling, filtering, analysis, grouping and aggregation, so as to find the events that users are interested in among a large number of events, that is, compound events. In the process of processing atomic events, using deep neural networks for modeling and calling models can not only solve the difficulties in data processing, but also provide real-time guarantee for the event processing system. If you want to use deep neural networks as the processing module of the event processing system and process the event stream through it, you need to train a neural network model as the basis for event processing. To this end, you need to collect, store and mark the data first to make it a training data set for the deep neural network. Take the historical data set as the training set, train it, build a model, and then parse the event stream. Call the trained model for the parsed streaming data to perform real-time processing based on the training model. For the atomic events composed of streaming data, the idea of event-driven is introduced. When the atomic event arrives, the processing service that packages the model is driven to convert it into a compound event submission. Its purpose is to provide real-time analysis and processing capabilities for data events by leveraging the automation and robustness of deep neural networks.
[0056] From the perspective of data types, the present invention is mainly based on a large language model, so the data to be processed is natural language data. As for the natural language technology direction, the deep neural networks to be trained and trained mainly realize event extraction in the event stream. Event extraction is the most complex task in information extraction tasks and has always been a hot task in the field of natural language processing.
[0057] Early event extraction methods were based on manually written rules and templates, and extracted using rule constraints and pattern matching methods. The characteristic of this method is that they rely on specific event extraction rules and templates, and require a lot of manual knowledge engineering to construct features. The typical features of a text can be divided into two aspects: lexical features and contextual features. Lexical features include part-of-speech tags, entity information, and morphological features (such as markers and lemmas), while contextual features refer to the context in which words are located in the text. Pattern matching-based methods usually include two steps: template construction and extraction, that is, first constructing extraction templates and rules on the corpus, and then matching them on the corpus to be extracted. It first defines 13 patterns with the help of a conceptual sentence analyzer, which is essentially a dictionary, and then the AutoSlog system uses a trigger word dictionary to detect potential events. Finally, it links event patterns with language features. Pattern matching-based methods can achieve relatively good extraction effects in specific fields, and perform better than data-driven methods when the corpus is limited. However, pattern matching methods have great defects. It requires experts to participate in the formulation of rules and patterns, and it takes a lot of time and energy to develop and maintain event patterns. At the same time, the generalization of this method is relatively poor, and the design of the template limits the generalization of the method to a certain extent.
[0058] Since the embodiment of the present invention processes event streams based on deep neural networks in the overall structure, event extraction also uses deep learning networks, such as convolutional neural networks (CNN), recurrent neural networks (RNN), graph neural networks (AGNN), BERT (Bidirectional Encoder Representation from Transformers), BART (Bidirectional and Auto-Regressive Transformers), etc.
[0059] The above network structures all have the following problems: extraction difficulties caused by special event structures and extraction difficulties caused by semantic differences between upstream and downstream tasks of the pre-trained model.
[0060] Based on the above background technology, an embodiment of the present invention provides an event processing method based on a large language model, and the method specifically includes the following steps:
[0061] Step S110: Input the event stream to be processed into the model database set in the large language model, and determine the initial processing model matching the event stream through the model database.
[0062] In an embodiment of the present invention, the event stream contains multiple atomic events, and the model database includes model description information, model applicable data and preprocessing parameters. The model description information includes network structure parameters and model weight parameters. The initial processing model is trained based on the same source data corresponding to the event stream. The initial processing model is a bilateral branch BERT model, including two encoder networks. The two encoder networks use BERT as the backbone. The two BERT models share weights, and feature processing is performed on the encoding based on a fully connected layer.
[0063] Specifically, before adjusting the initial processing model to obtain the target processing model, it also includes preprocessing the event stream based on the preprocessing parameters, specifically including: data cleaning and normalization processing of the event stream, the data cleaning removing invalid data and incomplete data in the event stream based on the preprocessing parameters, and the normalization processing normalizing the event stream based on the normalization parameters in the preprocessing parameters.
[0064] In the embodiment of the present invention, the event stream matches the corresponding model by querying the model database, which is an initial processing model trained with the same source data and with the same processing target. After the initial processing model is selected, the preprocessing parameters and normalization parameters of the initial processing model are read to preprocess and normalize the data.
[0065] Step S120: Adjust the initial processing model based on the network structure parameters and the model weight parameters to obtain a target processing model, and deploy the target processing model on an optimal processing node.
[0066] For the initial processing model matched in step S110, it is necessary to use the corresponding interface of the MXNet framework to rebuild the model network, wherein the process of rebuilding the model network is an adjustment process.
[0067] In the embodiment of the present invention, the application scenario is a natural language technology processing scenario, so the initial processing model is also a model for natural language processing, and its model structure is a bilateral branch BERT model. The usual bilateral branch BERT model includes at least the following structure:
[0068] Input layer: The model receives text input, which is first converted into a format that the BERT model can process, usually a series of token IDs.
[0069] Two BERT encoders: The model contains two BERT encoder branches. Each branch is a deep bidirectional Transformer network that can process the input text sequence.
[0070] Weight Sharing: Although there are two branches, they share weights during the pre-training phase. This means that both branches use the same parameters at the beginning, but can be fine-tuned for specific tasks later.
[0071] Branch processing: Each BERT encoder branch processes the input text independently. One branch may process the text in its original order (forward), while another branch processes the text in reverse order (reverse).
[0072] Feature extraction: Each BERT encoder branch extracts feature representations of the text. These feature representations capture the contextual information of the text in different directions.
[0073] Fusion layer: The feature representations of the two branches need to be fused in some way. This is usually achieved through one or more fully connected layers (also called dense layers or linear layers), which learn how to combine the information of the two branches.
[0074] Output layer: The fused feature representation is fed into the output layer. The design of the output layer depends on the specific task. For example, for a classification task, the output layer may be a softmax layer to generate category probabilities.
[0075] The structure of the bilateral branch BERT model in the embodiment of the present invention is basically the same as the general bilateral branch BERT model, including two encoder networks, the two encoder networks are based on BERT as the backbone, the two BERT models share weights, feature processing is performed on the encoding based on a fully connected layer, and probability is generated based on the softmax layer.
[0076] The adjustment of the initial processing model does not adjust the basic model structure, but mainly adjusts the hyperparameters of the initial processing model in the model, but does not change the basic model structure of the initial processing model. This avoids the problem of running time caused by multiple trainings and achieves the technical effect of real-time processing.
[0077] In this step, the nodes for model adjustment need to be screened to solve the overall load balancing problem. There are two main aspects. On the one hand, when using data parallelism in the training data set process, there is a contradiction between data distribution and uneven performance. On the other hand, when large-scale concurrent processing requests arrive during the processing of event streams, it is necessary to select appropriate nodes to respond to the request based on the current load conditions of each node.
[0078] When adjusting the initial model, due to the use of data parallel computing acceleration, data needs to be allocated to each computing node in the computing cluster. At this time, the load refers to the data shards allocated to the nodes in the computing cluster. In the actual use environment, the computing performance and current load of each computing node may vary greatly. If the same size of data is simply allocated to all nodes, some nodes may be idle while others are overloaded, which causes a waste of computing resources and affects the overall processing performance.
[0079] The core of the allocation algorithm in the embodiment of the present invention is to formulate a reasonable data allocation strategy based on the performance and current load conditions of each node in the computing cluster. Therefore, in order to obtain the performance indicators and real-time load conditions of each node, it is necessary to monitor the status of each node.
[0080] There are n nodes in the calculation, where the set of calculation nodes is ,Each node runs a terminal program with monitoring function, and continuously sends its ,performance parameters and load status to the distribution center through the ,monitoring program, which is stored in its own data queue.
[0081] In the embodiment of the present invention, the four key parameters that affect the performance and load of the computing node are: CPU occupancy, disk I / O occupancy, memory occupancy, and network bandwidth occupancy.
[0082] Specifically, this process includes: obtaining the maximum processing capabilities of multiple processing nodes and the current load values of multiple processing nodes, and determining the current load ratio of each processing node based on the maximum processing capabilities and the current load values; determining the distribution weight of each processing node based on the current load ratio of each processing node, determining the optimal processing node based on the distribution weight of each processing node, and deploying the target processing model on the optimal processing node.
[0083] Specifically, obtaining the maximum processing capacity of the plurality of processing nodes includes: obtaining the number of CPUs, processing rate, disk I / O rate, memory capacity and maximum network bandwidth of the plurality of processing nodes, and performing processing based on the following formula:
[0084] ;
[0085] in, represents the number of CPUs of the i-th processing node, represents the processing rate of the i-th processing node, represents the disk I / O rate of the i-th processing node, represents the memory capacity of the i-th processing node, represents the maximum network bandwidth of the ith processing node, Indicates the weight of the number of CPUs and processing rate. Indicates the weight of the disk I / O rate. Indicates the weight of the disk I / O rate. Indicates the weight of the maximum network bandwidth.
[0086] The current load value is obtained by obtaining the latest multiple CPU quantity data, multiple processing rate data, multiple disk I / O rate data, multiple memory capacity data and multiple maximum network bandwidth data on multiple processing nodes, and determining the average CPU quantity data, the average processing rate data, the average disk I / O rate data, the average memory capacity data and the average disk I / O rate data based on the multiple CPU quantity data, the multiple processing rate data, the multiple disk I / O rate data, the multiple memory capacity data and the multiple maximum network bandwidth data, and determining the comprehensive load value as the current load value based on the average CPU quantity data, the average processing rate data, the average disk I / O rate data, the average memory capacity data and the average disk I / O rate data, which is expressed based on the following formula:
[0087] ;in, Represents the average data of the number of CPUs and the average data of the processing rate of the i-th processing node, Represents the average disk I / O rate data of the i-th processing node, represents the average memory capacity data of the i-th processing node, Represents the average disk I / O rate data of the i-th processing node, Indicates the weight of the average data of the number of CPUs and the average data of the processing rate. Indicates the weight of the average disk I / O rate data. Represents the weight of the average data of memory capacity, Indicates the weight of the average disk I / O rate data.
[0088] The distribution weight is expressed based on the following formula: ,in represents the current load ratio of the i-th processing node, where the current load ratio of the i-th processing node is expressed based on the following formula: ,in, represents the maximum processing capacity of the i-th processing node, Represents the current load value of the i-th processing node.
[0089] The optimal processing node capable of real-time processing is determined through the above process.
[0090] Step S130: Schedule the event stream input to the optimal processing node, extract event trigger words and event arguments from the event stream based on the target processing model, and obtain event description text.
[0091] In the embodiment of the present invention, the target processing model is obtained by adjusting parameters based on the initial processing model, and the structure of the target processing model is the bilateral branch BERT model described in the above step 120.
[0092] Before extracting event trigger words and event arguments from the event stream based on the target processing model, the method further includes:
[0093] The input of the text and event annotations is reconstructed through separators for the multiple atomic events in the event stream, and the constructed input has the following structure:
[0094] [CLS] <sentence>[SEP]<event annotation> [SEP];
[0095] Among them, [CLS] represents special classification representation, [SEP] represents separated special representation, <sentence>represents the tokenized input sentence,<event annoation> Indicates the event classification label.
[0096] In the embodiment of the present invention, the input event annotation is based on the predefined implementation and can be regarded as a complete event structure. The model is given additional features and rich prior knowledge through such prompts. Then, the semantic relationship between the input text and the event annotation is learned using the self-attention mechanism of BERT to obtain the feature vector. Finally, the event trigger words and arguments are annotated using the conditional random field.
[0097] Specifically, the purpose of event trigger word extraction in the embodiment of the present invention is to predict whether a word triggers an event and give a span S, that is, a start index and an end index. After the above-mentioned annotated input is encoded by BERT, a context representation for event trigger word extraction can be obtained. , and the corresponding event annotations .
[0098] Based on the above structure, the input for constructing event trigger words is:
[0099] .
[0100] Through BERT, the learned hidden layer representation is:
[0101] ,in and ] is the hidden state of [CLS] and [SEP], is the hidden state of the nth input token, is the hidden state of the corresponding event annotation.
[0102] In the embodiment of the present invention, event trigger words are extracted from the event stream and a softmax classifier is used to predict event classification labels.
[0103] Specifically, the prediction of event classification labels based on the softmax classifier is as follows: define the conversion matrix A: Indicates that from The trigger word label and The transfer score between trigger word labels. Set the output of BERT to H, where Representative Word to correspondence The score of the tag. For a specific word sequence , event trigger word label sequence The score is the sum of the transition score and the word-to-label score calculated efficiently using dynamic programming:
[0104] .
[0105] Finally, the softmax function is used to globally normalize all possible sequences to obtain the probability of predicting the trigger word sequence.
[0106] In the embodiment of the present invention, the target processing model is used to extract arguments from the event stream through CRF (Conditional Random Field).
[0107] Specifically, for a specific word sequence , event theory meta tag sequence The score is the sum of the transition score and the network score computed efficiently using dynamic programming:
[0108] .
[0109] Predict the probability of a sequence of event arguments based on the sum of the scores above.
[0110] The above process realizes the extraction of trigger words and event arguments, and finally the extracted trigger words and event arguments are combined to obtain the final event description text.
[0111] In the technical solution provided by the embodiment of the present invention, the specific feature information of the event stream information to be processed is determined to match the corresponding initial processing model, and the initial processing model is optimized according to the event stream information to obtain the final target processing model, and the optimal processing node is determined based on the node carrying capacity in the current processing cluster, and the event stream is subjected to trigger word extraction and event argument extraction through the bilateral branch BERT model through the processing node and based on the target processing model to obtain the event description text, which solves the extraction difficulty caused by the special event structure and the extraction difficulty caused by the semantic difference of the upstream and downstream tasks of the pre-trained model, realizes the corresponding processing method of event streams from different sources to realize complete and real-time processing of events, and greatly improves the efficiency of event processing.
[0112] See also Figure 2 , an event processing system 200 is provided, the system comprising:
[0113] The initial processing model determining device 210 is used to input the event stream to be processed into the model database set in the large language model, and determine the initial processing model matching the event stream through the model database; the event stream contains multiple atomic events, the model database includes model description information, the model description information includes network structure parameters and model weight parameters, and the initial processing model is obtained by training based on homologous data corresponding to the event stream;
[0114] A model adjustment device 220, configured to adjust the initial processing model based on the network structure parameters and the model weight parameters to obtain a target processing model, and deploy the target processing model on an optimal processing node;
[0115] The processing device 230 is used to schedule the event stream input to the optimal processing node, extract event trigger words and event arguments from the event stream based on the target processing model, and obtain event description text.
[0116] In the technical solution provided by the embodiment of the present invention, the specific feature information of the event stream information to be processed is determined to match the corresponding initial processing model, and the initial processing model is optimized according to the event stream information to obtain the final target processing model, and the optimal processing node is determined based on the node carrying capacity in the current processing cluster, and the event stream is subjected to trigger word extraction and event argument extraction through the bilateral branch BERT model through the processing node and based on the target processing model to obtain the event description text, which solves the extraction difficulty caused by the special event structure and the extraction difficulty caused by the semantic difference of the upstream and downstream tasks of the pre-trained model, realizes the corresponding processing method of event streams from different sources to realize complete and real-time processing of events, and greatly improves the efficiency of event processing.
[0117] See also Figure 3 , the above method can also be integrated into the event processing device 300 provided. The device may have relatively large differences due to different configurations or performances, and may include one or more processors 301 and memory 302. One or more storage applications or data may be stored in the memory 302. Among them, the memory 302 can be a short-term storage or a persistent storage. The application stored in the memory 302 may include one or more modules (not shown in the figure), and each module may include a series of computer executable instructions in the event processing device. Furthermore, the processor 301 can be configured to communicate with the memory 302, and the event processing device executes a series of computer executable instructions in the memory 302. The event processing device may also include one or more power supplies 303, one or more wired or wireless network interfaces 304, one or more input / output interfaces 305, one or more keyboards 306, etc.
[0118] In a specific embodiment, the event processing device includes a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer executable instructions for the marketing copy generation device, and the one or more programs are configured to be executed by one or more processors, including computer executable instructions for performing the following:
[0119] Inputting the event stream to be processed into a model database set in the large language model, and determining an initial processing model matching the event stream through the model database;
[0120] Adjusting the initial processing model based on the network structure parameters and the model weight parameters to obtain a target processing model, and deploying the target processing model on an optimal processing node;
[0121] The event stream input is dispatched to the optimal processing node, and event trigger words and event arguments are extracted from the event stream based on the target processing model to obtain an event description text.
[0122] The following is a detailed introduction to the various components of the processor:
[0123] In this embodiment, the processor is an application specific integrated circuit (ASIC), or is configured to implement one or more integrated circuits of the embodiment of the present invention, such as one or more microprocessors (digital signal processor, DSP), or one or more field programmable gate arrays (field programmable gate array, FPGA).
[0124] Optionally, the processor may execute various functions by running or executing a software program stored in the memory and calling data stored in the memory, such as executing the above-mentioned Figure 1 The method shown.
[0125] In a specific implementation, as an embodiment, the processor may include one or more microprocessors.
[0126] The memory is used to store the software program for executing the solution of the present invention, and the execution is controlled by the processor. The specific implementation method can refer to the above method embodiment, which will not be repeated here.
[0127] Optionally, the memory may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory may be integrated with the processor, or may exist independently and be coupled to the processing unit through the interface circuit of the processor, which is not specifically limited in the embodiments of the present invention.
[0128] It should be noted that the structure of the processor shown in this embodiment does not constitute a limitation on the device, and the actual device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0129] In addition, the technical effects of the processor can refer to the technical effects of the method described in the above method embodiment, which will not be repeated here.
[0130] It should be understood that the processor in the embodiments of the present invention may be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0131] It should also be understood that the memory in the embodiments of the present invention may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DR RAM).
[0132] The above embodiments can be implemented in whole or in part by software, hardware (such as circuits), firmware or any other combination. When implemented by software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can 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 can be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a tape), an optical medium (for example, a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state hard disk.
[0133] In the present invention, "at least one" means one or more, and "more" means two or more. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or plural.
[0134] It should be understood that in various embodiments of the present invention, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0135] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0136] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0137] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0138] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0139] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0140] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program codes.
[0141] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.< / sentence> < / sentence> < / sentence> < / sentence>
Claims
1. An event processing method based on a large language model, characterized in that: The method comprises: Inputting the event stream to be processed into a model database set in the large language model, and determining an initial processing model matching the event stream through the model database; the event stream includes multiple atomic events, the model database includes model description information, the model description information includes network structure parameters and model weight parameters, and the initial processing model is obtained by training based on homologous data corresponding to the event stream; Adjusting the initial processing model based on the network structure parameters and the model weight parameters to obtain a target processing model, and deploying the target processing model on an optimal processing node; The event stream input is dispatched to the optimal processing node, and event trigger words and event arguments are extracted from the event stream based on the target processing model to obtain an event description text.
2. The event processing method based on a large language model according to claim 1, characterized in that: The model database also includes preprocessing parameters; Before adjusting the initial processing model based on the network structure parameters and the model weight parameters, the method further includes: Preprocessing the event stream based on the preprocessing parameters specifically includes: The event stream is subjected to data cleaning and normalization processing, wherein the data cleaning removes invalid data and incomplete data in the event stream based on the preprocessing parameters, and the normalization processing normalizes the event stream based on the normalization parameters in the preprocessing parameters.
3. The event processing method based on a large language model according to claim 1 or 2, characterized in that: The adjusting the initial processing model based on the network structure parameters and the model weight parameters to obtain a target processing model includes: Based on the network structure parameters and the model weight parameters, the initial processing model is adjusted using the interface of the MXNet framework to obtain a target processing model.
4. The event processing method based on a large language model according to claim 1 or 2, characterized in that: The step of deploying the target processing model on an optimal processing node includes: Acquire the maximum processing capacity of the plurality of processing nodes and the current load values of the plurality of processing nodes, and determine the current load ratio of each processing node based on the maximum processing capacity and the current load value; The distribution weight of each processing node is determined based on the current load ratio of each processing node, the optimal processing node is determined based on the distribution weight of each processing node, and the target processing model is deployed on the optimal processing node.
5. The event processing method based on a large language model according to claim 4, characterized in that: The obtaining of the maximum processing capabilities of the plurality of processing nodes includes: Get the number of CPUs, processing rates, disk I / O rates, memory capacity, and maximum network bandwidth of multiple processing nodes, and get the maximum processing capacity of the processing nodes based on the following formula: ; in, represents the number of CPUs of the i-th processing node, represents the processing rate of the i-th processing node, represents the disk I / O rate of the i-th processing node, represents the memory capacity of the i-th processing node, represents the maximum network bandwidth of the ith processing node, Indicates the weight of the number of CPUs and processing rate. Indicates the weight of the disk I / O rate. Indicates the weight of the disk I / O rate. Indicates the weight of the maximum network bandwidth.
6. The event processing method based on a large language model according to claim 4, characterized in that: Determine the current load value of each processing node, including: The current load value of each processing node is determined based on the following formula: ; in, Represents the average data of the number of CPUs and the average data of the processing rate of the i-th processing node, Represents the average disk I / O rate data of the i-th processing node, represents the average memory capacity data of the i-th processing node, Represents the average disk I / O rate data of the i-th processing node, Indicates the weight of the average data of the number of CPUs and the average data of the processing rate. Indicates the weight of the average disk I / O rate data. Represents the weight of the average data of memory capacity, Indicates the weight of the average disk I / O rate data.
7. The event processing method based on a large language model according to claim 4, characterized in that: The distribution weight of each processing node is determined based on the current load ratio of each processing node, including: The distribution weight of each processing node is determined based on the following formula and the current load ratio of each processing node: ,in represents the current load ratio of the i-th processing node, where the current load ratio of the i-th processing node is expressed based on the following formula: ; in, represents the maximum processing capacity of the i-th processing node, Represents the current load value of the i-th processing node.
8. The event processing method based on a large language model according to claim 1, characterized in that: The structure of the target processing model is a bilateral branch BERT model; Before extracting event trigger words and event arguments from the event stream based on the target processing model, the method further includes: The input of the text and event annotations is reconstructed through separators for the multiple atomic events in the event stream, and the constructed input has the following structure: [CLS] <sentence>[SEP]<event annotation> [SEP];< / sentence> Among them, [CLS] represents special classification representation, [SEP] represents separated special representation, <sentence> represents the tokenized input sentence,<event annotation> Indicates the event classification label.< / sentence> 9. The event processing method based on a large language model according to claim 8, characterized in that: The extracting event trigger words and event arguments from the event stream based on the target processing model includes: After extracting event trigger words from the event stream based on the target processing model, a softmax classifier is used to predict event classification labels, and conditional random fields (CRF) are used to extract arguments from the event stream.
10. An event processing system based on a large language model, characterized in that: The system comprises: An initial processing model determination device is used to input an event stream to be processed into a model database set in a large language model, and determine an initial processing model matching the event stream through the model database; the event stream contains multiple atomic events, the model database includes model description information, the model description information includes network structure parameters and model weight parameters, the initial processing model is obtained by training based on homologous data corresponding to the event stream, the initial processing model is a bilateral branch BERT model, including two encoder networks, the two encoder networks use BERT as the backbone, the two BERT models share weights, and feature processing is performed on the encoding based on a fully connected layer; A model adjustment device, used to adjust the initial processing model based on the network structure parameters and the model weight parameters to obtain a target processing model, and deploy the target processing model on an optimal processing node; The processing device is used to dispatch the event stream input to the optimal processing node, extract event trigger words and event arguments from the event stream based on the target processing model, and obtain event description text.
