WO2020007138A1 - 一种事件识别的方法、模型训练的方法、设备及存储介质 - Google Patents

一种事件识别的方法、模型训练的方法、设备及存储介质 Download PDF

Info

Publication number
WO2020007138A1
WO2020007138A1 PCT/CN2019/089068 CN2019089068W WO2020007138A1 WO 2020007138 A1 WO2020007138 A1 WO 2020007138A1 CN 2019089068 W CN2019089068 W CN 2019089068W WO 2020007138 A1 WO2020007138 A1 WO 2020007138A1
Authority
WO
WIPO (PCT)
Prior art keywords
word
event
target
sentence
type
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.)
Ceased
Application number
PCT/CN2019/089068
Other languages
English (en)
French (fr)
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Publication of WO2020007138A1 publication Critical patent/WO2020007138A1/zh
Priority to US16/998,518 priority Critical patent/US11972213B2/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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
    • G06F16/355Creation or modification of classes or clusters
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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 OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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
    • G06F40/295Named entity recognition
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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 OR CALCULATING; 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/0499Feedforward networks
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/09Supervised learning
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N5/00Computing arrangements using knowledge-based models
    • G06N5/04Inference or reasoning models

Definitions

  • the present application relates to the technical field of speech processing, and in particular, to a method for event recognition, a method and device for training event recognition models, and a computer-readable storage medium.
  • the background device needs to recognize the content of the news event before recommending it to the corresponding user.
  • the current news event recognition method is mainly identified by pattern matching.
  • the pattern matching recognition method is given a segment. Content, and then from the large amount of data to find the same content as the paragraph, it can be seen that the pattern matching recognition method is poor in portability, and in the case of mass news events every minute, the efficiency of event recognition is low.
  • the embodiments of the present application provide a method for event identification, which can efficiently and accurately identify various types of events.
  • the embodiments of the present application also provide a method, a device, and a computer-readable storage medium for training corresponding event recognition models.
  • a first aspect of the embodiments of the present application provides a method for event identification, including:
  • the terminal device obtains a target sentence for identifying a type to which the target event belongs;
  • the terminal device processes the target sentence based on an event recognition model to obtain the type of the target event.
  • the event recognition model is used to determine the type of the target event by using a trigger word in the target sentence and a context word of the trigger word.
  • a trigger word is used to indicate an alternative type of the target event, and the alternative type includes the type of the target event;
  • the terminal device outputs the type of the target event.
  • a second aspect of the embodiments of the present application provides a method for training an event recognition model, including:
  • the computer equipment obtains a sample set used for model training.
  • the sample set includes sample sentences corresponding to multiple sample events and respective types of the multiple sample events.
  • Each sample sentence includes a trigger word and a context word of the trigger word. ;
  • the computer device trains a first event recognition model according to each of the sample sentences to obtain a second event recognition model.
  • the second event recognition model is used to determine a trigger word in a target sentence and a context word of the trigger word in the target sentence.
  • the type of the target event, and the target sentence is a sentence for identifying a type to which the target event belongs.
  • a third aspect of the embodiments of the present application provides an event recognition device, which is installed in a terminal device and includes:
  • An obtaining unit configured to obtain a target sentence for identifying a type to which the target event belongs
  • a processing unit configured to process the target sentence obtained by the obtaining unit based on an event recognition model to obtain a type of the target event, wherein the event recognition model is used to pass a trigger word in the target sentence and a context word of the trigger word Determine the type of the target event, the trigger word is used to indicate an alternative type of the target event, and the alternative type includes the type of the target event;
  • the output unit is configured to output the type of the target event determined by the processing unit.
  • a fourth aspect of the embodiments of the present application provides an apparatus for training an event recognition model, which is installed in a computer device and includes:
  • the obtaining unit is configured to obtain a sample set used for model training.
  • the sample set includes sample sentences corresponding to multiple sample events and respective types of the multiple sample events.
  • Each sample sentence includes a trigger word and the trigger word.
  • the model training unit is configured to train a first event recognition model according to each of the sample sentences obtained by the obtaining unit to obtain a second event recognition model.
  • the second event recognition model is used to pass the trigger word in the target sentence and the target.
  • the context word of the trigger word in the sentence determines the type of the target event, and the target sentence is a sentence for identifying a type to which the target event belongs.
  • a fifth aspect of the embodiments of the present application provides a terminal device.
  • the terminal device includes: an input / output (I / O) interface, a processor, and a memory, and the memory stores program instructions;
  • the processor is configured to execute a program instruction stored in a memory, and execute the method according to the first aspect.
  • a sixth aspect of the embodiments of the present application provides a computer device.
  • the computer device includes: an input / output (I / O) interface, a processor, and a memory, and the memory stores program instructions;
  • the processor is configured to execute program instructions stored in a memory, and execute the method according to the second aspect.
  • Another aspect of the embodiments of the present application provides a computer-readable storage medium, where the computer-readable storage medium stores instructions, and when the computer-readable storage medium is run on a computer, causes the computer to execute the method in the first aspect.
  • the computer-readable storage medium stores instructions, and when the computer-readable storage medium runs on the computer, the computer causes the computer to execute the method in the second aspect.
  • Another aspect of the embodiments of the present application provides a computer program product containing instructions, which, when run on a computer, causes the computer to execute the method in the first aspect.
  • Another aspect of the embodiments of the present application provides a computer program product containing instructions, which when executed on a computer, causes the computer to execute the method in the second aspect.
  • a trigger word and a context word of the trigger word are used for recognition.
  • Using this method of word classification for event recognition can not only improve recognition efficiency, but also use context words for recognition, which can improve event recognition Accuracy.
  • FIG. 1 is a schematic diagram of an embodiment of an event recognition model training system according to an embodiment of the present application
  • FIG. 2 is a schematic diagram of an embodiment of an event recognition model training method according to an embodiment of the present application.
  • FIG. 3 is a schematic diagram of an example of a vectorized representation of an event recognition model training according to an embodiment of the present application
  • FIG. 4 is a schematic diagram of a scenario example of an event recognition application according to an embodiment of the present application.
  • FIG. 5 is a schematic diagram of an embodiment of an event recognition method according to an embodiment of the present application.
  • FIG. 6 is a schematic diagram of an example of a vectorized representation of event recognition in the embodiment of the present application.
  • FIG. 7 is a schematic diagram of an embodiment of an event recognition device according to an embodiment of the present application.
  • FIG. 8 is a schematic diagram of an embodiment of an apparatus for training an event recognition model according to an embodiment of the present application.
  • FIG. 9 is a schematic diagram of a computer device according to an embodiment of the present application.
  • the embodiments of the present application provide an event recognition method, which can efficiently and accurately identify various types of events.
  • the embodiments of the present application also provide a method, a device, and a computer-readable storage medium for training corresponding event recognition models. Each of them will be described in detail below.
  • the event recognition is based on the event recognition model.
  • the training process of the event recognition model in the embodiments of the present application will be introduced first.
  • FIG. 1 is a schematic diagram of an embodiment of an event recognition model training system according to an embodiment of the present application.
  • the event recognition model training system includes a computer device 10 and a database 20, and the database 20 stores a sample set for training the event recognition model.
  • the sample set includes sample sentences corresponding to multiple sample events and respective types of multiple sample events.
  • a sample event refers to an event that is used as a sample.
  • An event is an event or state consisting of one or more actions that takes place at a specific time or period of time and within a specific geographical area. Change. Of course, there is no time and place, but only events or changes in state made up of characters and actions can also be called events.
  • the sample sentence of the sample event may be a core sentence for describing the sample event. For example, if the sample event is a news event, the sample sentence may be a title of the news event.
  • Each sample sentence includes a trigger word and a context word of the trigger word.
  • the trigger word is the word in the sample sentence that can best indicate the occurrence of the sample event. For example: Wang Xiaowu and Zhang Xiaohua got married in Shenzhen. Among them, “marriage” can best indicate this event, and “marriage” is the trigger word. In a scene, the same words may have different meanings. In this way, event recognition needs to be combined with context words.
  • Sentence 2 “Grandpa left us forever, but we will not forget him”.
  • “Leave” in sentence 1 means off work
  • "leave” in sentence 2 means death.
  • the same trigger word may indicate different event types. Therefore, it is necessary to combine the context words of the trigger word so that the type of the event can be accurately identified.
  • the type of the sample event is pre-labeled for each sample event. In this way, the computer device 10 can use the sample sentences and types of events in the sample set for model training, thereby training a model for event recognition.
  • an embodiment of a method for training an event recognition model includes:
  • a computer device obtains a sample set used for model training.
  • the sample set includes sample sentences corresponding to multiple sample events and respective types of multiple sample events, and each sample sentence includes a trigger word and a context word of the trigger word.
  • the computer device trains a first event recognition model according to each sample sentence to obtain a second event recognition model.
  • the second event recognition model is used to determine a target by using a trigger word in the target sentence and a context word of the trigger word in the target sentence.
  • the type of event is a statement used to identify the type of the target event.
  • model training is performed by combining the trigger word and the trigger word context word in the sample sentence of the sample event and the type of the sample event, thereby ensuring that the training can accurately perform the event Recognized event recognition model.
  • the computer equipment training the first event recognition model according to each sample sentence to obtain the second event recognition model may include:
  • the computer equipment preprocesses the first sample sentence to obtain each word in the first sample sentence, and the first sample sentence is any sample sentence in each sample sentence;
  • the computer equipment performs vector conversion processing on each word to obtain an input layer vector of each word
  • the computer device trains a first event recognition model according to an input layer vector of each word and a type of a sample event corresponding to the first sample sentence to obtain a second event recognition model.
  • the computer equipment preprocesses the first sample sentence to obtain each word in the first sample sentence, which may include:
  • the computer device recognizes the named entities in the first sample sentence, and the named entities are the participating objects in the target event;
  • the computer device divides the first sample sentence after the anonymization process into a sequence of words to obtain each word in the first sample sentence.
  • the pre-processing process includes anonymization processing and word division of sentences.
  • Anonymization is for named entities.
  • the named entities may be characters, companies, or other role objects participating in the event.
  • Anonymizing the named entity can avoid using the named entity as a strong feature during training to establish an inevitable connection between the named entity and the type of the event. For example: "Pan Changjiang participates in the Spring Festival Gala.” The type of event is "Performance”. If it is not anonymized, it is likely to establish an inevitable connection between Pan Changjiang and the performance. After the model is trained, in the process of event recognition, it is likely that the named entity "Pan Changjiang" will be identified and related events will be identified. It's a performance event.
  • Anonymization is to hide specific information, and only retain the type of information that is a named entity, such as the marriage of Pan Changjiang's daughter. After the anonymization process can be: PER's PER marriage. The word PER used to indicate that the location belongs to a named entity.
  • Word division is to divide sentences into words. For example, "PER's PER marriage” can be divided into “PER”, “of”, “PER”, and “marriage”.
  • the recognition of the event is completed by the recognition of the trigger word.
  • the sample can also be considered
  • the trigger word in the sample sentence of the event can indicate the type of the sample event.
  • the computer equipment can take each word as a candidate trigger word and classify it.
  • the target category here is a predefined event type, and an NA category is introduced to represent non-events.
  • One labeled data can be split into multiple training samples. The above example "Pan Changjiang's Daughter Marries" can be split into four samples as shown in Table 1 below:
  • both the first event recognition model and the second event recognition model include three layers of fully connected neural networks.
  • the three layers are an input layer, a hidden layer, and an output layer.
  • each The layers have corresponding functions. For example, at the input layer, both trigger words and context words are converted into input layer vectors, and then according to the relationship between the input layer and the hidden layer, the input layer vector is converted into a hidden layer vector. Converting words into input layer vectors can be achieved by looking up a vector table.
  • the computer device training the first event recognition model according to the input layer vector of each word and the type of the sample event corresponding to the first sample sentence to obtain the second event recognition model may include:
  • the computer device converts the input layer vector of each word into a hidden layer vector, each word includes a first word, and the first word is a trigger word in each word;
  • the computer device determines the attention weight of any second word according to the hidden layer vector of each second word, the hidden layer vector of the first word, and the hidden layer vector of any second word.
  • the second word is the first word except the first word. Words other than
  • the computer device determines the context vector of the first word according to the input layer vector of each second word and the attention weight of each second word;
  • the computer device determines parameters of the first event recognition model according to the context vector of the first word, the input layer vector of the first word, and the type of the sample event corresponding to the first sample sentence to obtain a second event recognition model.
  • the input layer vector can be converted into a hidden layer vector by using a formula.
  • W is the transformation matrix
  • f (.) Is a non-linear function, such as hyperbolic tangent tanh (.).
  • the context vector of the trigger word needs to be determined.
  • the attention weight of the context word of the trigger word must be determined first, namely The weight associated with the context word and trigger word.
  • Determining the attention weight of contextual words can be calculated by the following formula:
  • n represents the total number of words in the sample sentence
  • n-1 represents the number of context words in the sample sentence, that is, the number of second words except the first word as the trigger word
  • ⁇ j represents n-1 Attention weight of the j-th second word in the second word, Is the hidden layer vector of the first word
  • the transpose of the hidden layer vector representing the j-th second word Represents the transpose of the hidden layer vector of the i-th second word, where the value of i is an integer from 1 to n-1, and the value of j is an integer from 1 to n-1.
  • the context vector of the first word as the trigger word can be determined by the following formula:
  • c is the context vector of the first word
  • wj is the input layer vector of the j-th second word
  • ⁇ j T is the transpose of the attention weight of the j-th second word
  • the value of j is from 1 to An integer of n-1.
  • the parameter ⁇ of the first event recognition model can be determined by c and the input layer vector w of the first word, and the type of the sample event corresponding to the sample sentence.
  • k represents the k-th event type.
  • the event recognition model can be used for event recognition.
  • Event recognition can be used in news recommendation.
  • computer device 10 passes The network 30 can communicate with a terminal device 40, and the computer device 10 can be used for event recognition. Display positions of different event types are set on the news interface of the terminal device 40. After the computer device 10 recognizes the type of the event, it pushes this type of event to the terminal device 40, and the terminal device 40 will place the news to the news event type The appropriate type of display.
  • Figure 4 only lists a few different event types. The number of event types can be set or modified according to requirements. In the embodiments of the present application, the event type is also the type of the event.
  • an embodiment of the event recognition method provided by the embodiment of the present application includes:
  • the terminal device acquires a target sentence for identifying a type to which the target event belongs.
  • a news related to mobile phone release such as a news event titled “iphoneX release”
  • the title “iphoneX release” can be determined as the target sentence.
  • the terminal device processes the target sentence based on the event recognition model to obtain the type of the target event.
  • the event recognition model is used to determine the type of the target event by using the trigger word in the target sentence and the context word of the trigger word.
  • the trigger word is used to indicate Alternative types of target events.
  • Alternative types include the types of target events.
  • the terminal device outputs the type of the target event.
  • a trigger word and a context word of the trigger word are used for recognition.
  • Using this method of word classification for event recognition can not only improve recognition efficiency, but also use context words for recognition, which can improve event recognition. Accuracy.
  • the terminal device processing the target sentence based on the event recognition model to obtain the type of the target event may include:
  • the terminal device preprocesses the target sentence to obtain each word in the target sentence
  • the terminal device performs vector conversion processing on each word to obtain an input layer vector of each word
  • the terminal device determines the type of the target event according to the input layer vector of each word.
  • the terminal device preprocesses the target sentence to obtain each word in the target sentence, which may include:
  • the terminal device recognizes the named entity in the target sentence, and the named entity is the participating object in the target event;
  • the terminal device anonymizes the named entity
  • the terminal device divides the target sentence after the anonymization process into a sequence of words to obtain each word in the target sentence.
  • the pre-processing process includes anonymization processing and word division of sentences.
  • Anonymization is for named entities, and the named entities may be characters, companies, or other role objects participating in the event.
  • Anonymizing the named entity can avoid using the named entity as a strong feature during training to establish an inevitable connection between the named entity and the type of the event. For example: "Pan Changjiang participates in the Spring Festival Gala.” The type of event is "Performance”. If it is not anonymized, it is likely to establish an inevitable connection between Pan Changjiang and the performance. In the process of event identification, it is likely that the named entity "Pan Changjiang" will be identified and the related event will be identified as a performance event.
  • Anonymization is to hide specific information, and only retain the type of information that is a named entity, such as the marriage of Pan Changjiang's daughter. After the anonymization process can be: PER's PER marriage. The word PER used to indicate that the location belongs to a named entity.
  • Word division is to divide sentences into words. For example, "PER's PER marriage” can be divided into “PER”, “of”, “PER”, and “marriage”.
  • the terminal device determining the type of the target event according to the input layer vector of each word may include:
  • the terminal device converts an input layer vector of each word into a hidden layer vector, each word includes a first word, and the first word is any word in each word;
  • the attention weight of any second word is determined according to the hidden layer vector of each second word, the hidden layer vector of the first word, and the hidden layer vector of any second word.
  • the second word is a word other than the first word;
  • the terminal device determines the context vector of the first word according to the input layer vector of each second word and the attention weight of each second word;
  • the terminal device determines the type of the target event according to the context vector of the first word and the input layer vector of the first word.
  • the input layer vector can be converted into a hidden layer vector by using a formula.
  • W is the transformation matrix
  • f (.) Is a non-linear function, such as hyperbolic tangent tanh (.).
  • the context vector of the trigger word needs to be determined.
  • the attention weight of the context word of the trigger word must be determined first, that is, The weight associated with the context word and trigger word.
  • Determining the attention weight of contextual words can be calculated by the following formula:
  • n represents the total number of words in the sample sentence
  • n-1 represents the number of context words in the sample sentence, that is, the number of second words except the first word as the trigger word
  • ⁇ j represents n-1 Attention weight of the j-th second word in the second word, Is the hidden layer vector of the first word
  • the transpose of the hidden layer vector representing the j-th second word Represents the transpose of the hidden layer vector of the i-th second word, where the value of i is an integer from 1 to n-1, and the value of j is an integer from 1 to n-1.
  • the context vector of the first word as the trigger word can be determined by the following formula:
  • c is the context vector of the first word
  • w j is the input layer vector of the j-th second word
  • ⁇ j T is the transpose of the attention weight of the j-th second word
  • the value of j is 1 Integer to n-1.
  • the type of the target event can be determined by c and the input layer vector w of the first word.
  • the terminal device determining the type of the target event according to the context vector of the first word and the input layer vector of the first word may include:
  • the terminal device determines, based on the context vector of the first word, the input layer vector of the first word, and parameters of the event recognition model that the target event belongs to each candidate type when the first word is a trigger word;
  • the terminal device determines the type of the target event according to the confidence that the target event belongs to each candidate type.
  • the parameter ⁇ of the event recognition model has been determined through the model training process shown in FIG. 3, so the input vector O can be obtained through c, w, and ⁇ through two matrix transformations of the hidden layer and the input layer.
  • the i-th element in O represents the confidence that the event recognition model will judge the target sample as type i.
  • k represents the k-th event type.
  • Stochastic gradient descent can be used to calculate y (i), which is the probability that the target event belongs to various types. In the process of determining the type of the target event, the largest type of y (i) is selected as the type of the target event.
  • the terminal device processing the target sentence based on the event recognition model to obtain the type of the target event may include:
  • the terminal device preprocesses the target sentence to obtain each word in the target sentence
  • the terminal device determines the first word belonging to the trigger word in the target sentence
  • the terminal device determines the type of the target event according to the candidate type corresponding to the first word and the second word, and the second word is a context word of the first word.
  • the correspondence between some words that can be used as trigger words and the types of events can be marked in advance. Even if the same trigger word corresponds to different types of events, the calculation range can be narrowed. Other parts related to vector calculation can be understood by referring to the corresponding content of the foregoing embodiments, and will not be repeated here.
  • an embodiment of an event identification device 50 may be installed in a terminal device and includes:
  • the obtaining unit 501 is configured to obtain a target sentence for identifying a type to which a target event belongs;
  • the processing unit 502 is configured to process the target sentence obtained by the acquisition unit 501 based on the event recognition model to obtain the type of the target event, wherein the event recognition model is used to determine the target event by the trigger word in the target sentence and the context word of the trigger word.
  • Type a trigger word is used to indicate an alternative type of the target event, and the alternative type includes the type of the target event;
  • the output unit 503 is set to the type of the target event determined by the output processing unit 502.
  • a trigger word and a context word of the trigger word are used for recognition.
  • Using this method of word classification for event recognition can not only improve recognition efficiency, but also use context words for recognition, which can improve event recognition Accuracy.
  • processing unit 502 is configured to:
  • processing unit 502 is configured to:
  • each word includes a first word, and the first word is any word in each word;
  • the attention weight of any second word is determined according to the hidden layer vector of each second word, the hidden layer vector of the first word, and the hidden layer vector of any second word.
  • Two words are words other than the first word;
  • the type of the target event is determined according to the context vector of the first word and the input layer vector of the first word.
  • processing unit 502 is configured to:
  • processing unit 502 is configured to:
  • Identify named entities in the target sentence, and named entities are the participating objects in the target event
  • the anonymized target sentence is divided into word sequences to obtain each word in the target sentence.
  • processing unit 502 is configured to:
  • the type of the target event is determined according to the candidate type corresponding to the first word and the second word, and the second word is a context word of the first word.
  • an embodiment of an apparatus 60 for training an event recognition model according to an embodiment of the present application.
  • the above apparatus 60 may be installed in a computer device and includes:
  • the obtaining unit 601 is configured to obtain a sample set used for model training.
  • the sample set includes sample sentences corresponding to multiple sample events and respective types of multiple sample events.
  • Each sample sentence includes a trigger word and a context of the trigger word. Words
  • the model training unit 602 is configured to train a first event recognition model according to each sample sentence obtained by the obtaining unit 601 to obtain a second event recognition model.
  • the second event recognition model is used to pass the trigger word in the target sentence and the target sentence
  • the context word of the trigger word of is used to determine the type of the target event
  • the target sentence is a sentence used to identify the type of the target event.
  • model training is performed by combining the trigger word and the trigger word context word in the sample sentence of the sample event and the type of the sample event, thereby ensuring that the training can accurately perform the event Recognized event recognition model.
  • model training unit 602 is configured as:
  • the first event recognition model is trained according to the input layer vector of each word and the type of sample events corresponding to the first sample sentence to obtain a second event recognition model.
  • model training unit 602 is configured as:
  • each word includes a first word, and the first word is a trigger word in each word;
  • parameters of the first event recognition model are determined to obtain a second event recognition model.
  • model training unit 602 is configured as:
  • Identify named entities in the first sample sentence, and named entities are the participating objects in the target event
  • the first sample sentence after the anonymization process is divided into word sequences to obtain each word in the first sample sentence.
  • FIG. 9 is a schematic structural diagram of a computer device 70 according to an embodiment of the present application.
  • the computer device 70 includes a processor 710, a memory 740, and an input / output (I / O) interface 730.
  • the memory 740 may include a read-only memory and a random access memory, and provide the processor 710 with operation instructions and data.
  • a part of the memory 740 may further include a non-volatile random access memory (NVRAM).
  • NVRAM non-volatile random access memory
  • the memory 740 stores the following elements, executable modules or data structures, or their subsets, or their extended sets:
  • the target sentence is processed based on the event recognition model to obtain the type of the target event.
  • the event recognition model is used to determine the type of the target event through the trigger word and the context word of the trigger word in the target sentence. Selection type, including the type of the target event;
  • a trigger word and a context word of the trigger word are used for recognition.
  • Using this method of word classification for event recognition can not only improve recognition efficiency, but also use context words for recognition, which can improve event recognition Accuracy.
  • the processor 710 controls operations of the computer device 70, and the processor 710 may also be referred to as a CPU (Central Processing Unit).
  • the memory 740 may include a read-only memory and a random access memory, and provide instructions and data to the processor 710. A portion of the memory 740 may also include non-volatile random access memory (NVRAM).
  • NVRAM non-volatile random access memory
  • various components of the computer device 70 are coupled together by a bus system 720.
  • the bus system 720 may include a power bus, a control bus, and a status signal bus in addition to a data bus. However, for the sake of clarity, various buses are marked as the bus system 720 in the figure.
  • the method disclosed in the foregoing embodiments of the present application may be applied to the processor 710, or implemented by the processor 710.
  • the processor 710 may be an integrated circuit chip and has a signal processing capability. In the implementation process, each step of the foregoing method may be completed by using an integrated logic circuit of hardware in the processor 710 or an instruction in a form of software.
  • the processor 710 may be a general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, or discrete hardware Components.
  • DSP digital signal processor
  • ASIC application specific integrated circuit
  • FPGA off-the-shelf programmable gate array
  • Various methods, steps, and logical block diagrams disclosed in the embodiments of the present application may be implemented or executed.
  • a general-purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
  • the steps of the method disclosed in combination with the embodiments of the present application may be directly implemented by a hardware decoding processor, or may be performed by using a combination of hardware and software modules in the decoding processor.
  • a software module may be located in a mature storage medium such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, and the like.
  • the storage medium is located in the memory 740, and the processor 710 reads the information in the memory 740 and completes the steps of the foregoing method in combination with its hardware.
  • the processor 710 is configured to:
  • the processor 710 is configured to:
  • each word includes a first word, and the first word is any word in each word;
  • the attention weight of any second word is determined according to the hidden layer vector of each second word, the hidden layer vector of the first word, and the hidden layer vector of any second word.
  • Two words are words other than the first word;
  • the type of the target event is determined according to the context vector of the first word and the input layer vector of the first word.
  • the processor 710 is configured to:
  • the processor 710 is configured to:
  • Identify named entities in the target sentence, and named entities are the participating objects in the target event
  • the anonymized target sentence is divided into word sequences to obtain each word in the target sentence.
  • the processor 710 is configured to:
  • the type of the target event is determined according to the candidate type corresponding to the first word and the second word, and the second word is a context word of the first word.
  • the processor 710 is configured to:
  • the sample set includes sample sentences corresponding to multiple sample events and respective types of multiple sample events, and each sample sentence includes a trigger word and a context word of the trigger word;
  • the second event recognition model is used to determine the type of the target event by using the trigger word in the target sentence and the context word of the trigger word in the target sentence,
  • the target statement is a statement for identifying the type to which the target event belongs.
  • the processor 710 is configured to:
  • the first event recognition model is trained according to the input layer vector of each word and the type of sample events corresponding to the first sample sentence to obtain a second event recognition model.
  • the processor 710 is configured to:
  • each word includes a first word, and the first word is a trigger word in each word;
  • parameters of the first event recognition model are determined to obtain a second event recognition model.
  • the processor 710 is configured to:
  • Identify named entities in the first sample sentence, and named entities are the participating objects in the target event
  • the first sample sentence after the anonymization process is divided into word sequences to obtain each word in the first sample sentence.
  • the computer program product includes one or more computer instructions.
  • the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
  • the computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be from a website site, a computer, a server, or a data center. Transmission via wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) to another website site, computer, server, or data center.
  • wired such as coaxial cable, optical fiber, digital subscriber line (DSL)
  • wireless such as infrared, wireless, microwave, etc.
  • the computer-readable storage medium may be any available medium that can be stored by a computer or a data storage device such as a server, a data center, and the like that includes one or more available medium integration.
  • the available medium may be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk (Solid State Disk (SSD)), and the like.
  • the program may be stored in a computer-readable storage medium.
  • the storage medium may include: ROM, RAM, disk or optical disk, etc.
  • This application adopts a method of obtaining a target sentence for identifying a type of a target event, processing the target sentence based on an event recognition model to obtain a type of the target event, and outputting the type of the target event, so that the event can be identified at the event.
  • the trigger word and the context word of the trigger word are used for recognition.
  • Using this word classification method for event recognition can not only improve the recognition efficiency, but also use context words for recognition, which can improve the accuracy of event recognition.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Computational Linguistics (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Data Mining & Analysis (AREA)
  • Software Systems (AREA)
  • Mathematical Physics (AREA)
  • Computing Systems (AREA)
  • Evolutionary Computation (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Molecular Biology (AREA)
  • Biophysics (AREA)
  • Biomedical Technology (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Databases & Information Systems (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Medical Informatics (AREA)
  • Machine Translation (AREA)

Abstract

一种事件识别的方法,包括:终端设备获取用于识别目标事件所属类型的目标语句(201);终端设备基于事件识别模型处理目标语句,以得到目标事件的类型,其中,事件识别模型用于通过目标语句中的触发词和触发词的上下文词语确定目标事件的类型,触发词用于指示目标事件的备选类型,备选类型包括目标事件的类型(202);终端设备输出目标事件的类型(203)。由于在事件识别过程中结合触发词和触发词的上下文词语进行识别,采用这种词分类的方法进行事件识别,不仅可以提高识别效率,而且结合上下文词语进行识别,可以提高事件识别的准确度。

Description

一种事件识别的方法、模型训练的方法、设备及存储介质
本申请要求于2018年7月3日提交中国专利局、优先权号为2018107163807、发明名称为“一种事件识别的方法、模型训练的方法、设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及语音处理技术领域,具体涉及一种事件识别的方法、事件识别模型训练的方法、设备及计算机可读存储介质。
背景技术
在网络发达的今天,人们对于新闻阅读的需求早已从传统纸媒转移到了网络媒体。在大型网络媒体门户如腾讯、网易、新浪上发布的新闻,都具有发布总量大、更新频率高、阅读用户人数多、读者分布广等特点。对于单个用户而言,都希望能读到自己感兴趣的新闻事件。对此,各个网络媒体门户运营商也各出奇招,例如:通过用户的浏览记录来做后续的新闻推荐。
无论是哪种方式的推荐,都需要后台设备先识别新闻事件的内容才能推荐给相应的用户,当前的新闻事件识别方式主要是通过模式匹配的方式进行识别,模式匹配的识别方式就是给定一段内容,然后从大量数据中去找与该一段内容相同的内容,由此可见,模式匹配的识别方式可移植性差,在每分钟都有可能产生海量新闻事件的情况下,事件识别的效率低下。
发明内容
本申请实施例提供一种事件识别的方法,可以高效准确的识别出各种类型的事件。本申请实施例还提供了相应事件识别模型训练的方法、设备及计算机可读存储介质。
本申请实施例第一方面提供一种事件识别的方法,包括:
终端设备获取用于识别目标事件所属类型的目标语句;
终端设备基于事件识别模型处理上述目标语句,以得到上述目标事件的类型,其中,上述事件识别模型用于通过上述目标语句中的触发词和上述触发词 的上下文词语确定上述目标事件的类型,上述触发词用于指示上述目标事件的备选类型,上述备选类型包括上述目标事件的类型;
终端设备输出上述目标事件的类型。
本申请实施例第二方面提供一种事件识别模型训练的方法,包括:
计算机设备获取用于模型训练的样本集合,上述样本集合中包括多个样本事件各自对应的样本语句和上述多个样本事件各自的类型,每个样本语句中包括触发词和上述触发词的上下文词语;
计算机设备根据上述每个样本语句训练第一事件识别模型,以得到第二事件识别模型,上述第二事件识别模型用于通过目标语句中的触发词和上述目标语句中的触发词的上下文词语确定上述目标事件的类型,上述目标语句为用于识别目标事件所属类型的语句。
本申请实施例第三方面提供一种事件识别的装置,安装在终端设备中,包括:
获取单元,设置为获取用于识别目标事件所属类型的目标语句;
处理单元,设置为基于事件识别模型处理上述获取单元获取的上述目标语句,以得到上述目标事件的类型,其中,上述事件识别模型用于通过上述目标语句中的触发词和上述触发词的上下文词语确定上述目标事件的类型,上述触发词用于指示上述目标事件的备选类型,上述备选类型包括上述目标事件的类型;
输出单元,设置为输出上述处理单元确定的上述目标事件的类型。
本申请实施例第四方面提供一种事件识别模型训练的装置,安装在计算机设备中,包括:
获取单元,设置为获取用于模型训练的样本集合,上述样本集合中包括多个样本事件各自对应的样本语句和上述多个样本事件各自的类型,每个样本语句中包括触发词和上述触发词的上下文词语;
模型训练单元,设置为根据上述获取单元获取的上述每个样本语句训练第一事件识别模型,以得到第二事件识别模型,上述第二事件识别模型用于通过目标语句中的触发词和上述目标语句中的触发词的上下文词语确定上述目标事件的类型,上述目标语句为用于识别目标事件所属类型的语句。
本申请实施例第五方面提供一种终端设备,上述终端设备包括:输入/输出(I/O)接口、处理器和存储器,上述存储器中存储有程序指令;
上述处理器用于执行存储器中存储的程序指令,执行如第一方面上述的方法。
本申请实施例第六方面提供一种计算机设备,上述计算机设备包括:输入/输出(I/O)接口、处理器和存储器,上述存储器中存储有程序指令;
上述处理器用于执行存储器中存储的程序指令,执行如上述第二方面上述的方法。
本申请实施例又一方面提供了一种计算机可读存储介质,上述计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行上述第一方面上述的方法。
本申请实施例又一方面提供了一种计算机可读存储介质,上述计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行上述第二方面上述的方法。
本申请实施例又一方面提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第一方面上述的方法。
本申请实施例又一方面提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第二方面上述的方法。
本申请实施例,在事件识别过程中结合触发词和触发词的上下文词语进行识别,采用这种词分类的方法进行事件识别,不仅可以提高识别效率,而且结合上下文词语进行识别,可以提高事件识别的准确度。
附图说明
图1是本申请实施例中事件识别模型训练的系统的一实施例示意图;
图2是本申请实施例中事件识别模型训练的方法的一实施例示意图;
图3是本申请实施例中事件识别模型训练的向量化表示的一示例示意图;
图4是本申请实施例中事件识别应用的一场景示例示意图;
图5是本申请实施例中事件识别的方法的一实施例示意图;
图6是本申请实施例中事件识别的向量化表示的一示例示意图;
图7是本申请实施例中事件识别的装置的一实施例示意图;
图8是本申请实施例中事件识别模型训练的装置的一实施例示意图;
图9是本申请实施例中计算机设备的一实施例示意图。
具体实施方式
下面结合附图,对本申请的实施例进行描述,显然,所描述的实施例仅仅是本申请一部分的实施例,而不是全部的实施例。本领域普通技术人员可知,随着技术的发展和新场景的出现,本申请实施例提供的技术方案对于类似的技术问题,同样适用。
本申请实施例提一种事件识别的方法,可以高效准确的识别出各种类型的事件。本申请实施例还提供了相应事件识别模型训练的方法、设备及计算机可读存储介质。以下分别进行详细说明。
事件识别是基于事件识别模型的,下面先介绍本申请实施例中事件识别模型的训练过程。
图1是本申请实施例中事件识别模型训练的系统的一实施例示意图。
如图1所示,本申请实施例提供的事件识别模型训练的系统包括计算机设备10和数据库20,数据库20中存储有用于事件识别模型训练的样本集合。其中,样本集合中包括多个样本事件各自对应的样本语句和多个样本事件各自的类型。样本事件是指用作样本的事件,事件是发生在某个特定时间或时间段、在某个特定地域范围内,由一个或多个角色参与的,由一个或多个动作构成的事情或状态的改变。当然,没有时间和地点,只是由角色和动作构成的事情或状态的改变也可以称为事件。样本事件的样本语句可以是用于描述该样本事件的核心语句,如样本事件为新闻事件,该样本语句可以为该新闻事件的标题。
每个样本语句中包括触发词和触发词的上下文词语,触发词是样本语句中最能指示该样本事件发生的词。例如:王小五和张小花在深圳结婚了。其中,“结婚”最能指示该这个事件,则“结婚”为触发词。在一起场景中,相同的词可能具有不同的含义,这样,就需要结合上下文词语进行事件识别。如:语句一:“昨天下午,他离开公司后直接去了超市”。语句二:“爷爷永远地离开了我们,但是我们不会忘记他”。语句一中“离开”表示下班,语句二中“离 开”表示去世。所以可见,相同的触发词可能指示了不同的事件类型。所以,需要结合触发词的上下文词语,这样就可以准确的识别出事件的类型。在识别模型训练过程中,针对每个样本事件都会预先标记好该样本事件的类型。这样,计算机设备10就可以使用样本集合中的样本语句和事件的类型进行模型训练,从而训练出用于事件识别的模型。
下面结合图2介绍本申请实施例中事件识别模型训练的方法。
如图2所示,本申请实施例提供的事件识别模型训练的方法的一实施例包括:
101、计算机设备获取用于模型训练的样本集合,样本集合中包括多个样本事件各自对应的样本语句和多个样本事件各自的类型,每个样本语句中包括触发词和触发词的上下文词语。
102、计算机设备根据每个样本语句训练第一事件识别模型,以得到第二事件识别模型,第二事件识别模型用于通过目标语句中的触发词和目标语句中的触发词的上下文词语确定目标事件的类型,目标语句为用于识别目标事件所属类型的语句。
本申请实施例中,在事件识别模型训练过程中,就结合样本事件的样本语句中的触发词和触发词的上下文词语,以及样本事件的类型进行模型训练,从而可以确保训练出能准确进行事件识别的事件识别模型。
其中,可选地,计算机设备根据每个样本语句训练第一事件识别模型,以得到第二事件识别模型,可以包括:
计算机设备对第一样本语句进行预处理,以得到第一样本语句中的每个词语,第一样本语句为每个样本语句中的任意一个样本语句;
计算机设备对每个词语进行向量转换处理,以得到每个词语的输入层向量;
计算机设备根据每个词语的输入层向量,以及第一样本语句所对应的样本事件的类型训练第一事件识别模型,以得到第二事件识别模型。
其中,计算机设备对第一样本语句进行预处理,以得到第一样本语句中的每个词语,可以包括:
计算机设备识别出第一样本语句中的命名实体,命名实体为目标事件中的 参与对象;
计算机设备对命名实体进行匿名化处理;
计算机设备将匿名化处理后的第一样本语句划分为词序列,以得到第一样本语句中的每个词语。
本申请实施例中,预处理的过程包括匿名化处理和对语句的词划分,匿名化是针对命名实体的,命名实体可以是人物,也可以是公司或者其他参与该事件的角色对象。对命名实体进行匿名化可以避免在训练过程中将该命名实体作为强特征将该命名实体与该事件的类型建立必然联系。如:“潘长江参加春晚演出”。该事件的类型是“演出”。如果不匿名化处理,很有可能会建立潘长江与演出之间的必然联系,在模型训练好后,在事件识别的过程中,很可能识别到“潘长江”这个命名实体,就会将相关事件识别是演出事件。但很可能“潘长江”参加的是其他的事件,例如:潘长江的女儿结婚。这是一个结婚事件,该事件的类型为“结婚”,而不是“演出”。所以,在模型训练的过程中对命名实体进行匿名化处理可以使模型学习到正确的特征,并且有利于提高模型的泛化能力。
匿名化就是隐匿具体信息,只保留该信息是命名实体这一类型信息即可,如:潘长江的女儿结婚。匿名化处理后可以为:PER的PER结婚。PER用于表示该位置的词语属于命名实体。
匿名化处理后进行词划分,词划分就是将语句划分为词语,如:“PER的PER结婚”可以划分为“PER”、“的”、“PER”、“结婚”几个词语。
另外,需要说明的是,本申请实施例中,对事件的识别是通过对触发词的识别完成的,在事件识别模型训练阶段,因为样本事件的类型是已知的,所以也可以认为该样本事件的样本语句中的触发词能指示该样本事件的类型。
在模型训练过程中计算机设备可以将每个词语作为候选的触发词,并对其进行分类,这里的目标类别是预先定义好的事件类型,并引入一个NA类别,表示非事件。一条标注数据可以拆分成多条训练样本,上面的例子“潘长江的女儿结婚”可以拆分成如下表1中的四条样本:
表1
候选触发词 所在上下文 类别
潘长江 潘长江的女儿结婚 NA
潘长江 女儿结婚 NA
女儿 潘长江的 女儿结婚 NA
结婚 潘长江的女儿 结婚 结婚
当“结婚”为触发词时,“潘长江”、“的”和“女儿”这三个词为触发词的上下文词语。在样本语句中,确定好触发词和上下文词语后就开始进行向量层面上的处理。
本申请实施例中,无论是第一事件识别模型,还是第二事件识别模型都包括三层全连接神经网络,该三层分别是输入层、隐藏层和输出层,在事件识别过程中,每层都有相应的功能,如:在输入层就会将触发词和上下文词语都转换为输入层向量,然后再根据输入层与隐藏层之间的关系,将输入层向量转换为隐藏层向量。将词语转换为输入层向量可以通过查找向量表的方式实现。
可选地,计算机设备根据每个词语的输入层向量,以及第一样本语句所对应的样本事件的类型训练第一事件识别模型,以得到第二事件识别模型,可以包括:
计算机设备将每个词语的输入层向量转换为隐藏层向量,每个词语包括第一词语,第一词语为每个词语中的触发词;
计算机设备根据每个第二词语的隐藏层向量、第一词语的隐藏层向量以及任意一个第二词语的隐藏层向量,确定任意一个第二词语的关注度权重,第二词语为除第一词语之外的词语;
计算机设备根据每个第二词语的输入层向量和每个第二词语的关注度权重确定第一词语的上下文向量;
计算机设备根据第一词语的上下文向量和第一词语的输入层向量,以及第一样本语句所对应的样本事件的类型,确定第一事件识别模型的参数,以得到第二事件识别模型。
本申请实施例中,如图3所示,将输入层向量转换为隐藏层向量可以通过公式
Figure PCTCN2019089068-appb-000001
来完成,其中,w可以为样本语句中每个词语的输入层向量,W是转换矩阵,
Figure PCTCN2019089068-appb-000002
为与w对应的隐藏层向量,f(.)是非线性函数,例如双 曲正切tanh(.)。
因为本申请实施例的方案中涉及到触发词的上下文词语,所以需要确定该触发词的上下文向量,确定该触发词的上下文向量需要先确定该触发词的上下文词语的关注度权重,也就是各上下文词语与触发词相关的权重。
确定上下文词语的关注度权重可以通过公式如下公式计算得到:
Figure PCTCN2019089068-appb-000003
其中,n表示样本语句中总词语的数量,n-1表示样本语句中上下文词语的数量,也就是除作为触发词的第一词语之外的第二词语的数量,α j表示n-1个第二词语中第j个第二词语的关注度权重,
Figure PCTCN2019089068-appb-000004
为第一词语的隐藏层向量,
Figure PCTCN2019089068-appb-000005
表示第j个第二词语的隐藏层向量的转置,
Figure PCTCN2019089068-appb-000006
表示第i个第二词语的隐藏层向量的转置,其中,i的取值为从1到n-1的整数,j的取值为从1到n-1的整数。
α j确定后,可以通过如下公式确定作为触发词的第一词语的上下文向量:
Figure PCTCN2019089068-appb-000007
其中,c为第一词语的上下文向量,wj为第j个第二词语的输入层向量,α j T为第j个第二词语的关注度权重的转置,j的取值为从1到n-1的整数。
在c确定后,可以通过c和第一词语的输入层向量w,以及样本语句所对应的样本事件的类型,确定第一事件识别模型的参数θ。
c和w经过隐藏层和输入层两次矩阵转换后,会输入向量O,O中的第i个元素表示事件识别模型将给定样本语句判断为事件类型i的置信度。
为了获得条件概率p(i|x,θ),对包含预先配置的事件的m个类型置信度的向量O进行softmax归一化操作:
Figure PCTCN2019089068-appb-000008
k表示第k个事件类型,用于训练的样本集合{(X(i);y(i))},若一共有T个,则事件识别模型的损失函数定义为:
Figure PCTCN2019089068-appb-000009
可以采用随机梯度下降法,从而计算出θ的取值。
以上多个实施例描述了事件识别模型训练的过程,事件识别模型训练好后,可以使用该事件识别模型进行事件识别,事件识别可以应用于新闻推荐中,如图4所示,计算机设备10通过网络30可以与终端设备40通信,该计算机设备10可以用于事件识别。终端设备40的新闻界面上设置不同事件类型的显示位,计算机设备10识别出事件的类型后,将该类型的事件推送给终端设备40,终端设备40会根据新闻事件的类型将该新闻放到相应类型的展示位进行展示。图4中只是列举了几个不同的事件类型,事件类型的数量可以根据需求设置或修改。本申请实施例中事件类型也就是事件的类型。
下面结合图5介绍本申请实施例中事件识别的方法。如图5所示,本申请实施例提供的事件识别的方法的一实施例包括:
201、终端设备获取用于识别目标事件所属类型的目标语句。
若一个与手机发布相关的新闻,如:标题为“iphoneX发布”的新闻事件,则可以将标题“iphoneX发布”确定为目标语句。
202、终端设备基于事件识别模型处理目标语句,以得到目标事件的类型,其中,事件识别模型用于通过目标语句中的触发词和触发词的上下文词语确定目标事件的类型,触发词用于指示目标事件的备选类型,备选类型包括目标事件的类型。
203、终端设备输出目标事件的类型。
本申请实施例,在事件识别过程中结合触发词和触发词的上下文词语进行识别,采用这种词分类的方法进行事件识别,不仅可以提高识别效率,而且结 合上下文词语进行识别,可以提高事件识别的准确度。
可选地,终端设备基于事件识别模型处理目标语句,以得到目标事件的类型,可以包括:
终端设备对目标语句进行预处理,以得到目标语句中的每个词语;
终端设备对每个词语进行向量转换处理,以得到每个词语的输入层向量;
终端设备根据每个词语的输入层向量,确定目标事件的类型。
其中,终端设备对目标语句进行预处理,以得到目标语句中的每个词语,可以包括:
终端设备识别出目标语句中的命名实体,命名实体为目标事件中的参与对象;
终端设备对命名实体进行匿名化处理;
终端设备将匿名化处理后的目标语句划分为词序列,以得到目标语句中的每个词语。
本申请实施例中,预处理的过程包括匿名化处理和对语句的词划分,匿名化是针对命名实体的,命名实体可以是人物,也可以是公司或者其他参与该事件的角色对象。对命名实体进行匿名化可以避免在训练过程中将该命名实体作为强特征将该命名实体与该事件的类型建立必然联系。如:“潘长江参加春晚演出”。该事件的类型是“演出”。如果不匿名化处理,很有可能会建立潘长江与演出之间的必然联系,在事件识别的过程中,很可能识别到“潘长江”这个命名实体,就会将相关事件识别是演出事件。但很可能“潘长江”参加的是其他的事件,例如:潘长江的女儿结婚。这是一个结婚事件,该事件的类型为“结婚”,而不是“演出”。所以在事件识别的过程中会将命名实体匿名化,以避免命名实体对事件识别的干扰,而且也不用具体分析该命名实体,还可以提高识别效率。
匿名化就是隐匿具体信息,只保留该信息是命名实体这一类型信息即可,如:潘长江的女儿结婚。匿名化处理后可以为:PER的PER结婚。PER用于表示该位置的词语属于命名实体。
匿名化处理后进行词划分,词划分就是将语句划分为词语,如:“PER的PER结婚”可以划分为“PER”、“的”、“PER”、“结婚”几个词语。
可选地,终端设备根据每个词语的输入层向量,确定目标事件的类型,可以包括:
终端设备将每个词语的输入层向量转换为隐藏层向量,每个词语包括第一词语,第一词语为每个词语中的任一词语;
终端设备将第一词语作为触发词时,根据每个第二词语的隐藏层向量、第一词语的隐藏层向量以及任意一个第二词语的隐藏层向量,确定任意一个第二词语的关注度权重,第二词语为除第一词语之外的词语;
终端设备根据每个第二词语的输入层向量和每个第二词语的关注度权重确定第一词语的上下文向量;
终端设备根据第一词语的上下文向量和第一词语的输入层向量,确定目标事件的类型。
本申请实施例中,如图6所示,将输入层向量转换为隐藏层向量可以通过公式
Figure PCTCN2019089068-appb-000010
来完成,其中,w可以为样本语句中每个词语的输入层向量,W是转换矩阵,
Figure PCTCN2019089068-appb-000011
为与w对应的隐藏层向量,f(.)是非线性函数,例如双曲正切tanh(.)。
因为本申请实施例的方案中涉及到触发词的上下文词语,所以需要确定该触发词的上下文向量,确定该触发词的上下文向量需要先确定该触发词的上下文词语的关注度权重,也就是各上下文词语与触发词相关的权重。
确定上下文词语的关注度权重可以通过公式如下公式计算得到:
Figure PCTCN2019089068-appb-000012
其中,n表示样本语句中总词语的数量,n-1表示样本语句中上下文词语的数量,也就是除作为触发词的第一词语之外的第二词语的数量,α j表示n-1个第二词语中第j个第二词语的关注度权重,
Figure PCTCN2019089068-appb-000013
为第一词语的隐藏层向量,
Figure PCTCN2019089068-appb-000014
表示第j个第二词语的隐藏层向量的转置,
Figure PCTCN2019089068-appb-000015
表示第i个第二词语的隐藏层向量的转置,其中,i的取值为从1到n-1的整数,j的取值为从1到n-1的整数。
α j确定后,可以通过如下公式确定作为触发词的第一词语的上下文向量:
Figure PCTCN2019089068-appb-000016
其中,c为第一词语的上下文向量,w j为第j个第二词语的输入层向量,α j T为第j个第二词语的关注度权重的转置,j的取值为从1到n-1的整数。
在c确定后,可以通过c和第一词语的输入层向量w,确定目标事件的类型。
可选地,终端设备根据第一词语的上下文向量和第一词语的输入层向量,确定目标事件的类型,可以包括:
终端设备根据第一词语的上下文向量、第一词语的输入层向量与事件识别模型的参数,确定第一词语为触发词时,目标事件属于每个备选类型的置信度;
终端设备根据目标事件属于每个备选类型的置信度,确定目标事件的类型。
本申请实施例中,事件识别模型的参数θ经过图3所示的模型训练过程已经确定取值,所以可以通过c、w和θ经过隐藏层和输入层两次矩阵转换后得到输入向量O,O中的第i个元素表示事件识别模型将给目标样本判断为类型i的置信度。
为了获得条件概率p(i|x,θ),对包含预先配置的事件的m个类型置信度的向量O进行softmax归一化操作:
Figure PCTCN2019089068-appb-000017
k表示第k个事件类型,用于训练的样本集合{(X(i);y(i))},若一共有T个,则事件识别模型的损失函数定义为:
Figure PCTCN2019089068-appb-000018
可以采用随机梯度下降法,从而计算出y(i),也就是目标事件属于各种的类型的概率。在目标事件的类型确定的过程中,会选择最大的y(i)的类型作为目标事件的类型。
可选地,本申请实施例中,终端设备基于事件识别模型处理目标语句,以得到目标事件的类型,可以包括:
终端设备对目标语句进行预处理,以得到目标语句中的每个词语;
终端设备确定目标语句中属于触发词的第一词语;
终端设备根据第一词语所对应的备选类型,以及第二词语确定目标事件的类型,第二词语为第一词语的上下文词语。
本申请实施例中,可以预先标记一些能作为触发词的词语与事件的类型的对应关系,即使是有同一个触发词对应不同的事件的类型的情况,也可以缩小计算的范围。其他与向量计算相关的部分可以参阅前述实施例的相应内容进行理解,本处不做重复赘述。
以上介绍了本申请实施例中模型训练和事件识别的过程,下面结合附图介绍本申请实施例中的装置及设备。
如图7所示,本申请实施例提供的事件识别的装置50的一实施例,上述装置50可以安装在终端设备中,包括:
获取单元501,设置为获取用于识别目标事件所属类型的目标语句;
处理单元502,设置为基于事件识别模型处理获取单元501获取的目标语句,以得到目标事件的类型,其中,事件识别模型用于通过目标语句中的触发词和触发词的上下文词语确定目标事件的类型,触发词用于指示目标事件的备选类型,备选类型包括目标事件的类型;
输出单元503,设置为输出处理单元502确定的目标事件的类型。
本申请实施例,在事件识别过程中结合触发词和触发词的上下文词语进行识别,采用这种词分类的方法进行事件识别,不仅可以提高识别效率,而且结合上下文词语进行识别,可以提高事件识别的准确度。
可选地,处理单元502设置为:
对目标语句进行预处理,以得到目标语句中的每个词语;
对每个词语进行向量转换处理,以得到每个词语的输入层向量;
根据每个词语的输入层向量,确定目标事件的类型。
可选地,处理单元502设置为:
将每个词语的输入层向量转换为隐藏层向量,每个词语包括第一词语,第一词语为每个词语中的任一词语;
将第一词语作为触发词时,根据每个第二词语的隐藏层向量、第一词语的隐藏层向量以及任意一个第二词语的隐藏层向量,确定任意一个第二词语的关注度权重,第二词语为除第一词语之外的词语;
根据每个第二词语的输入层向量和每个第二词语的关注度权重确定第一词语的上下文向量;
根据第一词语的上下文向量和第一词语的输入层向量,确定目标事件的类型。
可选地,处理单元502设置为:
根据第一词语的上下文向量、第一词语的输入层向量与事件识别模型的参数,确定第一词语为触发词时,目标事件属于每个备选类型的置信度;
根据目标事件属于每个备选类型的置信度,确定目标事件的类型。
可选地,处理单元502设置为:
识别出目标语句中的命名实体,命名实体为目标事件中的参与对象;
对命名实体进行匿名化处理;
将匿名化处理后的目标语句划分为词序列,以得到目标语句中的每个词语。
可选地,处理单元502设置为:
对目标语句进行预处理,以得到目标语句中的每个词语;
确定目标语句中属于触发词的第一词语;
根据第一词语所对应的备选类型,以及第二词语确定目标事件的类型,第二词语为第一词语的上下文词语。
以上对事件识别的装置50的介绍可以结合上述事件识别的方法部分的相 应内容进行理解,本处不再做重复赘述。
参阅图8,本申请实施例提供的事件识别模型训练的装置60的一实施例,上述装置60可以安装在计算机设备中,包括:
获取单元601,设置为获取用于模型训练的样本集合,样本集合中包括多个样本事件各自对应的样本语句和多个样本事件各自的类型,每个样本语句中包括触发词和触发词的上下文词语;
模型训练单元602,设置为根据获取单元601获取的每个样本语句训练第一事件识别模型,以得到第二事件识别模型,第二事件识别模型用于通过目标语句中的触发词和目标语句中的触发词的上下文词语确定目标事件的类型,目标语句为用于识别目标事件所属类型的语句。
本申请实施例中,在事件识别模型训练过程中,就结合样本事件的样本语句中的触发词和触发词的上下文词语,以及样本事件的类型进行模型训练,从而可以确保训练出能准确进行事件识别的事件识别模型。
可选地,模型训练单元602设置为:
对第一样本语句进行预处理,以得到第一样本语句中的每个词语,第一样本语句为每个样本语句中的任意一个样本语句;
对每个词语进行向量转换处理,以得到每个词语的输入层向量;
根据每个词语的输入层向量,以及第一样本语句所对应的样本事件的类型训练第一事件识别模型,以得到第二事件识别模型。
可选地,模型训练单元602设置为:
将每个词语的输入层向量转换为隐藏层向量,每个词语包括第一词语,第一词语为每个词语中的触发词;
根据每个第二词语的隐藏层向量、第一词语的隐藏层向量以及任意一个第二词语的隐藏层向量,确定任意一个第二词语的关注度权重,第二词语为除第一词语之外的词语;
根据每个第二词语的输入层向量和每个第二词语的关注度权重确定第一词语的上下文向量;
根据第一词语的上下文向量和第一词语的输入层向量,以及第一样本语句 所对应的样本事件的类型,确定第一事件识别模型的参数,以得到第二事件识别模型。
可选地,模型训练单元602设置为:
识别出第一样本语句中的命名实体,命名实体为目标事件中的参与对象;
对命名实体进行匿名化处理;
将匿名化处理后的第一样本语句划分为词序列,以得到第一样本语句中的每个词语。
以上对事件识别模型训练的装置60的介绍可以结合上述事件识别模型训练的方法部分的相应内容进行理解,本处不再做重复赘述。
图9是本申请实施例提供的计算机设备70的结构示意图。计算机设备70包括处理器710、存储器740和输入输出(I/O)接口730,存储器740可以包括只读存储器和随机存取存储器,并向处理器710提供操作指令和数据。存储器740的一部分还可以包括非易失性随机存取存储器(NVRAM)。
在一些实施方式中,存储器740存储了如下的元素,可执行模块或者数据结构,或者他们的子集,或者他们的扩展集:
在本申请实施例中,在事件识别的过程中,通过调用存储器740存储的操作指令(该操作指令可存储在操作系统中),
获取用于识别目标事件所属类型的目标语句;
基于事件识别模型处理目标语句,以得到目标事件的类型,其中,事件识别模型用于通过目标语句中的触发词和触发词的上下文词语确定目标事件的类型,触发词用于指示目标事件的备选类型,备选类型包括目标事件的类型;
输出目标事件的类型。
本申请实施例,在事件识别过程中结合触发词和触发词的上下文词语进行识别,采用这种词分类的方法进行事件识别,不仅可以提高识别效率,而且结合上下文词语进行识别,可以提高事件识别的准确度。
处理器710控制计算机设备70的操作,处理器710还可以称为CPU(Central Processing Unit,中央处理单元)。存储器740可以包括只读存储器和随机存取存储器,并向处理器710提供指令和数据。存储器740的一部分还可以包括非易 失性随机存取存储器(NVRAM)。具体的应用中计算机设备70的各个组件通过总线系统720耦合在一起,其中总线系统720除包括数据总线之外,还可以包括电源总线、控制总线和状态信号总线等。但是为了清楚说明起见,在图中将各种总线都标为总线系统720。
上述本申请实施例揭示的方法可以应用于处理器710中,或者由处理器710实现。处理器710可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器710中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器710可以是通用处理器、数字信号处理器(DSP)、专用集成电路(ASIC)、现成可编程门阵列(FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器740,处理器710读取存储器740中的信息,结合其硬件完成上述方法的步骤。
可选地,处理器710用于:
对目标语句进行预处理,以得到目标语句中的每个词语;
对每个词语进行向量转换处理,以得到每个词语的输入层向量;
根据每个词语的输入层向量,确定目标事件的类型。
可选地,处理器710用于:
将每个词语的输入层向量转换为隐藏层向量,每个词语包括第一词语,第一词语为每个词语中的任一词语;
将第一词语作为触发词时,根据每个第二词语的隐藏层向量、第一词语的隐藏层向量以及任意一个第二词语的隐藏层向量,确定任意一个第二词语的关注度权重,第二词语为除第一词语之外的词语;
根据每个第二词语的输入层向量和每个第二词语的关注度权重确定第一 词语的上下文向量;
根据第一词语的上下文向量和第一词语的输入层向量,确定目标事件的类型。
可选地,处理器710用于:
根据第一词语的上下文向量、第一词语的输入层向量与事件识别模型的参数,确定第一词语为触发词时,目标事件属于每个备选类型的置信度;
根据目标事件属于每个备选类型的置信度,确定目标事件的类型。
可选地,处理器710用于:
识别出目标语句中的命名实体,命名实体为目标事件中的参与对象;
对命名实体进行匿名化处理;
将匿名化处理后的目标语句划分为词序列,以得到目标语句中的每个词语。
可选地,处理器710用于:
对目标语句进行预处理,以得到目标语句中的每个词语;
确定目标语句中属于触发词的第一词语;
根据第一词语所对应的备选类型,以及第二词语确定目标事件的类型,第二词语为第一词语的上下文词语。
另外,用于事件识别模型训练的计算机设备也可以参阅图9进行理解。在用于事件识别模型训练过程中:
处理器710用于:
获取用于模型训练的样本集合,样本集合中包括多个样本事件各自对应的样本语句和多个样本事件各自的类型,每个样本语句中包括触发词和触发词的上下文词语;
根据每个样本语句训练第一事件识别模型,以得到第二事件识别模型,第二事件识别模型用于通过目标语句中的触发词和目标语句中的触发词的上下文词语确定目标事件的类型,目标语句为用于识别目标事件所属类型的语句。
可选地,处理器710用于:
对第一样本语句进行预处理,以得到第一样本语句中的每个词语,第一样本语句为每个样本语句中的任意一个样本语句;
对每个词语进行向量转换处理,以得到每个词语的输入层向量;
根据每个词语的输入层向量,以及第一样本语句所对应的样本事件的类型训练第一事件识别模型,以得到第二事件识别模型。
可选地,处理器710用于:
将每个词语的输入层向量转换为隐藏层向量,每个词语包括第一词语,第一词语为每个词语中的触发词;
根据每个第二词语的隐藏层向量、第一词语的隐藏层向量以及任意一个第二词语的隐藏层向量,确定任意一个第二词语的关注度权重,第二词语为除第一词语之外的词语;
根据每个第二词语的输入层向量和每个第二词语的关注度权重确定第一词语的上下文向量;
根据第一词语的上下文向量和第一词语的输入层向量,以及第一样本语句所对应的样本事件的类型,确定第一事件识别模型的参数,以得到第二事件识别模型。
可选地,处理器710用于:
识别出第一样本语句中的命名实体,命名实体为目标事件中的参与对象;
对命名实体进行匿名化处理;
将匿名化处理后的第一样本语句划分为词序列,以得到第一样本语句中的每个词语。
上对计算机设备70的描述可以参阅图1至图6部分的描述进行理解,本处不再重复赘述。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。
所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功 能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存储的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘Solid State Disk(SSD))等。
本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于一计算机可读存储介质中,存储介质可以包括:ROM、RAM、磁盘或光盘等。
以上对本申请实施例所提供的事件识别的方法、事件识别模型训练的方法、装置、设备以及计算机可读存储介质进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。
工业实用性
本申请采用了获取用于识别目标事件所属类型的目标语句,基于事件识别模型处理所述目标语句,以得到所述目标事件的类型,输出所述目标事件的类型的方法,从而可以在事件识别过程中结合触发词和触发词的上下文词语进行识别,采用这种词分类的方法进行事件识别,不仅可以提高识别效率,而且结合上下文词语进行识别,可以提高事件识别的准确度。

Claims (15)

  1. 一种事件识别的方法,包括:
    终端设备获取用于识别目标事件所属类型的目标语句;
    所述终端设备基于事件识别模型处理所述目标语句,以得到所述目标事件的类型,其中,所述事件识别模型用于通过所述目标语句中的触发词和所述触发词的上下文词语确定所述目标事件的类型,所述触发词用于指示所述目标事件的备选类型,所述备选类型包括所述目标事件的类型;
    所述终端设备输出所述目标事件的类型。
  2. 根据权利要求1所述的方法,其中,所述终端设备基于事件识别模型处理所述目标语句,以得到所述目标事件的类型,包括:
    所述终端设备对所述目标语句进行预处理,以得到所述目标语句中的每个词语;
    所述终端设备对所述每个词语进行向量转换处理,以得到所述每个词语的输入层向量;
    所述终端设备根据所述每个词语的输入层向量,确定所述目标事件的类型。
  3. 根据权利要求2所述的方法,其中,所述终端设备根据所述每个词语的输入层向量,确定所述目标事件的类型,包括:
    所述终端设备将所述每个词语的输入层向量转换为隐藏层向量,所述每个词语包括第一词语,所述第一词语为所述每个词语中的任一词语;
    所述终端设备将所述第一词语作为触发词时,根据每个第二词语的隐藏层向量、所述第一词语的隐藏层向量以及任意一个第二词语的隐藏层向量,确定所述任意一个第二词语的关注度权重,所述第二词语为除所述第一词语之外的词语;
    所述终端设备根据每个第二词语的输入层向量和所述每个第二词语的关注度权重确定所述第一词语的上下文向量;
    所述终端设备根据所述第一词语的上下文向量和所述第一词语的输入层向量,确定所述目标事件的类型。
  4. 根据权利要求3所述的方法,其中,所述终端设备根据所述第一词语的上下文向量和所述第一词语的输入层向量,确定所述目标事件的类型,包括:
    所述终端设备根据所述第一词语的上下文向量、所述第一词语的输入层向量与所述事件识别模型的参数,确定所述第一词语为所述触发词时,所述目标事件属于每个备选类型的置信度;
    所述终端设备根据所述目标事件属于所述每个备选类型的置信度,确定所述目标事件的类型。
  5. 根据权利要求2-4任一所述的方法,其中,所述终端设备对所述目标语句进行预处理,以得到所述目标语句中的每个词语,包括:
    所述终端设备识别出所述目标语句中的命名实体,所述命名实体为所述目标事件中的参与对象;
    所述终端设备对所述命名实体进行匿名化处理;
    所述终端设备将匿名化处理后的所述目标语句划分为词序列,以得到所述目标语句中的每个词语。
  6. 根据权利要求1所述的方法,其中,所述终端设备基于事件识别模型处理所述目标语句,以得到所述目标事件的类型,包括:
    所述终端设备对所述目标语句进行预处理,以得到所述目标语句中的每个词语;
    所述终端设备确定所述目标语句中属于触发词的第一词语;
    所述终端设备根据所述第一词语所对应的备选类型,以及第二词语确定所述目标事件的类型,所述第二词语为所述第一词语的上下文词语。
  7. 一种事件识别模型训练的方法,包括:
    计算机设备获取用于模型训练的样本集合,所述样本集合中包括多个样本事件各自对应的样本语句和所述多个样本事件各自的类型,每个样本语句中包括触发词和所述触发词的上下文词语;
    所述计算机设备根据所述每个样本语句训练第一事件识别模型,以得到第二事件识别模型,所述第二事件识别模型用于通过目标语句中的触发词和所述目标语句中的触发词的上下文词语确定目标事件的类型,所述目标语句为用于识别目标事件所属类型的语句。
  8. 根据权利要求7所述的方法,其中,所述计算机设备根据所述每个样本语句训练第一事件识别模型,以得到第二事件识别模型,包括:
    所述计算机设备对第一样本语句进行预处理,以得到所述第一样本语句中的每个词语,所述第一样本语句为所述每个样本语句中的任意一个样本语句;
    所述计算机设备对所述每个词语进行向量转换处理,以得到所述每个词语的输入层向量;
    所述计算机设备根据所述每个词语的输入层向量,以及所述第一样本语句所对应的样本事件的类型训练所述第一事件识别模型,以得到所述第二事件识别模型。
  9. 根据权利要求8所述的方法,其中,所述计算机设备根据所述每个词语的输入层向量,以及所述第一样本语句所对应的样本事件的类型训练所述第一事件识别模型,以得到所述第二事件识别模型,包括:
    所述计算机设备将所述每个词语的输入层向量转换为隐藏层向量,所述每个词语包括第一词语,所述第一词语为所述每个词语中的触发词;
    所述计算机设备根据每个第二词语的隐藏层向量、所述第一词语的隐藏层向量以及任意一个第二词语的隐藏层向量,确定所述任意一个第二词语的关注度权重,所述第二词语为除所述第一词语之外的词语;
    所述计算机设备根据每个第二词语的输入层向量和所述每个第二词语的关注度权重确定所述第一词语的上下文向量;
    所述计算机设备根据所述第一词语的上下文向量和所述第一词语的输入层向量,以及所述第一样本语句所对应的样本事件的类型,确定所述第一事件识别模型的参数,以得到所述第二事件识别模型。
  10. 根据权利要求8或9所述的方法,其中,所述计算机设备对第一样本语句进行预处理,以得到所述第一样本语句中的每个词语,包括:
    所述计算机设备识别出所述第一样本语句中的命名实体,所述命名实体为所述目标事件中的参与对象;
    所述计算机设备对所述命名实体进行匿名化处理;
    所述计算机设备将匿名化处理后的所述第一样本语句划分为词序列,以得到所述第一样本语句中的每个词语。
  11. 一种事件识别的装置,安装在终端设备中,包括:
    获取单元,设置为获取用于识别目标事件所属类型的目标语句;
    处理单元,设置为基于事件识别模型处理所述获取单元获取的所述目标语句,以得到所述目标事件的类型,其中,所述事件识别模型用于通过所述目标语句中的触发词和所述触发词的上下文词语确定所述目标事件的类型,所述触发词用于指示所述目标事件的备选类型,所述备选类型包括所述目标事件的类型;
    输出单元,设置为输出所述处理单元确定的所述目标事件的类型。
  12. 一种事件识别模型训练的装置,安装在计算机设备中,包括:
    获取单元,设置为获取用于模型训练的样本集合,所述样本集合中包括多个样本事件各自对应的样本语句和所述多个样本事件各自的类型,每个样本语句中包括触发词和所述触发词的上下文词语;
    模型训练单元,设置为根据所述获取单元获取的所述每个样本语句训练第一事件识别模型,以得到第二事件识别模型,所述第二事件识别模型用于通过目标语句中的触发词和所述目标语句中的触发词的上下文词语确定目标事件的类型,所述目标语句为用于识别目标事件所属类型的语句。
  13. 一种终端设备,所述终端设备包括:输入/输出(I/O)接口、处理器和存储器,所述存储器中存储有程序指令;
    所述处理器用于执行存储器中存储的程序指令,执行如权利要求1-6任一所述的方法。
  14. 一种计算机设备,所述计算机设备包括:输入/输出(I/O)接口、处理器和存储器,所述存储器中存储有程序指令;
    所述处理器用于执行存储器中存储的程序指令,执行如权利要求7-10任一所述的方法。
  15. 一种计算机可读存储介质,包括指令,当所述指令在计算机设备上运行时,使得所述计算机设备执行如权利要求1-6中任一项所述的方法或权利要求7-10任一所述的方法。
PCT/CN2019/089068 2018-07-03 2019-05-29 一种事件识别的方法、模型训练的方法、设备及存储介质 Ceased WO2020007138A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US16/998,518 US11972213B2 (en) 2018-07-03 2020-08-20 Event recognition method and apparatus, model training method and apparatus, and storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810716380.7A CN110209807A (zh) 2018-07-03 2018-07-03 一种事件识别的方法、模型训练的方法、设备及存储介质
CN201810716380.7 2018-07-03

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US16/998,518 Continuation US11972213B2 (en) 2018-07-03 2020-08-20 Event recognition method and apparatus, model training method and apparatus, and storage medium

Publications (1)

Publication Number Publication Date
WO2020007138A1 true WO2020007138A1 (zh) 2020-01-09

Family

ID=67779777

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/089068 Ceased WO2020007138A1 (zh) 2018-07-03 2019-05-29 一种事件识别的方法、模型训练的方法、设备及存储介质

Country Status (3)

Country Link
US (1) US11972213B2 (zh)
CN (1) CN110209807A (zh)
WO (1) WO2020007138A1 (zh)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111753197A (zh) * 2020-06-18 2020-10-09 达而观信息科技(上海)有限公司 新闻要素的提取方法、装置、计算机设备和存储介质
CN111767730A (zh) * 2020-07-07 2020-10-13 腾讯科技(深圳)有限公司 一种事件类型识别方法及装置
CN112199950A (zh) * 2020-10-16 2021-01-08 支付宝(杭州)信息技术有限公司 用于事件检测的网络训练方法及装置
CN112650919A (zh) * 2020-11-30 2021-04-13 北京百度网讯科技有限公司 实体资讯分析方法、装置、设备及存储介质
CN114580424A (zh) * 2022-04-24 2022-06-03 之江实验室 一种用于法律文书的命名实体识别的标注方法和装置

Families Citing this family (23)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8731954B2 (en) 2006-03-27 2014-05-20 A-Life Medical, Llc Auditing the coding and abstracting of documents
US7908552B2 (en) 2007-04-13 2011-03-15 A-Life Medical Inc. Mere-parsing with boundary and semantic driven scoping
US8682823B2 (en) * 2007-04-13 2014-03-25 A-Life Medical, Llc Multi-magnitudinal vectors with resolution based on source vector features
CN110597994A (zh) * 2019-09-17 2019-12-20 北京百度网讯科技有限公司 事件元素识别方法和装置
CN110674303B (zh) * 2019-09-30 2022-03-01 北京明略软件系统有限公司 事件语句处理方法、装置、计算机设备和可读存储介质
CN111046666B (zh) * 2019-12-19 2023-05-05 天津新开心生活科技有限公司 事件识别方法及装置、计算机可读存储介质、电子设备
CN113111661B (zh) * 2020-01-09 2024-09-10 图灵人工智能研究院(南京)有限公司 文本信息分类方法、系统、设备及可读存储介质
CN111310461B (zh) * 2020-01-15 2023-03-21 腾讯云计算(北京)有限责任公司 事件元素提取方法、装置、设备及存储介质
CN111352965B (zh) * 2020-02-18 2023-09-08 腾讯科技(深圳)有限公司 序列挖掘模型的训练方法、序列数据的处理方法及设备
CN111414736B (zh) * 2020-03-23 2022-05-20 腾讯科技(深圳)有限公司 故事生成模型训练方法、装置、设备及存储介质
CN111967256B (zh) * 2020-06-30 2023-08-04 北京百度网讯科技有限公司 事件关系的生成方法、装置、电子设备和存储介质
CN111967268B (zh) * 2020-06-30 2024-03-19 北京百度网讯科技有限公司 文本中的事件抽取方法、装置、电子设备和存储介质
CN111966890B (zh) * 2020-06-30 2023-07-04 北京百度网讯科技有限公司 基于文本的事件推送方法、装置、电子设备和存储介质
CN112069811B (zh) * 2020-08-24 2024-01-26 武汉大学 多任务交互增强的电子文本事件抽取方法
CN112836504B (zh) * 2021-01-08 2024-02-02 中国人民解放军国防科技大学 一种基于分层策略网络的事件抽取方法及设备
CN113095624A (zh) * 2021-03-17 2021-07-09 中国民用航空总局第二研究所 一种民航机场不安全事件分类方法及系统
CN113111649B (zh) * 2021-04-13 2024-02-20 科大讯飞股份有限公司 事件抽取方法、系统以及设备
CN113111184B (zh) * 2021-04-27 2022-03-08 清华大学深圳国际研究生院 基于显式事件结构知识增强的事件检测方法及终端设备
CN113901170A (zh) * 2021-12-07 2022-01-07 北京道达天际科技有限公司 结合Bert模型和模板匹配的事件抽取方法及系统、电子设备
CN114492439B (zh) * 2021-12-27 2024-11-05 四川新网银行股份有限公司 一种应用深度学习提升舆情预警准确率的系统和方法
CN116049390A (zh) * 2022-11-16 2023-05-02 中国人民解放军国防科技大学 军事事件分类方法、系统、存储介质和电子设备
CN116862002B (zh) * 2023-06-14 2025-12-23 清华大学 事件检测模型的解释方法、装置、电子设备及存储介质
CN118296146B (zh) * 2024-04-16 2025-06-27 中国科学院文献情报中心 一种识别目标语句的方法、设备、介质及程序产品

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102298635A (zh) * 2011-09-13 2011-12-28 苏州大学 事件信息融合方法和系统
CN102521220A (zh) * 2011-11-29 2012-06-27 华中师范大学 一种网络自杀遗书的识别方法
CN104298665A (zh) * 2014-10-16 2015-01-21 苏州大学 一种中文文本中评价对象的识别方法及装置
CN106445999A (zh) * 2016-07-27 2017-02-22 天津海量信息技术股份有限公司 一种基于事件要素的事件抽取方法及系统
CN106933800A (zh) * 2016-11-29 2017-07-07 首都师范大学 一种金融领域的事件句抽取方法

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10276170B2 (en) * 2010-01-18 2019-04-30 Apple Inc. Intelligent automated assistant
CN104462229A (zh) * 2014-11-13 2015-03-25 苏州大学 一种事件分类方法及装置
CN105677873B (zh) * 2016-01-11 2019-03-26 中国电子科技集团公司第十研究所 基于领域知识模型的文本情报关联聚类汇集处理方法
CN106095928B (zh) * 2016-06-12 2019-10-29 国家计算机网络与信息安全管理中心 一种事件类型识别方法及装置
US10318674B2 (en) * 2016-08-30 2019-06-11 Sas Institute Inc. Comparison and selection of experiment designs
KR102692670B1 (ko) * 2017-01-04 2024-08-06 삼성전자주식회사 음성 인식 방법 및 음성 인식 장치
CN106951530B (zh) * 2017-03-21 2020-01-17 苏州大学 一种事件类型抽取方法和装置
US10095716B1 (en) * 2017-04-02 2018-10-09 Sas Institute Inc. Methods, mediums, and systems for data harmonization and data harmonization and data mapping in specified domains
CN107239445A (zh) * 2017-05-27 2017-10-10 中国矿业大学 一种基于神经网络的新闻事件抽取的方法及系统
CN107247706B (zh) * 2017-06-16 2021-06-25 中国电子技术标准化研究院 文本断句模型建立方法、断句方法、装置及计算机设备
US10783274B2 (en) * 2018-02-27 2020-09-22 Sap Se Anonymized data sharing for multitenant document editing engine

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102298635A (zh) * 2011-09-13 2011-12-28 苏州大学 事件信息融合方法和系统
CN102521220A (zh) * 2011-11-29 2012-06-27 华中师范大学 一种网络自杀遗书的识别方法
CN104298665A (zh) * 2014-10-16 2015-01-21 苏州大学 一种中文文本中评价对象的识别方法及装置
CN106445999A (zh) * 2016-07-27 2017-02-22 天津海量信息技术股份有限公司 一种基于事件要素的事件抽取方法及系统
CN106933800A (zh) * 2016-11-29 2017-07-07 首都师范大学 一种金融领域的事件句抽取方法

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111753197A (zh) * 2020-06-18 2020-10-09 达而观信息科技(上海)有限公司 新闻要素的提取方法、装置、计算机设备和存储介质
CN111753197B (zh) * 2020-06-18 2024-04-05 达观数据有限公司 新闻要素的提取方法、装置、计算机设备和存储介质
CN111767730A (zh) * 2020-07-07 2020-10-13 腾讯科技(深圳)有限公司 一种事件类型识别方法及装置
CN111767730B (zh) * 2020-07-07 2023-09-22 腾讯科技(深圳)有限公司 一种事件类型识别方法及装置
CN112199950A (zh) * 2020-10-16 2021-01-08 支付宝(杭州)信息技术有限公司 用于事件检测的网络训练方法及装置
CN112650919A (zh) * 2020-11-30 2021-04-13 北京百度网讯科技有限公司 实体资讯分析方法、装置、设备及存储介质
CN112650919B (zh) * 2020-11-30 2023-09-01 北京百度网讯科技有限公司 实体资讯分析方法、装置、设备及存储介质
CN114580424A (zh) * 2022-04-24 2022-06-03 之江实验室 一种用于法律文书的命名实体识别的标注方法和装置
CN114580424B (zh) * 2022-04-24 2022-08-05 之江实验室 一种用于法律文书的命名实体识别的标注方法和装置

Also Published As

Publication number Publication date
CN110209807A (zh) 2019-09-06
US20200380210A1 (en) 2020-12-03
US11972213B2 (en) 2024-04-30

Similar Documents

Publication Publication Date Title
WO2020007138A1 (zh) 一种事件识别的方法、模型训练的方法、设备及存储介质
US12561724B2 (en) Method and apparatus for generating recommendation reason, and storage medium
CN111881343A (zh) 信息推送方法、装置、电子设备及计算机可读存储介质
CN114547267B (zh) 智能问答模型的生成方法、装置、计算设备和存储介质
WO2020073507A1 (zh) 一种文本分类方法及终端
WO2022048173A1 (zh) 基于人工智能的客户意图识别方法、装置、设备及介质
CN109872242B (zh) 信息推送方法和装置
US20220367051A1 (en) Methods and systems for estimating causal effects from knowledge graphs
CN118134529B (zh) 基于大数据的计算机数据处理方法及系统
WO2018201601A1 (zh) 基于数据源的业务定制装置、方法、系统及存储介质
CN112131261B (zh) 基于社区网络的社区查询方法、装置和计算机设备
CN114357180B (zh) 知识图谱的更新方法及电子设备
Chukova et al. Characterization of the Pólya-Aeppli process
CN109214407B (zh) 事件检测模型、方法、装置、计算设备及存储介质
CN114065045A (zh) 标签管理的方法、装置、设备以及存储介质
WO2019201024A1 (zh) 用于更新模型参数的方法、装置、设备和存储介质
CN112926308B (zh) 匹配正文的方法、装置、设备、存储介质以及程序产品
CN118071403B (zh) 基于微服务架构和中台技术的营销系统开发方法和系统
CN111753199A (zh) 用户画像构建方法及设备、电子设备和介质
CN115375361A (zh) 一种在线广告投放目标人群的选择方法、装置及电子设备
WO2021056734A1 (zh) 好友关系链匹配方法、系统、计算机设备及可读存储介质
CN112257959A (zh) 用户风险预测方法、装置、电子设备及存储介质
CN110363283B (zh) 基于深度学习的用户属性预测方法及相关装置
CN117953240A (zh) 用于获取图像的方法、电子设备和计算机程序产品
CN111695922A (zh) 潜在用户确定方法及装置、存储介质和电子设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19830527

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19830527

Country of ref document: EP

Kind code of ref document: A1