Service process model training method and service process generation method
By training the service process model through a deep learning model and automatically extracting event words and relationship words, the problem of subjective factors in service process formulation is solved, and efficient and standardized service process generation is achieved.
Patent Information
- Application Number
- CN202210374719.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-11
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2042-04-11
AI Technical Summary
The existing service process is influenced by subjective factors and lacks standardization, which leads to service redundancy or process errors, low efficiency, and the need for manual modification and correction.
A deep learning model is used to train the service process model, including the event extraction model and the event relationship extraction model. By annotating and training multiple service process description texts, event words and event relationship words are automatically extracted to generate a standardized service process.
It improves the efficiency and reliability of service process formulation, reduces the influence of human subjective factors, reduces workload and speeds up processing.
Smart Images

Figure CN114943410B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of service setting, and in particular to a service process model training method and a service process generation method. Background Art
[0002] In recent years, with the continuous development and progress of modern service industry, the service industry is becoming an important part of the world economy, and service science, service management and service engineering have gradually become research hotspots in academia and industry.
[0003] Services are typically presented as processes. When developing a service process, the process developer typically first studies the service's requirements, then establishes the service process nodes based on these requirements. Ultimately, the complete service process is developed based on these nodes and requirements. However, due to subjective factors and a lack of standardization in process development, the same service may exhibit different service processes. To ensure consistent service processes for the same service, process developers will likely reference existing service processes when developing them. For example, when developing a city service process, process developers will typically reference existing city service processes.
[0004] However, in the process of formulating new service processes by referring to existing service processes, there are still problems such as the influence of subjective factors of service process developers and the lack of standardization, which may lead to service redundancy or process errors. Moreover, in the process of service process formulation, manual modification and correction of each service process is usually required, which is inefficient and labor-intensive. Summary of the Invention
[0005] The problem solved by the present invention is how to improve the efficiency of service process formulation and the reliability of the generated service process.
[0006] To solve the above problems, the present invention provides a service process model training method and a service process generation method.
[0007] In a first aspect, the present invention provides a service process model training method, wherein the service process model includes an event extraction model and an event relationship extraction model, and the method includes:
[0008] Acquire a text dataset, wherein the text dataset includes description texts of multiple different service processes;
[0009] Annotating actual event words in each of the description texts to obtain a first training set; using the first training set to train a pre-established first deep learning model to obtain the event extraction model;
[0010] The actual event relationship words between each two actual event words in each of the description texts are labeled to obtain a second training set; the second training set is used to train a pre-established second deep learning model to obtain the event relationship extraction model.
[0011] Optionally, the first deep learning model includes a trigger word extraction model and an argument extraction model, the event extraction model includes a trained trigger word extraction model and a trained argument extraction model, and the first training set includes a plurality of first data pairs consisting of the corresponding description texts and the actual event words, wherein the actual event words include actual trigger words and actual arguments in the service process, and the actual arguments represent elements associated with events in the service process;
[0012] The using the first training set to train the pre-established first deep learning model includes:
[0013] Performing word segmentation processing on the description text based on characters to obtain a character sequence;
[0014] Inputting the word sequence into the trigger word extraction model and outputting a predicted trigger word;
[0015] Based on a preset first loss function, correcting the parameters of the trigger word extraction model according to the predicted trigger word and the corresponding actual trigger word until the accuracy of the trigger word extraction model reaches a first preset range, thereby obtaining the trained trigger word extraction model;
[0016] Inputting the word sequence and the position of the actual trigger word in the word sequence into the argument extraction model, and outputting a predicted argument;
[0017] Based on a preset second loss function, the parameters of the argument extraction model are corrected according to the predicted argument and the corresponding actual argument until the accuracy of the argument extraction model reaches a second preset range, thereby obtaining the trained argument extraction model.
[0018] Optionally, the trigger word extraction model includes a first Bert model, a first Mid-Linear layer, and a first pointer annotation network, and inputting the word sequence into the trigger word extraction model and outputting the predicted trigger word includes:
[0019] Inputting the word sequence into the first Bert model, encoding each character in the word sequence using the first Bert model, and outputting a first encoded sequence;
[0020] Input the first coding sequence into the first Mid-Linear layer, execute the position sequence generation step, and output the trigger word start position sequence and the trigger word end position sequence;
[0021] Inputting the trigger word start position sequence and the trigger word end position sequence into the first pointer annotation network, executing a position determination step to determine the trigger word start position and the trigger word end position;
[0022] A specific word extraction step is performed to extract the predicted trigger word from the character sequence according to the trigger word start position and the trigger word end position.
[0023] Optionally, the argument extraction model includes a second Bert model, a Conditinal-Layer Norm layer, a second Mid-Linear layer, and a second pointer annotation network, and inputting the word sequence and the position of the actual trigger word in the word sequence into the argument extraction model, and outputting the predicted argument includes:
[0024] Inputting the word sequence into the second Bert model, encoding each character in the word sequence using the second Bert model, and outputting a second encoded sequence;
[0025] Input the second coding sequence and the position of the actual trigger word in the word sequence into the Conditinal-Layer Norm layer, and output a processed sequence;
[0026] Input the processed sequence into the second Mid-Linear layer, execute the position sequence generation step, and output the argument start position sequence and the argument end position sequence;
[0027] Inputting the argument start position sequence and the argument end position sequence into the second pointer marking network, executing a position determination step to determine the argument start position and the argument end position;
[0028] A specific word extraction step is performed to extract the predicted argument from the word sequence according to the argument start position and the argument end position.
[0029] Optionally, the second deep learning model includes a third Bert model, an encoding concatenate layer, a third mid-linear layer, and a third pointer annotation network; the second training set includes a plurality of second data pairs consisting of corresponding description texts and feature words, and the feature words include any two actual event words and corresponding actual event relationship words;
[0030] The using the second training set to train the pre-established second deep learning model includes:
[0031] Performing word segmentation processing on the description text based on characters to obtain a character sequence;
[0032] Inputting the word sequence into the third Bert model, encoding each character in the word sequence using the third Bert model to obtain a third encoding sequence;
[0033] Input the third coding sequence and the positions of any two actual event words in the third coding sequence into the coding concatenate layer, and output a feature sequence;
[0034] Inputting the feature sequence into the third Mid-Linear layer, executing a position sequence generation step, and outputting an event-related word start position sequence and an event-related word end position sequence;
[0035] Inputting the event relation word start position sequence and the event relation word end position sequence into the third pointer annotation network, executing a position determination step to determine the event relation word start position and the event relation word end position;
[0036] Executing a specific word extraction step to extract the predicted event-related word from the word sequence according to the start position and the end position of the event-related word;
[0037] Based on a preset third loss function, the parameters of the second deep learning model are corrected according to the predicted event relationship words and the corresponding actual event relationship words until the accuracy of the second deep learning model reaches a third preset range, thereby obtaining the event relationship extraction model.
[0038] Optionally, after marking the actual event relationship words between each two actual event words in each of the description texts, the method further includes:
[0039] Determining the relationship type of each of the marked actual event relationship words, and constructing an event relationship word library according to the actual event relationship words and the corresponding relationship types, wherein the relationship types include sequential relationship, concurrent relationship, and selection relationship;
[0040] and / or,
[0041] After extracting the predicted event-related word from the character sequence according to the event-related word start position and the event-related word end position, the method further includes:
[0042] The relationship type corresponding to the predicted event relationship word is determined in a preset event relationship word library.
[0043] Optionally, the step of generating the execution position sequence includes:
[0044] Determining a first logical value and a second logical value of each element position in a sequence to be processed by an activation function, wherein the activation function includes a Sigmoid function, the first logical value represents a probability that the corresponding element position is a starting position of a specific word, and the second logical value represents a probability that the corresponding element position is an ending position of the specific word;
[0045] generating a specific word start position sequence according to the first logic value of each element position, and generating a specific word end position sequence according to the second logic value of each element position;
[0046] Among them, the sequence to be processed includes a first coding sequence, a processing sequence and a feature sequence, the specific word starting position sequence includes a trigger word starting position sequence, an argument starting position sequence and an event relationship word starting position sequence, and the specific word ending position sequence includes a trigger word ending position sequence, an argument ending position sequence and an event relationship word ending position sequence.
[0047] Optionally, the step of determining the execution position includes:
[0048] Comparing the first logic value of each element position with a first preset threshold value, and determining the starting position of the specific word according to the first comparison result; comparing the second logic value of each element position with a second preset threshold value, and determining the ending position of the specific word according to the second comparison result;
[0049] The specific word starting position includes the trigger word starting position, the argument starting position and the event-related word starting position, and the specific word ending position includes the trigger word ending position, the argument ending position and the event-related word ending position.
[0050] Optionally, the step of performing specific word extraction includes:
[0051] Based on a preset rule, extracting all predicted specific words from the character sequence according to the specific word start position and the specific word end position;
[0052] Determine a specific word logic value of each of the predicted specific words according to the first logic value of the specific word start position and the second logic value of the specific word end position;
[0053] Filtering all the predicted specific words according to the specific word logical value, and outputting the filtered predicted specific words;
[0054] The predicted specific words include predicted trigger words, predicted arguments and predicted event related words.
[0055] In a second aspect, the present invention provides a service process generation method, comprising:
[0056] Get the target description text of the target service;
[0057] Inputting the target description text into an event extraction model, and outputting event words in the target description text;
[0058] Repeating the event relationship word extraction step multiple times to obtain event relationship words between every two event words, wherein the event relationship word extraction step includes marking the positions of any two event words in the target description text, inputting the marked target description text into the event relationship extraction model, and extracting the event relationship words corresponding to the two event words;
[0059] generating a service flow of the target service according to each corresponding two event words and the event relationship words;
[0060] The event extraction model and the event relationship extraction model are trained using the service process model training method described in any one of the first aspects.
[0061] Optionally, the event words include trigger words and arguments, the event extraction model includes a trigger word extraction model and an argument extraction model, and inputting the target description text into the event extraction model and outputting the event words in the target description text includes:
[0062] Performing word segmentation processing on the target description text based on characters to obtain a character sequence;
[0063] Inputting the word sequence into the trigger word extraction model, and outputting the trigger words in the target description text;
[0064] Inputting the word sequence and the position of the trigger word in the word sequence into the argument extraction model, and outputting the argument corresponding to the trigger word in the target description text;
[0065] and / or
[0066] The service process of generating the target service according to each corresponding two event words and the event relationship words includes:
[0067] The relationship types corresponding to the event relationship words are determined in a preset event relationship word library, and a flow chart of the target service is constructed according to every two event words and the corresponding relationship types.
[0068] The beneficial effects of the service process model training method and the service process generation method of the present invention are as follows: obtaining description texts of multiple different service processes, annotating the actual event words in each description text, obtaining a first data pair consisting of multiple description texts and actual event words, and all first data pairs forming a first training set. Annotating the actual event relationship words between every two actual event words in each description text, that is, for any actual event word, annotating the actual event relationship words between the actual event word and the remaining actual event words, obtaining a second data pair consisting of multiple description texts and feature words, and the feature words may include two actual event words and corresponding actual event relationship words. Using the first deep learning model pre-established by the first training set, a trained first deep learning model is obtained, namely, an event extraction model, and the event extraction model is used to extract event words in the description text. Using the second training set to train the pre-established second deep learning model, a trained second deep learning model is obtained, namely, an event relationship extraction model, and the event relationship extraction model is used to extract event relationship words between any two event words in the description text. When faced with a target service, the trained event extraction model and event relationship extraction model can extract event terms and event relationship terms from the target service's description text. By combining the corresponding event terms and time relationship terms, the service flow for the target service can be derived. Automatically generating service flows through training deep learning models achieves a higher level of standardization than manually developed service flows, avoids the influence of subjective factors, and improves the reliability of the generated service flows. Furthermore, the processing is performed by electronic devices, which process data more quickly, reducing staff workload and improving the efficiency of service flow development. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] Figure 1 A flow chart of a service process model training method according to an embodiment of the present invention;
[0070] Figure 2 A schematic diagram of the sequence relationship of an embodiment of the present invention;
[0071] Figure 3 A schematic diagram of a concurrency relationship in an embodiment of the present invention;
[0072] Figure 4 A schematic diagram of the selection relationship of an embodiment of the present invention;
[0073] Figure 5 A structural diagram of a trigger word extraction model according to an embodiment of the present invention;
[0074] Figure 6 Schematic diagram of a trigger word start position sequence and a trigger word end position sequence according to an embodiment of the present invention;
[0075] Figure 7 A schematic structural diagram of an argument extraction model according to an embodiment of the present invention;
[0076] Figure 8 This is a schematic diagram of the structure of an event-related word extraction model according to an embodiment of the present invention;
[0077] Figure 9 The figure is a flowchart of a service process generation method according to another embodiment of the present invention. DETAILED DESCRIPTION
[0078] To make the above-mentioned objects, features, and advantages of the present invention more clearly understood, specific embodiments of the present invention are described in detail below with reference to the accompanying drawings. Although certain embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be construed as being limited to the embodiments described herein. Instead, these embodiments are provided to provide a more thorough and complete understanding of the present invention. It should be understood that the drawings and embodiments of the present invention are for illustrative purposes only and are not intended to limit the scope of protection of the present invention.
[0079] It should be understood that the various steps described in the method embodiments of the present invention may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present invention is not limited in this respect.
[0080] The term "including" and its variations used in this document are open inclusions, that is, "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one other embodiment"; the term "some embodiments" means "at least some embodiments"; the term "optionally" means "optional embodiments". The relevant definitions of other terms will be given in the following description. It should be noted that the concepts of "first", "second", etc. mentioned in the present invention are only used to distinguish different devices, models or units, and are not used to limit the order or interdependence of the functions performed by these devices, models or units.
[0081] It should be noted that the modifications of "one" and "multiple" mentioned in the present invention are illustrative rather than restrictive. Those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0082] The names of the messages or information exchanged between multiple devices in the embodiments of the present invention are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0083] Standardizing service processes is a prerequisite for generating service processes. This paper designs a simple basic service process format to implement service process modeling. A service process is a special type of process that shares some of the characteristics of a process. A process typically consists of events and event relationships. Events correspond to points on a flowchart, and event relationships correspond to edges on the flowchart.
[0084] For example, let's take a description of a government department, "The Finance Bureau compiles the draft annual fiscal budget. Meanwhile, the Justice Bureau manages judicial administration," as an example to explain event terms and event relation terms. "The Finance Bureau compiles the draft annual fiscal budget" and "The Justice Bureau manages judicial administration" are event terms in this example, and "while" is the event relation term between the two event terms. Furthermore, taking the event term "The Finance Bureau compiles the draft annual fiscal budget" as an example, "Finance Bureau" is the subject entity of the event, "Draft annual fiscal budget" is the object entity of the event, both the subject and object entities are arguments, and "compile" is the trigger term.
[0085] The technical solution of this invention can be applied not only to urban service processes, but also to other service processes. The key to a service process is an event. Taking the urban service process as an example, an event serves as the foundational service. An event consists of a trigger word and arguments. Arguments refer to all elements related to the event, such as the subject that executes the event and the conditions under which the event occurs. Based on the characteristics of the aforementioned service process, in this invention, an event can be divided into a four-tuple: (s, t, o, c).
[0086] Among them, s refers to the subject, that is, the main entity of the event, which is the executor of the trigger word. Taking the urban service process as an example, such as "forestry department" and "front desk"; t refers to the trigger word trigger of the event, which is usually an action, such as "review" and "processing"; o refers to the object, that is, the objective entity, which is the execution content or carrier of the trigger word, such as "respondent" and "application form"; c refers to the condition, which does not refer to the condition under which the trigger word is triggered during the model training process, but refers to the service event in the text semantics.
[0087] Edges in a service process are usually directed edges, representing the transfer from one event to another. They usually have attributes that represent the event relationship between the two events. Event relationships include:
[0088] Sequential relationship: such as Figure 2 As shown in the figure, an event B is executed immediately after an event A ends. Such an event relationship is called a sequential relationship.
[0089] Concurrency: Two or more events will occur simultaneously, e.g. Figure 3As shown, after event A is executed, event B and event C will be executed at the same time, so there is a concurrent relationship between event B and event C.
[0090] Selection relationship: refers to selecting one of two or more events, which is similar to the concurrent relationship, but only one event will be executed in the end, for example Figure 4 As shown in the figure, after event A ends, only one of event B and event C can be triggered. This event relationship is called a selection relationship.
[0091] like Figure 1 As shown, an embodiment of the present invention provides a service process model training method, where the service process model includes an event extraction model and an event relationship extraction model. The method includes:
[0092] Step S110 : obtaining a text dataset, wherein the text dataset includes description texts of multiple different service processes.
[0093] For example, taking the city service process as an example, description texts of multiple service processes in multiple different cities are obtained to form a text dataset.
[0094] Step S120: annotate the actual event words in each of the description texts to obtain a first training set; and use the first training set to train a pre-established first deep learning model to obtain the event extraction model.
[0095] Optionally, the first deep learning model includes a trigger word extraction model and an argument extraction model, the event extraction model includes a trained trigger word extraction model and a trained argument extraction model, and the first training set includes a first data pair consisting of a plurality of corresponding description texts and actual event words, wherein the actual event words include actual trigger words and actual arguments in the service process, and the actual arguments represent elements associated with events in the service process.
[0096] Specifically, event words and event relationship words in the description text can be annotated through manual annotation and intelligent annotation to construct a data pair of <description text, event quadruple>. The event quadruple corresponds to the actual event words. The actual event words include the actual trigger words and actual arguments. The actual trigger words correspond to t in the event quadruple, and the actual arguments include the main entity s, the object entity o and the condition c in the event quadruple.
[0097] Step S130, annotating the actual event relationship words between each two actual event words in each of the description texts to obtain a second training set; using the second training set to train a pre-established second deep learning model to obtain the event relationship extraction model.
[0098] Specifically, the event relationship terms between each event and other events can be annotated through manual labeling and intelligent labeling. It should be noted that only the event relationship terms between directly related event pairs need to be annotated. However, when training the model, not only events with event relationship terms are used to train the model, but also event pairs without event relationship terms are used to construct negative samples for model training to avoid overfitting of the second deep learning model.
[0099] In this embodiment, description texts of multiple different service processes are obtained, the actual event words in each description text are annotated, and a first data pair consisting of multiple description texts and actual event words is obtained, and all first data pairs constitute a first training set. The actual event relationship words between every two actual event words in each description text are annotated, that is, for any actual event word, the actual event relationship words between the actual event word and the remaining actual event words are annotated, and a second data pair consisting of multiple description texts and feature words is obtained. The feature words may include two actual event words and corresponding actual event relationship words. The first deep learning model pre-established by the first training set is used to obtain a trained first deep learning model, that is, an event extraction model, and the event extraction model is used to extract event words in the description text. The second deep learning model pre-established by the second training set is trained to obtain a trained second deep learning model, that is, an event relationship extraction model, and the event relationship extraction model is used to extract event relationship words between any two event words in the description text. When faced with a target service, the trained event extraction model and event relationship extraction model can extract event terms and event relationship terms from the target service's description text. By combining the corresponding event terms and time relationship terms, the service flow for the target service can be derived. Automatically generating service flows through training deep learning models achieves a higher level of standardization than manually developed service flows, avoids the influence of subjective factors, and improves the reliability of the generated service flows. Furthermore, the processing is performed by electronic devices, which process data more quickly, reducing staff workload and improving the efficiency of service flow development.
[0100] By analyzing the problems and data characteristics of event word extraction in descriptive texts, the following characteristics are found: trigger words can appear at any position in the service process description text, making it very difficult to extract trigger words; the argument corresponding to each trigger word is unique, but the same subject and object entity may correspond to different trigger words. For example, "departments at or above the county level" may perform "handling" and may also perform "review", so not only ("departments at or above the county level", "handling", o1, c1) but also ("departments at or above the county level", "review", o2, c2) must be extracted; there may be more than one trigger word in a description text. If the distance between the trigger words is close, how to separate different trigger words and extract all trigger words is a problem that needs to be solved; some trigger words may lack subject and object entities, so it is necessary to consider the model's handling of data default values; and in different service process fields, specific vocabulary and abbreviations need to be extracted, such as "transfer report" and "agricultural office" in urban service processes.
[0101] Based on the above problem analysis, the present invention applies the idea of probability graph to solve these problems. The task can be abstracted as: input the description text x of the service process, and output the event word, that is, the event quadruple (s, t, o, c). The extraction of the event quadruple can be converted into first extracting the trigger word, and then using the trigger word as prior knowledge to extract the argument (s, o, c), that is, the main entity, object entity and condition of the event. It should be noted that the main entity and the object entity can be expanded according to the Bayesian formula, but since there may be default values among the main entity, object entity and condition, the default values will affect the extraction of each other. For example: if the extracted main entity s is "Municipal Automobile Administration Bureau", it will be of certain help to extract the object entity o "Motor Vehicle Annual Inspection", so the main entity, object entity and condition are extracted together.
[0102] Before training the first deep learning model, the acquired text dataset and the first training set may be processed and cleaned.
[0103] In the data processing phase, all data pairs can be retained, even those that do not contain trigger words. This is because, while trigger words are essential for each step of the service process, descriptions without trigger words can provide negative samples for the deep learning model, alleviating overfitting to a certain extent and improving model accuracy. In the data cleaning phase, argument metadata such as time and location can be removed from the first training set. This is because service process samples with time and location information are relatively rare, making it difficult to construct a dataset with a sufficient number of <description text, time / location> pairs. Therefore, time and location information in the service process can be disregarded, and only the event quadruple described above can be considered.
[0104] Optionally, the first deep learning model includes a trigger word extraction model and an argument extraction model, and the training of the pre-established first deep learning model using the first training set includes:
[0105] Step S121 , performing word segmentation processing on the description text based on characters to obtain a character sequence.
[0106] Specifically, in the data processing part, it is also necessary to perform word segmentation on the description text. Due to the word segmentation based on words, the expected output is not necessarily the connection of multiple continuous words after word segmentation. At the same time, there may be some specific words and abbreviations in the service process field. The corpus may not completely cover these words, which may lead to the occurrence of OOV (out of vocabulary) phenomenon. Therefore, word segmentation can be performed based on the words of the Bert corpus. The information required to be extracted is all included in the description text, and the corpus almost includes all words, so the occurrence of OOV phenomenon can be avoided. Moreover, although in the technical means of existing natural language processing, the stop words in the text have no effect on the semantics of the text, for example, after the word "of" in "happy girl is dancing" is deleted, the meaning of the text does not change, but in the service process field, stop words can provide help to the text semantic expression to a certain extent, and there may also be the situation that stop words are in the event quadruple of the service process, for example, "otherwise" will affect the extraction of event relations, and the "white" in "Baisha Forestry Bureau" is an indispensable part in the entity.
[0107] Step S122: input the character sequence into the trigger word extraction model and output the predicted trigger word.
[0108] Step S123: Based on a preset first loss function, the parameters of the trigger word extraction model are corrected according to the predicted trigger word and the corresponding actual trigger word, until the accuracy of the trigger word extraction model reaches a first preset range, thereby obtaining the trained trigger word extraction model.
[0109] Step S124 , inputting the word sequence and the position of the actual trigger word in the word sequence into the argument extraction model, and outputting a predicted argument.
[0110] Step S125: Based on a preset second loss function, the parameters of the argument extraction model are corrected according to the predicted argument and the corresponding actual argument, until the accuracy of the argument extraction model reaches a second preset range, thereby obtaining the trained argument extraction model.
[0111] Specifically, the first loss function of the trigger word extraction model and the second loss function of the argument extraction model can both use the BCELoss (Binary CrossEntropyLoss) function. BCELoss is a special case of CrossEntropyLoss, which is suitable for binary classification problems and usually needs to be preceded by a sigmoid as an activation function when used.
[0112] In this optional embodiment, when extracting event words from a descriptive text, the trigger words in the descriptive text are first extracted, and then the relevant information of the extracted trigger words is used as prior knowledge to extract the arguments in the descriptive text. There may be a certain semantic relationship between the trigger words and the arguments, which can provide certain assistance for the extraction of the arguments, thereby improving the accuracy of the extracted arguments.
[0113] Alternatively, as Figure 5 As shown, the trigger word extraction model includes a first Bert model, a first Mid-Linear layer and a first pointer annotation network. The word sequence is input into the trigger word extraction model, and the output of the predicted trigger word includes:
[0114] Step S1221: input the word sequence into the first Bert model, encode each character in the word sequence through the first Bert model, and output a first encoding sequence.
[0115] Specifically, the Bert model is a language representation model that has been trained. It can achieve good results in many problems in the field of natural language processing and is a commonly used model in the field of event extraction. The structure of the Bert model is different from that of the commonly used pre-trained models. Thanks to the deep bidirectional Transformer component used, it is not limited by the model representation capabilities of the unidirectional language model. During the encoding process, each character in the word sequence can be converted into an integer based on the vocabulary. This integer can be determined by its order or position in the vocabulary, and then the text is encoded through the first pre-trained Bert model to obtain the first encoded sequence. Figure 5 As shown, the input sequence of the first Bert model is the word sequence corresponding to the description text "Application for approval of the Glorious Home by departments at or above the county level".
[0116] Step S1222: input the first coding sequence into the first Mid-Linear layer, execute the position sequence generation step, and output the trigger word start position sequence and the trigger word end position sequence.
[0117] Specifically, in the prior art, when judging whether there are specific words in a sentence, for example, judging whether there are words representing colors in the sentence "There are white clouds floating in the sky", the words are input into the classifier, and the output of the classifier is "0, 0, 0, 1, 1, 0, 0, 0, 0, 0", where the position of "1" corresponds exactly to the position of "white" in the original text. However, this method cannot obtain the positions of multiple specific words. In order to solve this problem, the present invention adopts the method of Mid-Linear layer and pointer annotation network to realize the extraction of multiple specific words.
[0118] The Mid-Linear layer is actually a fully connected layer, which essentially functions as a "classifier." The output of the Mid-Linear layer is two sequences: the start position sequence and the end position sequence of specific words. In this embodiment, these correspond to the trigger word start position sequence and the trigger word end position sequence. The start position sequence identifies the start position of the specific word, and the end position sequence identifies the end position of the specific word. Taking the above text "There are white clouds floating in the sky" as an example, the start position sequence and end position sequence of the specific word related to color are "0, 0, 0, 1, 0, 0, 0, 0, 0" and "0, 0, 0, 0, 1, 0, 0, 0, 0, 0" respectively. Combining these two sequences can extract the specific word "white."
[0119] Optionally, the activation function of the first Mid-Linear layer may adopt a Sigmoid function, and the step of executing the position sequence generation step to output the trigger word start position sequence and the trigger word end position sequence includes:
[0120] The first logical value and the second logical value of each element position in the first coding sequence are determined by the activation function, wherein the first logical value represents the probability that the corresponding element position is the starting position of the trigger word, and the second logical value represents the probability that the corresponding element position is the ending position of the trigger word.
[0121] Specifically, the existing mid-linear layer typically uses the argmax activation function. However, this activation function only changes one code in the input sequence to 1, while the remaining codes become 0, making it impossible to determine the positions of multiple specific words. Therefore, this optional embodiment uses a sigmoid function, which can output the probability that each element position is the position of a specific word.
[0122] A specific word start position sequence is generated according to the first logic value of each element position, and a specific word end position sequence is generated according to the second logic value of each element position.
[0123] Specifically, the first logical values of each element position can be sequentially combined according to the order of the element positions to form a trigger word start position sequence, and the second logical values of each element position can be sequentially combined to form a trigger word end position sequence.
[0124] Exemplarily, as Figure 6 In the first row sequence is the character sequence, the second row sequence is the trigger word start position sequence, and the third row sequence is the trigger word end position sequence. Taking the characters "examination" and "approval" in the character sequence as examples, the first logical value corresponding to "examination" is 0.9, indicating that the probability that the position where the character "examination" is located is the start position of the trigger word is 0.9, and the second logical value is 0, indicating that the probability that the position where the character "examination" is located is the end position of the trigger word is 0; the first logical value corresponding to "approval" in the character sequence is 0, and the second logical value is 0.8.
[0125] Step S1223, input the trigger word start position sequence and the trigger word end position sequence into the first pointer annotation network, execute the position determination step, and determine the trigger word start position and the trigger word end position.
[0126] Specifically, since the trigger word start position sequence identifies the start position of the trigger word in the description text, and the trigger word end position sequence identifies the end position of the trigger word in the description text, combining the trigger word start position and the trigger word end position can extract the predicted trigger word from the character sequence or the description text.
[0127] [[ID=The position of the character "审" corresponding to the first logical value 0.9 in is the start position of the trigger word, and the position of the character "批" corresponding to the second logical value 0.8 is the end position of the trigger word.
[0131] Step S1224, perform the specific word extraction step, and extract the predicted trigger word from the character sequence according to the start position and the end position of the trigger word.
[0132] Optionally, the performing the specific word extraction step and extracting the predicted trigger word from the character sequence according to the start position and the end position of the trigger word includes:
[0133] Based on a preset rule, extract all the predicted trigger words from the character sequence according to the start position and the end position of the trigger word.
[0134] Specifically, since when there are multiple trigger words in the description text, the pointer annotation network cannot accurately determine the corresponding relationship between the start position and the end position of the trigger word. For example, the start position A of the trigger word should correspond to the end position B of the trigger word, that is, all characters between the start position A and the end position B of the trigger word form a trigger word, while the start position A of the trigger word and the end position C do not correspond. To solve this problem, through the analysis of trigger words in different events, it is found that the length of trigger words in almost all events does not exceed four characters, that is, the characters between the start position and the end position of the trigger word do not exceed four. Therefore, all predicted trigger words that meet this rule can be extracted from the character sequence based on the rule that the length of the trigger word does not exceed four characters, according to the start position and the end position of each trigger word.
[0135] Exemplarily, in combination with Figure 5 and Figure 6 the content of, extract the trigger word "审批" from the character sequence according to the determined start position and end position of the trigger word.
[0136] Determine the trigger word logical value of each of the predicted trigger words according to the first logical value at the start position of the trigger word and the second logical value at the end position of the trigger word.
[0137] Specifically, for each predicted trigger word, the sum of the first logical value at the corresponding start position of the trigger word and the second logical value at the end position of the trigger word can be used as its trigger word logical value, or the sum of the logical values of all characters between the corresponding start position and end position of the trigger word can be used as its trigger word logical value.
[0138] Screen all the predicted trigger words according to the trigger word logical value, and output the screened predicted trigger words.
[0139] Specifically, there may be character overlap between all the extracted predicted trigger words. Specifically, whether there is character overlap can be determined based on the trigger word start position and trigger word end position corresponding to each predicted trigger word. For example: one predicted trigger word is "approval", assuming that its corresponding trigger word start position is A and trigger word end position is B. Another predicted trigger word is "approval", and its corresponding trigger word start position is B and trigger word end position is C. The characters "batch" in the two predicted trigger words overlap. Comparing the trigger word logic values of the overlapping predicted trigger words, the larger the trigger word logic value, the more likely the corresponding predicted trigger word is the actual trigger word. Therefore, for the overlapping predicted trigger words, the predicted trigger word with a larger trigger word logic value is selected, and the predicted trigger word with a smaller trigger word logic value is eliminated to implement the screening process of the predicted trigger words, and the filtered predicted trigger words are used as the output of the trigger word extraction model.
[0140] In this optional embodiment, encoding the character sequence corresponding to the description text through the first Bert model is more conducive to subsequent processing than directly processing the characters, and can reduce the amount of data in the processing process and increase the data processing speed. The first encoding sequence is processed through the first Mid-Linear layer to generate a trigger word start position sequence and a trigger word end position sequence, which can identify the location of all trigger words in the description text. Based on the location, the trigger words are extracted through the first pointer annotation network, which can extract all trigger words in the description text and eliminate trigger words that do not meet the requirements, thereby improving the accuracy of the extracted trigger words.
[0141] Alternatively, as Figure 7 As shown, the argument extraction model includes a second Bert model, a Conditinal-LayerNorm layer, a second Mid-Linear layer, and a second pointer annotation network. The word sequence and the position of the actual trigger word in the word sequence are input into the argument extraction model, and the output of the predicted argument includes:
[0142] Step S1241: input the word sequence into the second Bert model, encode each character in the word sequence through the second Bert model, and output a second encoded sequence.
[0143] Specifically, the second BERT model can share parameters with the first BERT model in the trigger word extraction model, or not. When parameters are not shared, training the two BERT models separately can improve the prediction performance of the entire model, while sharing parameters between the two BERT models can reduce the size of the entire model. Therefore, the choice can be made based on actual conditions.
[0144] Step S1242: input the second coding sequence and the position of the actual trigger word in the word sequence into the Conditinal-Layer Norm layer, and output a processed sequence.
[0145] Specifically, the idea of adding the Conditional-Layer Norm layer originates from the conditional adversarial generative network commonly used in image processing. In Transformer models like BERT, the primary Normalization method is LayerNormalization. Therefore, the generation behavior of the Transformer model can be controlled by changing the parameters β and γ in the input conditions. The specific process involves using the trigger words extracted by a trained trigger word extraction model or the encoded sequence subscript of the actual trigger words as conditions. This sequence subscript represents the position of the actual trigger words in the word sequence. This subscript is then calculated with the parameters β and γ from the pre-trained model and superimposed on the second encoded sequence output after the descriptive text is input into the second BERT model, thereby achieving the goal of specifically emphasizing specific information in the word sequence.
[0146] For example, Figure 7 The sequence of numbers at the top is the second coding sequence, where code 0 represents the position of the actual trigger word "approval" in the second coding sequence.
[0147] Step S1243: Input the processing sequence into the second Mid-Linear layer, execute the position sequence generation step, and output the argument start position sequence and the argument end position sequence.
[0148] Optionally, the step of generating a position sequence and outputting an argument start position sequence and an argument end position sequence comprises:
[0149] Determining a first logical value and a second logical value for each element position in the processing sequence by an activation function, wherein the activation function includes a Sigmoid function, the first logical value represents a probability that the corresponding element position is a starting position of an argument, and the second logical value represents a probability that the corresponding element position is an ending position of the argument;
[0150] An argument start position sequence is generated according to the first logic value of each element position, and an argument end position sequence is generated according to the second logic value of each element position.
[0151] Specifically, the specific process of generating the argument start position sequence and the argument end position sequence is similar to the process of generating the trigger word start position sequence and the trigger word end position sequence in the above text, and will not be repeated here.
[0152] Step S1244: input the argument start position sequence and the argument end position sequence into the second pointer marking network, execute the position determination step, and determine the argument start position and the argument end position.
[0153] Optionally, the step of determining the execution position to determine the argument start position and the argument end position includes:
[0154] The first logic value of each element position is compared with the first preset threshold value, and the starting position of the argument is determined according to the first comparison result; the second logic value of each element position is compared with the second preset threshold value, and the ending position of the argument is determined according to the second comparison result.
[0155] Specifically, the specific process of determining the starting position of the argument and the ending position of the argument is similar to the process of determining the starting position of the trigger word and the ending position of the trigger word in the above text, and will not be repeated here.
[0156] Step S1245 , executing a specific word extraction step, extracting the predicted argument from the word sequence according to the argument start position and the argument end position.
[0157] Optionally, the step of performing specific word extraction to extract the predicted argument from the word sequence according to the argument start position and the argument end position includes:
[0158] Based on a preset rule, extracting all predicted arguments from the word sequence according to the argument start position and the argument end position;
[0159] Determine the argument logical value of each of the predicted arguments according to the first logical value of the argument start position and the second logical value of the argument end position;
[0160] All the prediction arguments are screened according to the argument logical values, and the screened prediction arguments are output.
[0161] Specifically, the process of extracting arguments is similar to the process of extracting trigger words described above and will not be repeated here. Preset rules can be derived through statistical analysis of arguments in different events. This process is conventional and will not be described here. Since each trigger word corresponds to a set of arguments, the logical value of each predicted argument is determined and output as the predicted argument with the maximum logical value, which is the selected argument.
[0162] In this optional embodiment, the closer the predicted argument is to the actual trigger word, the more likely it is that the predicted argument is the actual argument corresponding to the actual trigger word. Therefore, combining the prior knowledge of the actual trigger word can improve the accuracy of argument extraction. Since there are a large number of default values for condition c in the argument, this method can be used to extract condition c, which can prevent the logical values of the main entity s and the object entity o corresponding to condition c from becoming sparse. Thanks to the use of trigger word position information rather than text information as trigger word information, even if there are two or more identical trigger words in a descriptive text, for example, the trigger word text information "handle" is the same in "handle X business" and "handle Y procedures", but the positions of the two are different, it is also possible to effectively distinguish trigger words of the same text information, thereby improving the accuracy of argument extraction.
[0163] Alternatively, as Figure 8 As shown, the second deep learning model includes a third Bert model, an encoding Concatenate layer, a third Mid-Linear layer and a third pointer annotation network, and the second training set includes a second data pair consisting of a plurality of corresponding description texts and feature words, and the feature words include any two actual event words and corresponding actual event relationship words.
[0164] The using the second training set to train the pre-established second deep learning model includes:
[0165] Step S131 : performing word segmentation processing on the description text based on characters to obtain a character sequence.
[0166] Specifically, the word segmentation process based on characters is the same as the process described above and will not be described in detail here.
[0167] Step S132: input the word sequence into the third Bert model, and encode each character in the word sequence using the third Bert model to obtain a third encoding sequence.
[0168] Specifically, the processing process of the third BERT model is similar to that of the first BERT model and the second BERT model mentioned above, and will not be repeated here.
[0169] Step S133: input the third coding sequence and the positions of any two actual event words in the third coding sequence into the coding concatenate layer, and output a feature sequence.
[0170] Specifically, the positions of any two actual event words may be pre-marked in the third coding sequence, and then the coding sequence after the marked positions is concatenated with the third coding sequence to stack the features.
[0171] For example, Figure 8 The top sequence is the third coding sequence, where "1" represents the position of the actual event word in the third coding sequence.
[0172] Step S134: input the feature sequence into the third Mid-Linear layer, execute the position sequence generation step, and output the event-related word start position sequence and the event-related word end position sequence.
[0173] Optionally, the step of executing the position sequence generation step to output the event relation word start position sequence and the event relation word end position sequence includes:
[0174] Determining a first logical value and a second logical value of each element position in the feature sequence by an activation function, wherein the activation function includes a Sigmoid function, the first logical value represents a probability that the corresponding element position is a starting position of an event-related word, and the second logical value represents a probability that the corresponding element position is an ending position of the event-related word;
[0175] An event-related word start position sequence is generated according to the first logic value of each element position, and an event-related word end position sequence is generated according to the second logic value of each element position.
[0176] Specifically, the specific process of executing the position sequence generating step is similar to the process of executing the position sequence generating step above, and will not be repeated here.
[0177] Step S135 , inputting the event relation word start position sequence and the event relation word end position sequence into the third pointer annotation network, executing a position determination step to determine the event relation word start position and the event relation word end position.
[0178] Optionally, the step of determining the execution position to determine the start position and the end position of the event-related word includes:
[0179] The first logic value of each element position is compared with the first preset threshold value, and the starting position of the event related word is determined according to the first comparison result; the second logic value of each element position is compared with the second preset threshold value, and the ending position of the event related word is determined according to the second comparison result.
[0180] Specifically, the specific process of executing the position determination step is similar to the process of executing the position determination step above, and will not be repeated here.
[0181] Step S136 , executing a specific word extraction step, extracting the predicted event-related word from the character sequence according to the event-related word start position and the event-related word end position.
[0182] Optionally, the step of performing specific word extraction to extract the predicted event-related word from the character sequence according to the start position and the end position of the event-related word includes:
[0183] Based on a preset rule, extracting all predicted event-related words from the character sequence according to the event-related word start position and the event-related word end position;
[0184] Determining the event-related word logical value of each of the predicted event-related words according to the first logical value of the event-related word start position and the second logical value of the event-related word end position;
[0185] All the predicted event-related words are screened according to the logical values of the event-related words, and the screened predicted event-related words are output.
[0186] Specifically, the specific process of performing the specific word extraction step is similar to the process of performing the specific word extraction step above, and will not be repeated here. The preset rules can be obtained by statistically analyzing the event-related words in different events. The processing process is prior art and will not be repeated here.
[0187] Step S137: Based on a preset third loss function, correct the parameters of the second deep learning model according to the predicted event relationship words and the corresponding actual event relationship words until the accuracy of the second deep learning model reaches a third preset range, thereby obtaining the event relationship extraction model.
[0188] Specifically, the third loss function can also adopt the BCELoss function, and the event relationship extraction model is the trained second deep learning model, and the model structure is the same.
[0189] Optionally, after marking the actual event relationship words between each two actual event words in each of the description texts, the method further includes:
[0190] Determine the relationship type of each of the marked actual event relationship words, and construct an event relationship word library based on the actual event relationship words and the corresponding relationship types, wherein the relationship types include sequential relationship, concurrent relationship and selection relationship.
[0191] Specifically, the specific descriptions of sequential relationships, concurrent relationships, and selection relationships are as described above. For example, the event relationship represented by event relationship words such as "and" and "at the same time" is a concurrent relationship.
[0192] Optionally, after extracting the predicted event-related word from the character sequence according to the event-related word start position and the event-related word end position, the method further includes:
[0193] The relationship type corresponding to the predicted event relationship word is determined in a preset event relationship word library.
[0194] In this optional embodiment, the service is usually displayed in the form of a flowchart, and the relationship type of the event relationship word is determined in the event relationship word library, that is, the relationship type between two event relationship words (events) is determined. For example, if the two events are in a sequential relationship, a selection relationship, or a concurrent relationship, a flowchart can be constructed based on the two event words and the corresponding relationship type, which is simple and efficient.
[0195] like Figure 9 As shown, another embodiment of the present invention provides a service process generation method, comprising:
[0196] Step S210, obtaining a target description text of a target service;
[0197] Step S220, inputting the target description text into an event extraction model, and outputting event words in the target description text;
[0198] Step S230, repeatedly performing the event relationship word extraction step multiple times to obtain event relationship words between every two event words, wherein the event relationship word extraction step includes marking the positions of any two event words in the target description text, inputting the marked target description text into the event relationship extraction model, and obtaining the event relationship words corresponding to the two event words;
[0199] Step S240, generating a service flow of the target service according to each corresponding two event words and the event relationship words;
[0200] The event extraction model and the event relationship extraction model are trained using the service process model training method described above.
[0201] In this embodiment, the target service to be processed can be manually described in text to obtain the target description text. The event extraction model obtained through training is used to extract the event words in the target description text, and then the positions of any two event words are marked in the target description text each time. The target description text with the marked positions is input into the event relationship extraction model to obtain the event relationship words corresponding to the two event words, and the above process is repeated many times. Finally, every two event words and the corresponding event relationship words are combined to generate the service flow of the target service. By performing data processing on an electronic device that stores an event extraction model and an event relationship extraction model, the service flow of the target service is generated, which avoids the influence of human subjective factors, has a high degree of standardization, improves the reliability of the generated service flow, reduces the workload of the staff, and improves the efficiency of formulation.
[0202] Optionally, the event words include trigger words and arguments, the event extraction model includes a trigger word extraction model and an argument extraction model, and inputting the target description text into the event extraction model and outputting the event words in the target description text includes:
[0203] Performing word segmentation processing on the target description text based on characters to obtain a character sequence;
[0204] Inputting the word sequence into the trigger word extraction model, and outputting the trigger words in the target description text;
[0205] The word sequence and the position of the trigger word in the word sequence are input into the argument extraction model, and the argument corresponding to the trigger word in the target description text is output.
[0206] In this optional embodiment, there is a certain semantic relationship between the trigger word and the argument. The trigger word is first extracted, and then the relevant information of the trigger word is used as prior knowledge to extract the argument, which can improve the accuracy of argument extraction.
[0207] Optionally, the service process of generating the target service according to each corresponding two event words and event relationship words includes:
[0208] The relationship types corresponding to the event relationship words are determined in a preset event relationship word library, and a flow chart of the target service is constructed according to every two event words and the corresponding relationship types.
[0209] In this optional embodiment, the relationship type of the event relationship words is determined in the event relationship word library, that is, it is determined whether the relationship between two event relationship words (events) is a sequential relationship, a selection relationship or a concurrent relationship. According to the relationship type, the data flow direction between the corresponding two event relationship words can be determined, and then a flowchart can be constructed. The flowchart can improve the intuitiveness of the target service.
[0210] Another embodiment of the present invention provides an electronic device, including a memory and a processor; the memory is used to store a computer program; the processor is used to implement the service process model training method or service process generation method as described above when executing the computer program.
[0211] Another embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the service process model training method or the service process generation method as described above is implemented.
[0212] An electronic device that can serve as a server or client of the present invention will now be described, which is an example of a hardware device that can be applied to various aspects of the present invention. Electronic devices are intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Electronic devices can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0213] An electronic device includes a computing unit that can perform various appropriate actions and processes based on a computer program stored in a read-only memory (ROM) or a computer program loaded from a storage unit into a random access memory (RAM). Various programs and data required for device operation can also be stored in the RAM. The computing unit, ROM, and RAM are connected to each other via a bus. An input / output (I / O) interface is also connected to the bus.
[0214] Computer systems may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The client and server relationship arises through computer programs running on the respective computers and having a client-server relationship to each other.
[0215] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM). In this application, the units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiments of the present invention. In addition, the functional units in the various embodiments of the present invention can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into a single unit. The above-mentioned integrated units can be implemented in the form of hardware or software functional units.
[0216] Although the present invention is disclosed as above, the scope of protection disclosed by the present invention is not limited thereto. Those skilled in the art may make various changes and modifications without departing from the spirit and scope of the present invention, and these changes and modifications will fall within the scope of protection of the present invention.
Claims
1. A service process model training method, characterized in that: The service process model includes an event extraction model and an event relationship extraction model. The methods include: Acquire a text dataset, wherein the text dataset includes description texts of multiple different service processes; The actual event words in each of the description texts are labeled to obtain a first training set; the first training set is used to train a pre-established first deep learning model to obtain the event extraction model, wherein the first deep learning model includes a trigger word extraction model and an argument extraction model, and the event extraction model includes a trained trigger word extraction model and a trained argument extraction model, and the first training set includes a plurality of first data pairs consisting of the corresponding description texts and the actual event words, wherein the actual event words include actual trigger words and actual arguments in the service process, and the actual arguments represent elements associated with events in the service process; The using the first training set to train the pre-established first deep learning model includes: Performing word segmentation processing on the description text based on characters to obtain a character sequence; Inputting the word sequence into the trigger word extraction model and outputting a predicted trigger word; Based on a preset first loss function, correcting the parameters of the trigger word extraction model according to the predicted trigger word and the corresponding actual trigger word until the accuracy of the trigger word extraction model reaches a first preset range, thereby obtaining the trained trigger word extraction model; Inputting the word sequence and the position of the actual trigger word in the word sequence into the argument extraction model, and outputting a predicted argument; Based on a preset second loss function, correcting the parameters of the argument extraction model according to the predicted argument and the corresponding actual argument until the accuracy of the argument extraction model reaches a second preset range, thereby obtaining the trained argument extraction model; The actual event relationship words between each two actual event words in each of the description texts are labeled to obtain a second training set; the second training set is used to train a pre-established second deep learning model to obtain the event relationship extraction model, the second deep learning model includes a third Bert model, an encoding concatenate layer, a third Mid-Linear layer, and a third pointer annotation network, the second training set includes a plurality of second data pairs consisting of corresponding description texts and feature words, the feature words including any two actual event words and corresponding actual event relationship words; The using the second training set to train the pre-established second deep learning model includes: Performing word segmentation processing on the description text based on characters to obtain a character sequence; Inputting the word sequence into the third Bert model, encoding each character in the word sequence using the third Bert model to obtain a third encoding sequence; Input the third coding sequence and the positions of any two actual event words in the third coding sequence into the coding concatenate layer, and output a feature sequence; Inputting the feature sequence into the third Mid-Linear layer, executing a position sequence generation step, and outputting an event-related word start position sequence and an event-related word end position sequence; Inputting the event relation word start position sequence and the event relation word end position sequence into the third pointer annotation network, executing a position determination step to determine the event relation word start position and the event relation word end position; executing a specific word extraction step to extract a predicted event-related word from the character sequence according to the event-related word start position and the event-related word end position; Based on a preset third loss function, the parameters of the second deep learning model are corrected according to the predicted event relationship words and the corresponding actual event relationship words until the accuracy of the second deep learning model reaches a third preset range, thereby obtaining the event relationship extraction model.
2. The service process model training method according to claim 1, characterized in that: The trigger word extraction model includes a first Bert model, a first Mid-Linear layer, and a first pointer annotation network. Inputting the word sequence into the trigger word extraction model and outputting the predicted trigger word includes: Inputting the word sequence into the first Bert model, encoding each character in the word sequence using the first Bert model, and outputting a first encoded sequence; Input the first coding sequence into the first Mid-Linear layer, execute the position sequence generation step, and output the trigger word start position sequence and the trigger word end position sequence; Inputting the trigger word start position sequence and the trigger word end position sequence into the first pointer annotation network, executing a position determination step to determine the trigger word start position and the trigger word end position; A specific word extraction step is performed to extract the predicted trigger word from the character sequence according to the trigger word start position and the trigger word end position.
3. The service process model training method according to claim 1, characterized in that: The argument extraction model includes a second Bert model, a Conditinal-Layer Norm layer, a second Mid-Linear layer, and a second pointer annotation network. The word sequence and the position of the actual trigger word in the word sequence are input into the argument extraction model, and outputting the predicted argument includes: Inputting the word sequence into the second Bert model, encoding each character in the word sequence using the second Bert model, and outputting a second encoded sequence; Input the second coded sequence and the position of the actual trigger word in the word sequence into the Conditinal-Layer Norm layer, and output a processed sequence; Input the processed sequence into the second Mid-Linear layer, execute the position sequence generation step, and output the argument start position sequence and the argument end position sequence; Inputting the argument start position sequence and the argument end position sequence into the second pointer marking network, executing a position determination step to determine the argument start position and the argument end position; A specific word extraction step is performed to extract the predicted argument from the word sequence according to the argument start position and the argument end position.
4. The service process model training method according to claim 1, characterized in that: After marking the actual event relationship words between each two actual event words in each of the description texts, the method further includes: Determining the relationship type of each of the marked actual event relationship words, and constructing an event relationship word library according to the actual event relationship words and the corresponding relationship types, wherein the relationship types include sequential relationship, concurrent relationship, and selection relationship; and / or, After extracting the predicted event-related word from the character sequence according to the event-related word start position and the event-related word end position, the method further includes: The relationship type corresponding to the predicted event relationship word is determined in a preset event relationship word library.
5. The service process model training method according to any one of claims 1 to 4, characterized in that: The execution position sequence generation step comprises: Determining a first logical value and a second logical value of each element position in a sequence to be processed by an activation function, wherein the activation function includes a Sigmoid function, the first logical value represents a probability that the corresponding element position is a starting position of a specific word, and the second logical value represents a probability that the corresponding element position is an ending position of the specific word; generating a specific word start position sequence according to the first logic value of each element position, and generating a specific word end position sequence according to the second logic value of each element position; Among them, the sequence to be processed includes a first coding sequence, a processing sequence and a feature sequence, the specific word starting position sequence includes a trigger word starting position sequence, an argument starting position sequence and an event relationship word starting position sequence, and the specific word ending position sequence includes a trigger word ending position sequence, an argument ending position sequence and an event relationship word ending position sequence.
6. The service process model training method according to claim 5, characterized in that: The execution position determination step comprises: Comparing the first logic value of each element position with a first preset threshold value, and determining the starting position of the specific word according to the first comparison result; comparing the second logic value of each element position with a second preset threshold value, and determining the ending position of the specific word according to the second comparison result; The specific word starting position includes the trigger word starting position, the argument starting position and the event-related word starting position, and the specific word ending position includes the trigger word ending position, the argument ending position and the event-related word ending position.
7. The service process model training method according to claim 6, characterized in that: The step of performing specific word extraction includes: Based on a preset rule, extracting all predicted specific words from the character sequence according to the specific word start position and the specific word end position; Determine a specific word logic value of each of the predicted specific words according to the first logic value of the specific word start position and the second logic value of the specific word end position; Filtering all the predicted specific words according to the specific word logical value, and outputting the filtered predicted specific words; The predicted specific words include predicted trigger words, predicted arguments and predicted event related words.
8. A service process generation method, characterized in that: include: Get the target description text of the target service; Inputting the target description text into an event extraction model, and outputting event words in the target description text; Repeating the event relationship word extraction step multiple times to obtain event relationship words between every two event words, wherein the event relationship word extraction step includes marking the positions of any two event words in the target description text, inputting the marked target description text into the event relationship extraction model, and extracting the event relationship words corresponding to the two event words; generating a service flow of the target service according to each corresponding two event words and the event relationship words; The event extraction model and the event relationship extraction model are trained using the service process model training method according to any one of claims 1 to 7.
9. The service process generation method according to claim 8, characterized in that: The event words include trigger words and arguments, the event extraction model includes a trigger word extraction model and an argument extraction model, and the step of inputting the target description text into the event extraction model and outputting the event words in the target description text includes: Performing word segmentation processing on the target description text based on characters to obtain a character sequence; Inputting the word sequence into the trigger word extraction model, and outputting the trigger words in the target description text; Inputting the word sequence and the position of the trigger word in the word sequence into the argument extraction model, and outputting the argument corresponding to the trigger word in the target description text; and / or, The service process of generating the target service according to each corresponding two event words and the event relationship words includes: The relationship types corresponding to the event relationship words are determined in a preset event relationship word library, and a flow chart of the target service is constructed according to every two event words and the corresponding relationship types.
Citation Information
Patent Citations
Event extraction method, device and system and storage medium
CN107562772A
Structured event extraction method and device based on generative network, , and processor
CN111339311A