CN114841162A - Text processing method, device, equipment and medium - Google Patents

Text processing method, device, equipment and medium Download PDF

Info

Publication number
CN114841162A
CN114841162A CN202210557278.3A CN202210557278A CN114841162A CN 114841162 A CN114841162 A CN 114841162A CN 202210557278 A CN202210557278 A CN 202210557278A CN 114841162 A CN114841162 A CN 114841162A
Authority
CN
China
Prior art keywords
text
word
processed
event
trigger
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210557278.3A
Other languages
Chinese (zh)
Other versions
CN114841162B (en
Inventor
张星星
黄畅然
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Telecom Corp Ltd
Original Assignee
China Telecom Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Telecom Corp Ltd filed Critical China Telecom Corp Ltd
Priority to CN202210557278.3A priority Critical patent/CN114841162B/en
Publication of CN114841162A publication Critical patent/CN114841162A/en
Application granted granted Critical
Publication of CN114841162B publication Critical patent/CN114841162B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/289Phrasal analysis, e.g. finite state techniques or chunking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/35Clustering; Classification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/048Activation functions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application provides a text processing method, a text processing device, text processing equipment and a text processing medium, and relates to the field of natural language processing. The method comprises the following steps: acquiring a text to be processed; determining text characteristic information of a text to be processed, wherein the text characteristic information comprises first characteristic information used for identifying trigger words; inputting the first characteristic information into a full-connection layer of a trigger word recognition model to obtain first probability values corresponding to a plurality of word combinations respectively, wherein each first probability value represents the probability that the corresponding word combination is an event trigger word, and the word combination is a word containing a preset trigger key word in a text to be processed; and determining the word combination corresponding to the maximum probability value in the first probability values respectively corresponding to the plurality of word combinations as the event trigger word of the text to be processed through the classification layer of the trigger word recognition model. According to the method and the device, the accuracy of event extraction can be improved.

Description

Text processing method, device, equipment and medium
Technical Field
The present application relates to the field of natural language processing, and in particular, to a text processing method, apparatus, device, and medium.
Background
Event extraction, which is one of the research directions in the field of natural language processing, can extract event information in a key or general place from a text to be processed, and has deep application in customer service, office, professional fields and the like.
In a related technology, event extraction may be performed by performing word segmentation on a text to be processed and then performing template matching on a word segmentation result, but the accuracy of the event extraction technology is low.
Therefore, a technical solution capable of improving the accuracy of event extraction is needed.
It is to be noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the present application and therefore may include information that does not constitute prior art known to a person of ordinary skill in the art.
Disclosure of Invention
The application provides a text processing method, a text processing device, text processing equipment and a text processing medium, which at least solve the problem of low accuracy of event extraction in the related technology to a certain extent.
Other features and advantages of the present application will be apparent from the following detailed description, or may be learned by practice of the application.
According to an aspect of the present application, there is provided a text processing method including:
acquiring a text to be processed;
determining text characteristic information of a text to be processed, wherein the text characteristic information comprises first characteristic information used for identifying trigger words;
inputting the first characteristic information into a full-connection layer of a trigger word recognition model to obtain first probability values corresponding to a plurality of word combinations, wherein each first probability value represents the probability that the corresponding word combination is an event trigger word, and the word combination is a word containing a preset trigger key word in a text to be processed;
and determining the event trigger words of the text to be processed based on the first probability values respectively corresponding to the word combinations through the classification layer of the trigger word recognition model.
In one embodiment of the application, the textual feature information further comprises second feature information for making an event type determination,
after determining the text feature information of the text to be processed, the method further comprises:
inputting second characteristic information into a full-connection layer of the event classification model to obtain second probability values corresponding to a plurality of preset event types respectively, wherein each second probability value represents the probability that the text to be processed belongs to the preset event type corresponding to each second probability value;
and determining the type of the event to which the text to be processed belongs based on the second probability values corresponding to the preset events by using the classification layer of the event classification model.
In one embodiment of the present application, determining text feature information of a text to be processed includes:
performing multilevel text segmentation on the processed text to obtain a multilevel text segmentation result;
and performing feature extraction on the multistage text segmentation result to obtain text feature information.
In one embodiment of the present application, determining text feature information of a text to be processed includes:
performing multilevel text segmentation on the processed text to obtain a multilevel text segmentation result;
performing feature extraction on each level of text segmentation result to obtain a feature extraction result corresponding to the level of text segmentation result;
and carrying out feature fusion on feature extraction results corresponding to the multi-level text segmentation results to obtain text feature information.
In an embodiment of the present application, performing feature extraction on each level of text segmentation result to obtain a feature extraction result corresponding to the level of text segmentation result, includes:
inputting the text segmentation result of each level into a feature extraction model to obtain a feature vector corresponding to the text segmentation result of the level;
generating a text normal vector of the level of text based on adjacent words of the central word of the text to be processed;
and generating a feature extraction result corresponding to the text segmentation result on the basis of the feature vector and the text normal vector.
In an embodiment of the present application, performing feature fusion on feature extraction results corresponding to respective multi-level text segmentation results to obtain text feature information, including:
and inputting the feature extraction results corresponding to the multi-stage text segmentation results into a preset feature fusion model to obtain text feature information.
In an embodiment of the application, after determining the event trigger word of the text to be processed based on the first probability value corresponding to each of the plurality of word combinations, the method further includes:
and correspondingly adding the event trigger words and the text to be processed to the trigger word sample set to obtain a new trigger word sample set so as to optimize the trigger word recognition model by utilizing the new trigger word sample set.
In an embodiment of the application, after determining, based on second probability values corresponding to a plurality of preset events, an event type to which a text to be processed belongs, the method further includes:
and correspondingly adding the event type of the text to be processed and the text to be processed to the event classification sample set to obtain a new event classification sample set so as to optimize the event classification model by utilizing the new event classification sample set.
According to another aspect of the present application, there is provided a text processing apparatus including:
and the acquisition module is used for acquiring the text to be processed.
The information determining module is used for determining text characteristic information of the text to be processed, and the text characteristic information comprises first characteristic information used for identifying the trigger words.
And the first calculation module is used for inputting the first characteristic information into the full-connection layer of the trigger word recognition model to obtain first probability values corresponding to a plurality of word combinations respectively, wherein each first probability value represents the probability that the corresponding word combination is the event trigger word, and the word combination is a word containing a preset trigger key word in the text to be processed.
And the trigger word determining module is used for determining the event trigger words of the text to be processed based on the first probability values respectively corresponding to the word combinations through the classification layer of the trigger word recognition model.
According to yet another aspect of the present application, there is provided an electronic device including: a processor; and a memory for storing executable instructions for the processor; wherein the processor is configured to perform the text processing method described above via execution of the executable instructions.
According to yet another aspect of the present application, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the text processing method described above.
According to the text processing method, the text processing device, the text processing equipment and the text processing medium, after the text characteristic information of the text to be processed is obtained, the first probability values of a plurality of word combinations including preset trigger key words can be obtained through calculation by using the full connection layer of the trigger word recognition model, and the word combination corresponding to the maximum first probability value is determined as the event trigger word of the text to be processed. In the embodiment of the application, because the event trigger words often include the preset trigger key words, through the trigger word recognition model, the appropriate word combination of the event trigger words can be selected from the word combinations which have a certain probability of becoming the event trigger words as the event trigger words, so that the recognition accuracy of the event trigger words is improved, and the accuracy of event extraction is further improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application. It is obvious that the drawings in the following description are only some embodiments of the application, and that for a person skilled in the art, other drawings can be derived from them without inventive effort.
Fig. 1 is a schematic diagram illustrating a text processing scenario provided in an embodiment of the present application;
FIG. 2 is a flow chart of a text processing method in an embodiment of the present application;
FIG. 3 is a schematic diagram illustrating a feature extraction manner provided by an embodiment of the present application;
FIG. 4 is a schematic diagram illustrating processing logic of a fully connected layer of a trigger recognition model according to an embodiment of the present application;
FIG. 5 is a flow chart illustrating another text processing method provided by an embodiment of the present application;
FIG. 6 is a schematic diagram illustrating text processing logic provided by embodiments of the present application;
FIG. 7 is a schematic diagram of a text processing apparatus in an embodiment of the present application; and
fig. 8 shows a block diagram of an electronic device in an embodiment of the present application.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
Furthermore, the drawings are merely schematic illustrations of the present application and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus their repetitive description will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
It should be understood that the various steps recited in the method embodiments of the present application may be performed in a different order and/or in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present application is not limited in this respect.
It should be noted that the terms "first", "second", and the like in the present application are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this application are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that reference to "one or more" unless the context clearly dictates otherwise.
Event extraction, namely a language processing method for extracting events in which a user is interested from unstructured information and presenting the events to the user in a structured manner. The method can identify specific types of events from the text, so that the main points and the subjects of the text to be processed are mined and extracted.
In a related technique, a word is segmented for an input text, and then event extraction is performed in a mode of performing template matching on a segmentation result.
However, the method has poor flexibility, and often causes missing identification, which affects the event extraction precision.
Therefore, a technical solution capable of improving the event extraction accuracy is required.
The inventor finds that, in the event extraction process, trigger words often need to be recognized first, and accordingly the recognition accuracy of the trigger words often affects the accuracy of event classification, so how to improve the recognition accuracy of the trigger words becomes a problem to be solved urgently.
However, in the process of extracting an actual event, the vocabulary boundary of a language such as chinese is fuzzy, and when a word segmentation is wrong or misjudged, the recognition accuracy of a subsequent trigger word is often affected.
Based on this, the embodiment of the present application provides a text processing scheme, which can select, as an event trigger word, a word combination that is most likely to be the event trigger word from word combinations that have a certain probability of becoming the event trigger word through a trigger word recognition model, so that the recognition accuracy of the event trigger word is improved, and further, the accuracy of event extraction is improved.
Before beginning to introduce embodiments of the present application, the technical terms involved will be described.
Event extraction: it is referred to that events of interest to the user are extracted from the text describing the event information and presented in a structured form.
Event: the description in natural language of a specific event that occurs objectively is usually a sentence or a sentence cluster. The event may be composed of event information such as an event trigger, an event type, and the like.
Event trigger words: refers to a word in an event that can represent the occurrence of the event, and may be a verb or a noun.
After the above concepts are introduced, a text processing scenario designed by the embodiment of the present application is explained next.
Fig. 1 shows a schematic diagram of a text processing scenario provided in an embodiment of the present application. As shown in fig. 1, the user 10 may input the text to be processed into the text processing apparatus 20, and after determining text feature information of the text to be processed, the text processing apparatus 20 may calculate, through a full connection layer of the trigger word recognition model, a first probability value of each of a plurality of word combinations including a preset trigger key word, and then select, through a classification layer, a word combination corresponding to a maximum first probability value as an event trigger word. Output information 30 including the event trigger word is then output. Illustratively, if the text to be processed is "school leadership meeting the parents of the student". ", the event trigger" meet up "may be included in the output information 30.
In some embodiments, after determining the text feature information of the text to be processed, the text processing apparatus 20 may further determine, through the full connection layer of the event classification model, probability values that the text to be processed belongs to the respective preset event types, and then determine the event types of the text to be processed based on the probability values. Output information 30 including the event type is then output. Continuing with the previous example, the event type "meeting event" may be included in the output information 30.
After the scenes of the embodiments of the present application are introduced, the text processing method, the text processing apparatus, the text processing device, and the text processing medium of the embodiments of the present application are described in sequence.
The embodiment of the present application provides a text processing method, which may be executed by any electronic device with text processing capability, such as a computer, a palm computer, or other terminal devices, or a server and other background devices, which is not limited specifically.
Fig. 2 shows a flowchart of a text processing method in the embodiment of the present application, and as shown in fig. 2, the text processing method provided in the embodiment of the present application includes the following steps S210 to S240.
And S210, acquiring a text to be processed.
For the text to be processed, it may be the text that needs event extraction. For example, it may be a text containing event information.
Illustratively, it may be language text such as chinese text. It should be noted that the text to be processed in the embodiment of the present application may also be in other languages, which are not particularly limited.
The acquisition mode of the text to be processed may be input by the user in real time, or acquired from a document, and is not limited.
And S120, determining text characteristic information of the text to be processed.
As for the text feature information, it may be information having an event feature that can be extracted from the text to be processed. The text feature information may include first feature information used for performing trigger word recognition. In some embodiments, to improve the accuracy of the determination of the event type, the text feature information may further include second feature information for making the event type determination. It should be noted that the first characteristic information and the second characteristic information may be the same or different, and are not described in detail herein.
The text feature information will be explained next with reference to S120.
In some embodiments, the text feature information may be information obtained by feature extraction of a text segmentation result of the text to be processed.
Accordingly, S120 may include step a11 and step a12 described below.
And step A11, performing multilevel text segmentation processing on the text to be processed to obtain a multilevel text segmentation result.
For the multi-level text segmentation process, it may be to segment the text to be processed into a plurality of text units of different lengths from a plurality of dimensions, i.e., a multi-level text segmentation result.
In one example, to improve event extraction accuracy, the multi-level text segmentation process may include word segmentation and word segmentation. Accordingly, the multi-level text segmentation result may include a word segmentation result and a word segmentation result.
By word segmentation and word segmentation, the text characteristic information determined according to the word segmentation result and the word segmentation result can be effectively combined with the characteristics of words, so that the influence of fuzzy Chinese vocabulary boundaries on event trigger words or event types and other event extraction is avoided, even under the condition that misjudgment is caused by Chinese word segmentation boundaries, the event trigger words can be accurately extracted or event classification can be realized, and the event extraction precision is improved.
In another example, in order to further improve the event extraction accuracy, in the case where the text to be processed includes a plurality of sentences, the multistage text segmentation process may include sentence segmentation, word segmentation, and word segmentation.
Illustratively, the text sentence to be processed may be divided into a plurality of sentences. And then, performing word segmentation and word segmentation on each sentence to obtain a word segmentation result and a word segmentation result of each sentence. And then, performing operations such as event trigger word extraction, event type determination and the like on each sentence.
After the multi-stage text segmentation process is described, step a11 will be described in detail.
In one embodiment, the language model may be utilized to perform multi-level text segmentation on the text to be processed. For example, in the case where the text to be processed is a chinese text, the language model may be a jieba chinese language model.
In one example, in order to improve the text segmentation precision, a jieba word segmentation model is utilized, a text can be firstly segmented to obtain a segmentation result, then a syntax tree structure is constructed according to the segmentation structure, and then word segmentation and word segmentation are further performed by utilizing the syntax tree structure to obtain a segmentation result.
Illustratively, the parent of the student continues to be met with the text to be processed as "school leadership". For example, the word segmentation result may be: school/leader/meet/student/parent. The word segmentation result may be: study/school/lead/meet/see/study/student/family/long/. The word segmentation result may be further performed on the basis of the word segmentation result, or may be performed on the sentence segmentation result, which is not particularly limited.
It should be noted that other chinese language models such as SnowNLP, pkuserg, THULAC, HanLP, etc. may be used, and the language models are not particularly limited.
It should also be noted that, in the embodiment of the present application, text segmentation may also be performed in other manners, for example, text recognition, which is not limited in this respect.
And step A12, performing feature extraction on the multi-level text segmentation result to obtain text feature information.
For feature extraction, in an embodiment, text extraction may be performed by using a DMCNN (Dynamic Multi-pond Convolutional Neural Network), an RNN (Recurrent Neural Network), One-Hot (unique Hot) code, a TF-IDF (Term Frequency-Inverse Document Frequency), and the like, and an extraction result is used as text feature information, and a feature extraction method is not particularly limited.
In one example, taking the DMCNN model as an example, the synthesized feature may be obtained through convolution processing, nonlinear transformation, and pooling processing, and then the synthesized feature is taken as the first feature information.
Illustratively, the non-linear change can be performed by using a tanh activation function after the convolution is calculated for the text input layer to be processed. And pooling the convolution result after the nonlinear transformation into two parts, and splicing the pooled results of the two parts to obtain the synthetic characteristic.
In one embodiment, step a12 may specifically include steps a121 through a 123.
Step A121, inputting the text segmentation result of each level into a feature extraction model to obtain a feature vector corresponding to the text segmentation result of the level. For example, the word segmentation result may be input into the feature extraction model to obtain a word synthesis vector (a feature vector corresponding to the word segmentation result). And inputting the word segmentation result into the feature extraction model to obtain a word synthesis vector (a feature vector corresponding to the word segmentation result).
For the feature extraction model, the above contents of the embodiments of the present application may be referred to, and details are not described herein.
Taking an example that the feature extraction model may be a DMCNN model, fig. 3 shows a schematic diagram of a feature extraction manner provided in the embodiment of the present application. As shown in fig. 3, the parent of the student is met with the text to be processed as "school leader". For example, for each word segmentation, a word vector of the word segmentation and a position of each word segmentation in the text to be processed may be used to generate a vector corresponding to the word segmentation. The position of each word segmentation result in the text to be processed may be a distance between the word segmentation result and the central word. The core word may be determined according to the part of speech of the word segmentation result, for example, the core word may be a verb in the text to be processed, or the core word may be a preset word or a preset word in a preset character library. It should be noted that the preset character library may be a specific character library for the preset event type. The words in the preset character library may be determined according to the actual scene and the specific event type, which is not limited in this respect. Illustratively, if "meet" is the central word, "school" is the two words before "meet," and accordingly, "meet" corresponds to a location of "-2".
With continued reference to fig. 3, after convolution feature mapping and nonlinear transformation are performed on the vectors corresponding to the multiple participles, the convolution result after nonlinear transformation is pooled into two parts, namely max (c) 11 ) And max (c) 12 ) Then pooling the two parts resulting max (c) 11 ) And max (c) 12 ) And splicing to obtain word synthesis characteristics.
And, word synthesis features may be obtained based on inputting the word segmentation results into the DMCNN model. The specific generation manner of the word synthesis features is similar to the word feature vector, and is not described herein again.
Step A122, generating a text normal vector of the level text based on the adjacent words of the central word of the text to be processed.
Illustratively, if the multilevel text includes a word segmentation result and a word segmentation result, the text normal vector may include a lexical vector and a lexical vector. The lexical vector is used for representing the part-of-speech characteristics of the word segmentation result of the text to be processed. The word method vector is used for representing the character characteristics of the word segmentation result of the text to be processed.
For the above description, the following paragraphs and drawings are included for the purpose of illustrating the present invention.
Illustratively, continuing with the previous example, the neighboring words of "meet" may include "leader" and "met", and the word vector of "meet" and the word vector of "leader" and the word vector of "met" may be concatenated to obtain a lexical vector.
It should be noted that the text normal vector may also be generated in other ways according to the adjacent words and the adjacent words, which is not limited in particular.
Step A123, generating a feature extraction result corresponding to the text segmentation result based on the synthesized feature vector and the text normal vector.
In one example, the synthesis vector and the text normal vector corresponding to each level of text segmentation result may be spliced to obtain a feature extraction result corresponding to the level of text segmentation result.
Illustratively, with continued reference to fig. 3, the word synthesis features and the word normal vectors may be concatenated to obtain a token-level feature vector f word Namely, the feature extraction result corresponding to the word segmentation result.
As another example, the word synthesis feature and the word normal vector may be concatenated to obtain the word-level feature vector f char Namely, the feature extraction result corresponding to the word segmentation result.
It should be noted that, by using the DMCNN model, the feature dimension of the text feature can be increased, so that the text feature of the text to be processed can be fully expressed, and the accuracy of event extraction, such as event trigger word and event type determination, can be improved.
And it should be further noted that, in the case that the text feature information includes the first feature information and the second feature information, the first feature information and the second feature information may be extracted by using 2 feature extraction models. Or outputting two results respectively as the first characteristic information and the second characteristic information by using the same characteristic extraction model. This is not particularly limited.
Through the step A11 and the step A12, the text characteristic information can be effectively combined with the characteristics of the multi-level text segmentation result in a multi-level text segmentation mode, so that the influence of fuzzy vocabulary boundaries on event trigger words or event types and other event extraction is avoided, even if misjudgment is caused by word segmentation boundaries, the event trigger words can be accurately extracted or event classification can be realized, and the event extraction precision is improved.
In other embodiments, S120 may include step a21 and step a 22.
And step A21, performing primary text segmentation on the text to be processed to obtain a text segmentation result.
For example, only word segmentation or word segmentation may be performed on the text to be processed, and specific contents thereof may refer to the relevant description of the above-mentioned portion in the embodiment of the present application, which is not described again.
And step A22, performing feature extraction on the text segmentation result to obtain text feature information.
It should be noted that, specific contents of step a22 may be referred to in the description of the above-mentioned part of the embodiment of the present application, and are not described herein again.
In still other embodiments, the text feature information may be information obtained by feature extraction of the text to be processed.
Accordingly, S120 may include step a 31.
And A31, extracting the features of the text to be processed to obtain text feature information.
It should be noted that, specific contents of step a31 may be referred to in the description of the above-mentioned part of the embodiment of the present application, and are not described herein again.
In still other embodiments, S120 may include steps a41 through a 43.
And step A41, performing multilevel text segmentation on the processed text to obtain a multilevel text segmentation result.
It should be noted that step a41 is similar to step a11, and reference may be made to the related description of step a11, which is not described herein again.
And A42, performing feature extraction on each level of text segmentation result to obtain a feature extraction result corresponding to the level of text segmentation result.
It should be noted that step a42 is similar to step a12, and reference may be made to the related description of step a12, which is not described herein again.
In one embodiment, step a42 may include steps a421 through a 423.
Step A421, inputting the text segmentation result of each level into the feature extraction model to obtain the feature vector corresponding to the text segmentation result of the level.
Step a421 is similar to step a121, and reference may be made to the relevant description of step a121, which is not repeated herein.
Step A422, based on the adjacent words of the central word of the text to be processed, generating the text normal vector of the text at the level.
Step a422 is similar to step a122, and reference may be made to the relevant description of step a122, which is not repeated herein.
Step A423, based on the feature vector and the text normal vector, generating a feature extraction result corresponding to the text segmentation result.
Step a423 is similar to step a123, and reference may be made to the relevant description of step a123, which is not repeated herein.
And step A43, performing feature fusion on the feature extraction results corresponding to the multi-level text segmentation results to obtain text feature information.
In step a43, feature fusion may be performed by using a feature fusion model or a feature fusion algorithm, and the specific feature fusion method is not limited. For example, a multitask feature fusion model may be used.
In one embodiment, step a43 includes: and inputting the feature extraction results corresponding to the multi-stage text segmentation results into a preset feature fusion model to obtain text feature information.
For example, in a case where the text feature information includes first feature information and second feature information, the preset feature fusion model may be a multitask feature fusion model.
For example, the multitask feature fusion model corresponds to the following equations (1) to (4):
z N =s(W N f′ char +U N f′ word +b N ) (1)
z T =s(W T f′ char +U T f′ word +b T ) (2)
f N =z N f′ char +(1-z N )f′ word (3)
f T =z T f′ char +(1-z T )f′ word (4)
wherein s () represents sigmoid function, W N 、U N 、b N 、W T 、U T Model weight parameters for a predetermined feature fusion model, b T And fusing the bias parameters of the model for the preset features. The determination can be performed by means of learning, such as a back propagation learning method.
As can be seen from the above equations (1) to (4), the token-level feature vector f can be expressed word And the word level feature vector f char Mapping to the same dimension, wherein the characteristic vector f of the morpheme level word Is mapped to f' word Word-level feature vector f char Is mapped to f' char . Then map vector f' word And f' char After the multitask feature fusion model is input, the first feature information f in the form of a vector can be calculated through the formula N Second feature information f in the form of a sum vector T . It should be noted that feature mapping with the same dimension may not be performed, and is not limited thereto.
And through the multitask feature fusion model, gradient reduction, weighting in different degrees and the like are carried out on the word element level feature vector and the word element level feature vector when the event trigger word is recognized, so that the calculated vector can highlight the features and the expression of the trigger word, the calculated first feature information is more suitable for the trigger word recognition, and the accuracy of event extraction is further improved. The effect of the second feature information is similar to that of the first feature information, and the multitask feature fusion model can make the second feature information more suitable for determining the event type, so that the accuracy of event extraction is improved.
It should be noted that other preset feature fusion models may also be adopted to extract the first feature information and the second feature information respectively. And other ways can be adopted to extract the text feature information, for example, the feature extraction results corresponding to the multi-level text segmentation results can be input into a preset feature fusion model to obtain the text feature information, and the specific extraction way of the text feature information is not limited.
Through the steps A41 to A43, the text to be processed can be fully expressed in a feature fusion mode, so that the text processing method provided by the embodiment of the application can be suitable for more texts, and the applicability of the method is improved.
And S230, inputting the first characteristic information into a full connection layer of the trigger word recognition model to obtain first probability values corresponding to the word combinations. Each first probability value represents the probability that the corresponding word combination is the event trigger word.
For the word combination, it may be a word or a word containing a preset trigger key word in the text to be processed. Accordingly, the word combination may be any continuous character string containing a preset key word. In some embodiments, the preset trigger key word may be a preset word or a preset word in a preset character library. It should be noted that the preset character library may be a specific character library for the preset event type. The words in the preset character library may be determined according to the actual scene and the specific event type, which is not limited in this respect. In other embodiments, the preset trigger key word may be a core word in the text to be processed, such as a verb, or a word located at the center of the text, which is not limited in particular.
In some embodiments, to reduce the amount of computation, the length of the word combination is less than or equal to a preset length threshold. For example, the length of the word combination is 3.
Exemplarily, fig. 4 shows a processing logic diagram of a fully connected layer of a trigger word recognition model provided in an embodiment of the present application. As shown in fig. 4, if the preset trigger keyword of the text to be processed is "see", the word combination may include: "guide to meet", "see study", etc.
After the word combinations are introduced, S230 is explained next.
In some embodiments, after the full-connection layer obtains the text feature information, a plurality of word combinations, and information such as offset, length, and the like of the word combinations can be determined. And calculating according to the word combination, the offset of the word combination, the length and other information to obtain a first probability value. The offset may be a distance between the first word of the word combination and a preset trigger key word.
Continuing with fig. 4 as an example, the offset between the first word "lead" of the word combination "lead to see" and the preset trigger key word "see" is 3, the length value of the word combination is 3, and the first probability value "0.01" of the "lead to see" can be obtained through calculation by the full-connection layer 40.
S240, determining the event trigger words of the text to be processed based on the first probability values corresponding to the word combinations through the classification layer of the trigger word recognition model.
Wherein the classification layer may be a calculation layer for performing classification. Illustratively, the taxonomy layer may be a softmax layer. The classification layer may be other layers capable of performing classification, and is not limited thereto.
In some embodiments, the word combination corresponding to the maximum value in the plurality of first probability values may be determined as the event trigger word of the text to be processed. Continuing with the example of FIG. 4, among the first probability values for multiple word combinations, the "hit" first probability value for that word combination of "0.75" is greatest. Accordingly, "meet" may be determined as an event trigger for the text to be processed.
In some embodiments, in order to improve the recognition accuracy of the event trigger word, at least one word combination having a first probability value greater than a reference probability value may be selected from the plurality of word combinations, and then the event trigger word may be selected from the at least one word combination.
Optionally, if the first probability values of the word combinations are all smaller than the reference probability value, determining that the text to be processed has no event trigger word.
For example, the reference probability value may be a probability value in the case where the preset trigger keyword word does not exist for the full-connected layer pair. With continued reference to fig. 4, the "NIL" indicates that the preset trigger key word does not exist in the text to be processed, and the first probability value corresponding to the "NIL" indicates that the probability that the preset trigger key word does not exist in the text to be processed.
In some embodiments, if the text to be processed includes a plurality of sentences, each sentence may be input into the full link layer, resulting in a plurality of first probability values for the sentence. And then selecting a word combination corresponding to the maximum probability value from the first probability values of the sentences as an event trigger word of the text to be processed.
According to the text processing method provided by the embodiment of the application, after the text characteristic information of the text to be processed is obtained, the first probability values of a plurality of word combinations including preset trigger key words can be obtained through calculation by using the full connection layer of the trigger word recognition model, and the word combination corresponding to the maximum first probability value is determined as the event trigger word of the text to be processed. In the embodiment of the application, because the event trigger words often include the preset trigger key words, through the trigger word recognition model, the appropriate word combination of the event trigger words can be selected from the word combinations which have a certain probability of becoming the event trigger words as the event trigger words, so that the recognition accuracy of the event trigger words is improved, and the accuracy of event extraction is further improved.
In some embodiments, after S240, the text processing method further includes step B1.
And step B1, correspondingly adding the event trigger words and the texts to be processed to the trigger word sample set to obtain a new trigger word sample set, so as to optimize the trigger word recognition model by using the new trigger word sample set.
In one embodiment, if the text to be processed includes a plurality of sentences, the event trigger words and the clauses to which the event trigger words belong may be correspondingly added to the trigger word sample set to form a new trigger word sample set.
Wherein a new trigger word sample set S G Satisfies formula (5):
Figure BDA0003655408900000141
wherein, T G Indicating addition of event trigger words
Figure BDA0003655408900000142
Previous trigger word sample sets. x is the number of k Indicating the inclusion of event triggers
Figure BDA0003655408900000143
The sentence (1).
Fig. 5 is a schematic flowchart illustrating another text processing method according to an embodiment of the present application. The embodiments of the present application are optimized based on the embodiments described above, and the embodiments of the present application may be combined with various alternatives in one or more of the embodiments described above.
And S510, acquiring a text to be processed.
S510 is similar to S210, and reference may be made to specific contents of S210, which is not described herein again.
S520, determining text characteristic information of the text to be processed, wherein the text characteristic information comprises first characteristic information and second characteristic information used for identifying the trigger words.
S520 is similar to S220, and reference may be made to the specific content of S220, which is not described herein again.
S530, inputting the first characteristic information into a full connection layer of the trigger word recognition model to obtain first probability values corresponding to the plurality of word combinations. Each first probability value represents the probability that the corresponding word combination is the event trigger word, and the word combination is the word containing the preset trigger key word in the text to be processed.
S530 is similar to S230, and reference may be made to the specific content of S230, which is not described herein again.
And S540, determining the event trigger words of the text to be processed based on the first probability values respectively corresponding to the word combinations through the classification layer of the trigger word recognition model.
S540 is similar to S240, and reference may be made to the specific content of S240, which is not described herein again.
And S550, inputting the second characteristic information into a full connection layer of the event classification model to obtain second probability values corresponding to the preset event types. And each second probability value represents the probability that the text to be processed belongs to the preset event type corresponding to each second probability value.
It should be noted that the fully-connected layer of the event classification model and the fully-connected layer of the trigger recognition model have similar functions. Reference may be made to the related description of the above-mentioned part of the embodiment of the present application for the fully connected layer of the trigger recognition model, which is not described herein again.
In one embodiment, if the text to be processed includes a plurality of sentences, each sentence corresponds to one of the first characteristic information and the second characteristic information. If an event trigger is recognized from a sentence according to steps S530 and S540, the second feature information of the sentence may be input into the full link layer of the event classification model for calculation.
In one example, if the preset event type includes event type a and event type B. Then, after inputting the second feature information into the full link layer of the event classification model, a second probability value of the event type a and a second probability value of the event type B can be obtained.
And S560, determining the event type of the text to be processed based on the second probability values corresponding to the preset events by using the classification layer of the event classification model.
In some embodiments, the classification layer of the event classification model is similar in function to the classification layer of the trigger word recognition model. Reference may be made to the relevant description of the classification layer of the trigger recognition model in the above section of the embodiment of the present application, which is not described herein again.
According to the text processing method provided by the embodiment of the application, after the text characteristic information of the text to be processed is obtained, the first probability values of a plurality of word combinations including preset trigger key words can be obtained through calculation by using the full connection layer of the trigger word recognition model, and the word combination corresponding to the maximum first probability value is determined as the event trigger word of the text to be processed. In the embodiment of the application, because the event trigger words often include the preset trigger key words, through the trigger word recognition model, the appropriate word combination of the event trigger words can be selected from the word combinations which have a certain probability of becoming the event trigger words as the event trigger words, so that the recognition accuracy of the event trigger words is improved, and the accuracy of event extraction is further improved. And through the event classification model, a proper event type word combination can be selected from the preset event types with a certain probability of becoming the event types to serve as the event trigger words, so that the identification accuracy of the event types is improved, and the event extraction accuracy is further improved.
It should be noted that, in this embodiment, when multiple event types correspond to the same event trigger, for example, when event type refinement causes multiple refined event types to correspond to the same event trigger, for example, "meeting" keywords correspond to event types "formal meeting" and "informal meeting", and the like, the event types can be accurately identified.
In some embodiments, after S560, the text processing method further includes step C1.
And step C1, correspondingly adding the event type of the text to be processed and the text to be processed to the event classification sample set to obtain a new event classification sample set, so as to optimize the event classification model by using the new event classification sample set.
In one embodiment, if the text to be processed includes a plurality of sentences, the event type and the clause to which the event type belongs may be correspondingly added to the event classification sample set to form a new event classification sample set.
Wherein a new trigger word sample set S C Satisfies formula (6):
Figure BDA0003655408900000161
wherein, T C Representing an Add event
Figure BDA0003655408900000162
Previous trigger word sample sets. x is the number of k Indicating the inclusion of events
Figure BDA0003655408900000163
The sentence (1).
In one example, a loss function, S, may be utilized C And S G And (5) carrying out model training.
Illustratively, the loss function satisfies equation (7):
Figure BDA0003655408900000164
where θ is used in a gradient descent method, it will be optimized with the optimization of the loss function L (θ), the final value of which represents the best state of the model.
By the method, the event trigger word sample set and the event classification sample set can be subjected to relevance learning based on the clauses which simultaneously contain the trigger words and the corresponding event classifications, so that the trigger word identification and the classification are in a mutually-promoted relationship.
In order to facilitate understanding of the text processing method provided in the embodiment of the present application, a text processing logic of the embodiment of the present application is described below by using an example. Illustratively, fig. 6 shows a schematic diagram of a text processing logic provided in an embodiment of the present application.
As shown in FIG. 6, the text processing method of the embodiment of the present application may include the following steps D1-D7.
Step D1, the text to be processed may be obtained.
And D2, carrying out sentence segmentation on the text to be processed by using the jieba word segmentation model to obtain a plurality of sentences. And performing word segmentation and word segmentation processing on each sentence to obtain a word segmentation result of the sentence and a word segmentation result of the sentence.
It should be noted that since the subsequent processing of each sentence is the same, the following description will be continued with one sentence.
And D3, inputting the word segmentation result and the word segmentation result of the clause to be processed into the DMCNN model to obtain a word synthesis characteristic vector and a word synthesis characteristic vector.
Step D4, splicing the word synthesis characteristic vector and the lexical vector to obtain a lemma-level characteristic vector f word . And splicing the word synthesis characteristic vector and the word method vector to obtain a character element level characteristic vector f char
Step D5, converting the token-level feature vector f word And the character level feature vector f char Dimension unification is carried out to obtain the token-level feature vector f 'after dimension unification' word And dimension-unified character-level feature vector f' char . The token-level feature vectors f 'with unified dimensionality' word And dimension-unified character-level feature vector f' char Inputting a multi-task feature fusion model to obtain first feature information f in a vector form N Second feature information f in the form of a sum vector T
Step D6, the first characteristic information f in the form of vector is processed N And inputting a trigger word recognition model 61, and obtaining an event trigger word after calculation of the full connection layer and the softmax layer.
Step D7, second feature information f in the form of vector is processed T And inputting the event classification model 62, and obtaining the event type after calculation of the full connection layer and the softmax layer.
Based on the same inventive concept, the embodiment of the present application further provides a text processing apparatus, such as the following embodiments. Because the principle of the embodiment of the apparatus for solving the problem is similar to that of the embodiment of the method, the embodiment of the apparatus can be implemented by referring to the implementation of the embodiment of the method, and repeated details are not described again.
Fig. 7 is a schematic diagram of a text processing apparatus in an embodiment of the present application, and as shown in fig. 7, the text processing apparatus 700 includes an obtaining module 710, an information determining module 720, a first calculating module 730, and a trigger determining module 740.
The obtaining module 710 is configured to obtain a text to be processed.
The information determining module 720 is configured to determine text feature information of the text to be processed, where the text feature information includes first feature information used for performing trigger word recognition.
The first calculating module 730 is configured to input the first feature information into the full-link layer of the trigger word recognition model, and obtain first probability values corresponding to the plurality of word combinations, where each first probability value represents a probability that the corresponding word combination is the event trigger word, and the word combination is a word containing a preset trigger keyword in the text to be processed.
The trigger word determining module 740 is configured to determine, through the classification layer of the trigger word recognition model, an event trigger word of the text to be processed based on the first probability values corresponding to the plurality of word combinations.
After the text feature information of the text to be processed is obtained, the text processing device provided in the embodiment of the application may calculate, by using the full connection layer of the trigger word recognition model, first probability values of a plurality of word combinations including preset trigger key words, and determine a word combination corresponding to a maximum first probability value as an event trigger word of the text to be processed. In the embodiment of the application, because the event trigger words often include the preset trigger key words, through the trigger word recognition model, the appropriate word combination of the event trigger words can be selected from the word combinations which have a certain probability of becoming the event trigger words as the event trigger words, so that the recognition accuracy of the event trigger words is improved, and the accuracy of event extraction is further improved.
In one embodiment of the application, the textual feature information further comprises second feature information for making an event type determination,
the text processing apparatus 700 further includes a second calculation module and an event type determination module.
The second calculation module is used for inputting second characteristic information into the full-connection layer of the event classification model to obtain second probability values corresponding to a plurality of preset event types respectively, wherein each second probability value represents the probability that the text to be processed belongs to the preset event type corresponding to each second probability value;
and the event type determining module is used for determining the event type of the text to be processed based on the second probability values corresponding to the preset events by using the classification layer of the event classification model.
In one embodiment of the present application, the information determining module 720 includes: a text segmentation unit and a feature extraction unit.
The text segmentation unit is used for performing multilevel text segmentation on the processed text to obtain a multilevel text segmentation result;
and the characteristic extraction unit is used for extracting the characteristics of the multi-level text segmentation result to obtain text characteristic information.
In one embodiment of the present application, the information determination module 720 includes a text segmentation unit, a feature extraction unit, and a feature fusion unit.
The text segmentation unit is used for performing multilevel text segmentation on the processed text to obtain a multilevel text segmentation result;
the feature extraction unit is used for extracting features of each level of text segmentation result to obtain a feature extraction result corresponding to the level of text segmentation result;
and the feature fusion unit is used for performing feature fusion on the feature extraction results corresponding to the multi-level text segmentation results to obtain text feature information.
In one embodiment of the application, the feature extraction unit comprises a feature extraction subunit, a normal vector generation subunit and an extraction result generation subunit.
The feature extraction subunit is used for inputting the text segmentation result of each level into the feature extraction model to obtain a feature vector corresponding to the text segmentation result of the level;
the normal vector generating subunit is used for generating a text normal vector of the level of text based on adjacent words of the central word of the text to be processed;
and the extraction result generating subunit is used for generating a feature extraction result corresponding to the text segmentation result on the basis of the feature vector and the text normal vector.
In one embodiment of the application, the feature fusion unit is configured to:
and inputting the feature extraction results corresponding to the multi-stage text segmentation results into a preset feature fusion model to obtain text feature information.
In one embodiment of the present application, the text processing apparatus 700 further comprises a trigger word sample set updating module.
And the trigger word sample set updating module is used for correspondingly adding the event trigger words and the texts to be processed to the trigger word sample set to obtain a new trigger word sample set so as to optimize the trigger word recognition model by utilizing the new trigger word sample set.
In one embodiment of the present application, the text processing apparatus 700 further comprises an event classification sample set updating module.
And the event classification sample set updating module is used for correspondingly adding the event type of the text to be processed and the text to be processed to the event classification sample set to obtain a new event classification sample set so as to optimize the event classification model by utilizing the new event classification sample set.
The text processing apparatus provided in the embodiment of the present application may be configured to execute the text processing method provided in each of the above method embodiments, and the implementation principle and the technical effect are similar, and for the sake of brevity, no further description is given here.
As will be appreciated by one skilled in the art, aspects of the present application may be embodied as a system, method or program product. Accordingly, various aspects of the present application may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
An electronic device 800 according to this embodiment of the application is described below with reference to fig. 8. The electronic device 800 shown in fig. 8 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 8, electronic device 800 is in the form of a general purpose computing device. The components of the electronic device 800 may include, but are not limited to: the at least one processing unit 810, the at least one memory unit 820, and a bus 830 that couples the various system components including the memory unit 820 and the processing unit 810.
Wherein the storage unit stores program code, which can be executed by the processing unit 810, to cause the processing unit 810 to perform the steps according to various exemplary embodiments of the present application described in the above section "exemplary method" of the present specification. For example, the processing unit 810 may perform the following steps of the above-described method embodiments:
acquiring a text to be processed;
determining text characteristic information of a text to be processed, wherein the text characteristic information comprises first characteristic information used for identifying trigger words;
inputting the first characteristic information into a full-connection layer of a trigger word recognition model to obtain first probability values corresponding to a plurality of word combinations respectively, wherein each first probability value represents the probability that the corresponding word combination is an event trigger word, and the word combination is a word containing a preset trigger key word in a text to be processed;
and determining the event trigger words of the text to be processed based on the first probability values respectively corresponding to the word combinations through the classification layer of the trigger word recognition model.
The storage unit 820 may include readable media in the form of volatile memory units such as a random access memory unit (RAM)8201 and/or a cache memory unit 8202, and may further include a read only memory unit (ROM) 8203.
The storage unit 820 may also include a program/utility 8204 having a set (at least one) of program modules 8205, such program modules 8205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Bus 830 may be any of several types of bus structures including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 800 may also communicate with one or more external devices 840 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with the electronic device 800, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 800 to communicate with one or more other computing devices. Such communication may occur via input/output (I/O) interfaces 850.
Also, the electronic device 800 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the internet) via the network adapter 860.
As shown in FIG. 8, the network adapter 860 communicates with the other modules of the electronic device 800 via the bus 830.
It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the electronic device 800, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present application may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present application.
In an exemplary embodiment of the present application, there is also provided a computer-readable storage medium, which may be a readable signal medium or a readable storage medium. On which a program product capable of implementing the method of the present application is stored.
In some possible embodiments, various aspects of the present application may also be implemented in the form of a program product comprising program code for causing a terminal device to perform the steps according to various exemplary embodiments of the present application described in the above-mentioned "exemplary methods" section of this specification, when the program product is run on the terminal device.
More specific examples of the computer-readable storage medium in the present application may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
In the present application, a computer readable storage medium may include a propagated data signal with readable program code embodied therein, either in baseband or as part of a carrier wave.
Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof.
A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
In some examples, program code embodied on a computer readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
In particular implementations, program code for carrying out operations of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + +, or the like, as well as conventional procedural programming languages, such as the "C" programming language or similar programming languages.
The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server.
In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory.
Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the application. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
Moreover, although the steps of the methods herein are depicted in the drawings in a particular order, this does not require or imply that the steps must be performed in this particular order, or that all of the depicted steps must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions, etc.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware.
Therefore, the technical solution according to the embodiments of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the embodiments of the present application.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein.
This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.

Claims (11)

1. A method of text processing, comprising:
acquiring a text to be processed;
determining text characteristic information of the text to be processed, wherein the text characteristic information comprises first characteristic information used for identifying trigger words;
inputting the first characteristic information into a full-connection layer of a trigger word recognition model to obtain first probability values corresponding to a plurality of word combinations respectively, wherein each first probability value represents the probability that the corresponding word combination is an event trigger word, and the word combination is a word containing a preset trigger key word in the text to be processed;
determining, by a classification layer of the trigger word recognition model, an event trigger word of the text to be processed based on first probability values respectively corresponding to the plurality of word combinations.
2. The method according to claim 1, wherein the text feature information further includes second feature information for making an event type determination,
after the determining text feature information of the text to be processed, the method further comprises:
inputting the second characteristic information into a full-connection layer of an event classification model to obtain second probability values corresponding to a plurality of preset event types respectively, wherein each second probability value represents the probability that the text to be processed belongs to the preset event type corresponding to each second probability value;
and determining the type of the event to which the text to be processed belongs based on second probability values corresponding to a plurality of preset events by utilizing the classification layer of the event classification model.
3. The method according to claim 1, wherein the determining text feature information of the text to be processed comprises:
performing multilevel text segmentation on the processed text to obtain a multilevel text segmentation result;
and performing feature extraction on the multistage text segmentation result to obtain the text feature information.
4. The method according to claim 1, wherein the determining text feature information of the text to be processed comprises:
performing multilevel text segmentation on the processed text to obtain a multilevel text segmentation result;
performing feature extraction on each level of text segmentation result to obtain a feature extraction result corresponding to the level of text segmentation result;
and carrying out feature fusion on feature extraction results corresponding to the multi-level text segmentation results to obtain the text feature information.
5. The method of claim 4,
the feature extraction of each level of text segmentation result to obtain the feature extraction result corresponding to the level of text segmentation result includes:
inputting the text segmentation result of each level into a feature extraction model to obtain a feature vector corresponding to the text segmentation result of the level;
generating a text normal vector of the text at the level based on adjacent words of the central word of the text to be processed;
and generating a feature extraction result corresponding to the text segmentation result based on the feature vector and the text normal vector.
6. The method according to claim 4 or 5, wherein the performing feature fusion on the feature extraction results corresponding to the respective multi-level text segmentation results to obtain the text feature information comprises:
and inputting the feature extraction results corresponding to the multistage text segmentation results into a preset feature fusion model to obtain the text feature information.
7. The method of claim 1, wherein after the determining event-triggered words of the text to be processed based on the first probability values corresponding to the plurality of word combinations, the method further comprises:
correspondingly adding the event trigger words and the texts to be processed to a trigger word sample set to obtain a new trigger word sample set, and optimizing the trigger word recognition model by using the new trigger word sample set.
8. The method according to claim 2, wherein after determining the type of the event to which the text to be processed belongs based on the second probability values corresponding to the preset events, the method further comprises:
and correspondingly adding the event type of the text to be processed and the text to be processed to an event classification sample set to obtain a new event classification sample set, so as to optimize the event classification model by using the new event classification sample set.
9. A text processing apparatus, comprising:
and the acquisition module is used for acquiring the text to be processed.
And the information determining module is used for determining the text characteristic information of the text to be processed, wherein the text characteristic information comprises first characteristic information used for identifying the trigger words.
And the first computing module is used for inputting the first characteristic information into a full connection layer of the trigger word recognition model to obtain first probability values corresponding to a plurality of word combinations, wherein each first probability value represents the probability that the corresponding word combination is an event trigger word, and the word combination is a word containing a preset trigger key word in the text to be processed.
And the trigger word determining module is used for determining the event trigger words of the text to be processed based on the first probability values respectively corresponding to the word combinations through the classification layer of the trigger word recognition model.
10. An electronic device, comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the text processing method of any one of claims 1-8 via execution of the executable instructions.
11. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the text processing method of any one of claims 1 to 8.
CN202210557278.3A 2022-05-20 2022-05-20 Text processing method, device, equipment and medium Active CN114841162B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210557278.3A CN114841162B (en) 2022-05-20 2022-05-20 Text processing method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210557278.3A CN114841162B (en) 2022-05-20 2022-05-20 Text processing method, device, equipment and medium

Publications (2)

Publication Number Publication Date
CN114841162A true CN114841162A (en) 2022-08-02
CN114841162B CN114841162B (en) 2024-01-05

Family

ID=82572277

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210557278.3A Active CN114841162B (en) 2022-05-20 2022-05-20 Text processing method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN114841162B (en)

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109299470A (en) * 2018-11-01 2019-02-01 成都数联铭品科技有限公司 The abstracting method and system of trigger word in textual announcement
CN109558591A (en) * 2018-11-28 2019-04-02 中国科学院软件研究所 Chinese event detection method and device
CN110188172A (en) * 2019-05-31 2019-08-30 清华大学 Text based event detecting method, device, computer equipment and storage medium
CN111222330A (en) * 2019-12-26 2020-06-02 中国电力科学研究院有限公司 Chinese event detection method and system
CN111967268A (en) * 2020-06-30 2020-11-20 北京百度网讯科技有限公司 Method and device for extracting events in text, electronic equipment and storage medium
CN112116075A (en) * 2020-09-18 2020-12-22 厦门安胜网络科技有限公司 Event extraction model generation method and device and text event extraction method and device
CN112131366A (en) * 2020-09-23 2020-12-25 腾讯科技(深圳)有限公司 Method, device and storage medium for training text classification model and text classification
CN112632230A (en) * 2020-12-30 2021-04-09 中国科学院空天信息创新研究院 Event joint extraction method and device based on multi-level graph network
CN112988979A (en) * 2021-04-29 2021-06-18 腾讯科技(深圳)有限公司 Entity identification method, entity identification device, computer readable medium and electronic equipment
CN113254628A (en) * 2021-05-18 2021-08-13 北京中科智加科技有限公司 Event relation determining method and device
CN113946681A (en) * 2021-12-20 2022-01-18 军工保密资格审查认证中心 Text data event extraction method and device, electronic equipment and readable medium
CN114239566A (en) * 2021-12-14 2022-03-25 公安部第三研究所 Method, device and processor for realizing two-step Chinese event accurate detection based on information enhancement and computer readable storage medium thereof
CN114330354A (en) * 2022-03-02 2022-04-12 杭州海康威视数字技术股份有限公司 Event extraction method and device based on vocabulary enhancement and storage medium

Patent Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109299470A (en) * 2018-11-01 2019-02-01 成都数联铭品科技有限公司 The abstracting method and system of trigger word in textual announcement
CN109558591A (en) * 2018-11-28 2019-04-02 中国科学院软件研究所 Chinese event detection method and device
US20210334665A1 (en) * 2019-05-31 2021-10-28 Tencent Technology (Shenzhen) Company Limited Text-based event detection method and apparatus, computer device, and storage medium
CN110188172A (en) * 2019-05-31 2019-08-30 清华大学 Text based event detecting method, device, computer equipment and storage medium
CN111222330A (en) * 2019-12-26 2020-06-02 中国电力科学研究院有限公司 Chinese event detection method and system
CN111967268A (en) * 2020-06-30 2020-11-20 北京百度网讯科技有限公司 Method and device for extracting events in text, electronic equipment and storage medium
CN112116075A (en) * 2020-09-18 2020-12-22 厦门安胜网络科技有限公司 Event extraction model generation method and device and text event extraction method and device
CN112131366A (en) * 2020-09-23 2020-12-25 腾讯科技(深圳)有限公司 Method, device and storage medium for training text classification model and text classification
CN112632230A (en) * 2020-12-30 2021-04-09 中国科学院空天信息创新研究院 Event joint extraction method and device based on multi-level graph network
CN112988979A (en) * 2021-04-29 2021-06-18 腾讯科技(深圳)有限公司 Entity identification method, entity identification device, computer readable medium and electronic equipment
CN113254628A (en) * 2021-05-18 2021-08-13 北京中科智加科技有限公司 Event relation determining method and device
CN114239566A (en) * 2021-12-14 2022-03-25 公安部第三研究所 Method, device and processor for realizing two-step Chinese event accurate detection based on information enhancement and computer readable storage medium thereof
CN113946681A (en) * 2021-12-20 2022-01-18 军工保密资格审查认证中心 Text data event extraction method and device, electronic equipment and readable medium
CN114330354A (en) * 2022-03-02 2022-04-12 杭州海康威视数字技术股份有限公司 Event extraction method and device based on vocabulary enhancement and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
余辉: ""基于深度学习的中文临床指南事件抽取研究"", 《中国优秀硕士学位论文全文数据库信息科技辑》, no. 5 *

Also Published As

Publication number Publication date
CN114841162B (en) 2024-01-05

Similar Documents

Publication Publication Date Title
CN108363790B (en) Method, device, equipment and storage medium for evaluating comments
US10592607B2 (en) Iterative alternating neural attention for machine reading
CN107729313B (en) Deep neural network-based polyphone pronunciation distinguishing method and device
US20180075368A1 (en) System and Method of Advising Human Verification of Often-Confused Class Predictions
US20180068222A1 (en) System and Method of Advising Human Verification of Machine-Annotated Ground Truth - Low Entropy Focus
US20180068221A1 (en) System and Method of Advising Human Verification of Machine-Annotated Ground Truth - High Entropy Focus
CN110276023B (en) POI transition event discovery method, device, computing equipment and medium
CN111309915A (en) Method, system, device and storage medium for training natural language of joint learning
US11443209B2 (en) Method and system for unlabeled data selection using failed case analysis
KR20190125863A (en) Multilingual translation device and multilingual translation method
CN111611810B (en) Multi-tone word pronunciation disambiguation device and method
CN111079432B (en) Text detection method and device, electronic equipment and storage medium
US20220147835A1 (en) Knowledge graph construction system and knowledge graph construction method
CN107943940A (en) Data processing method, medium, system and electronic equipment
CN110874536A (en) Corpus quality evaluation model generation method and bilingual sentence pair inter-translation quality evaluation method
CN111767714B (en) Text smoothness determination method, device, equipment and medium
CN112100360B (en) Dialogue response method, device and system based on vector retrieval
KR20210125449A (en) Method for industry text increment, apparatus thereof, and computer program stored in medium
CN113705207A (en) Grammar error recognition method and device
CN110929499B (en) Text similarity obtaining method, device, medium and electronic equipment
CN110472241B (en) Method for generating redundancy-removed information sentence vector and related equipment
WO2023088278A1 (en) Method and apparatus for verifying authenticity of expression, and device and medium
US11880664B2 (en) Identifying and transforming text difficult to understand by user
CN111339760A (en) Method and device for training lexical analysis model, electronic equipment and storage medium
CN114841162B (en) Text processing method, device, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant