CN111985221A - Text affair relationship identification method, device, equipment and storage medium - Google Patents

Text affair relationship identification method, device, equipment and storage medium Download PDF

Info

Publication number
CN111985221A
CN111985221A CN202010807360.8A CN202010807360A CN111985221A CN 111985221 A CN111985221 A CN 111985221A CN 202010807360 A CN202010807360 A CN 202010807360A CN 111985221 A CN111985221 A CN 111985221A
Authority
CN
China
Prior art keywords
text
recognized
event trigger
constructing
pair
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
CN202010807360.8A
Other languages
Chinese (zh)
Other versions
CN111985221B (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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology 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 Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202010807360.8A priority Critical patent/CN111985221B/en
Publication of CN111985221A publication Critical patent/CN111985221A/en
Application granted granted Critical
Publication of CN111985221B publication Critical patent/CN111985221B/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

Abstract

The application discloses a method, a device, equipment and a storage medium for recognizing text affair relation, which relate to the field of natural language processing and further relate to the field of semantic analysis, and comprise the following steps: acquiring a text to be identified; constructing a text pair to be recognized according to the text to be recognized; and identifying the affair relation in the text to be identified according to the text pair to be identified. According to the method and the device, the accuracy of the identification of the affair relationship in the text can be improved.

Description

Text affair relationship identification method, device, equipment and storage medium
Technical Field
The application relates to the technical field of data processing, in particular to a semantic analysis technology.
Background
The fact relation recognition from the given text is a shallow semantic analysis technology, the corresponding semantic relation can be automatically recognized from the text, and the fact relation recognition plays a very important role in human cognition and reasoning decision making. Therefore, it is very practical to automatically and efficiently identify the information of the event relationship from the text to predict the event occurrence trend.
Disclosure of Invention
The embodiment of the application provides a method, a device, equipment and a storage medium for recognizing a text affair relation, so as to improve the accuracy of recognizing the affair relation in the text.
In a first aspect, an embodiment of the present application provides a method for identifying a text affair relationship, including:
acquiring a text to be identified;
constructing a text pair to be recognized according to the text to be recognized;
and identifying the affair relation in the text to be identified according to the text pair to be identified.
In a second aspect, an embodiment of the present application provides an apparatus for recognizing a text affair relationship, including:
the text to be recognized acquisition module is used for acquiring a text to be recognized;
the text pair to be recognized building module is used for building a text pair to be recognized according to the text to be recognized;
and the matter relation identification module is used for identifying the matter relation in the text to be identified according to the text pair to be identified.
In a third aspect, an embodiment of the present application provides an electronic device, including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method for identifying text event relations provided in the embodiments of the first aspect.
In a fourth aspect, the present application further provides a non-transitory computer-readable storage medium storing computer instructions for causing a computer to execute the method for identifying a text-event relationship provided in the first aspect.
According to the method and the device for recognizing the text, the text pair to be recognized is constructed for the acquired text to be recognized, so that the problem that the recognition accuracy of the matter relation in the existing text is low is solved according to the matter relation in the constructed text pair to be recognized, and the recognition accuracy of the matter relation in the text is improved.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not intended to limit the present application. Wherein:
fig. 1 is a flowchart of a method for identifying a text affair relationship according to an embodiment of the present application;
fig. 2 is a flowchart of a method for identifying a text event relationship according to an embodiment of the present application;
FIG. 3 is a schematic diagram illustrating an effect of identifying a causal relationship on a constructed text to be identified through a BERT model according to an embodiment of the present application;
fig. 4 is a structural diagram of an apparatus for recognizing a text affair relation according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device for implementing the method for recognizing a text case relationship according to the embodiment of the present application.
Detailed Description
The following description of the exemplary embodiments of the present application, taken in conjunction with the accompanying drawings, includes various details of the embodiments of the application for the understanding of the same, which are to be considered exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
In an example, fig. 1 is a flowchart of a text case relationship recognition method provided in an embodiment of the present application, where the embodiment is applicable to a case where a case relationship included in a text is accurately recognized, and the method may be executed by a text case relationship recognition apparatus, which may be implemented by software and/or hardware, and may be generally integrated in an electronic device. The electronic device may be a computer device or the like. Accordingly, as shown in fig. 1, the method comprises the following operations:
and S110, acquiring a text to be recognized.
The text to be recognized may be a text that needs to recognize a contained event relationship. It should be noted that the text to be recognized may include one single sentence or a combination of multiple single sentences, and the embodiment of the present application does not limit the specific composition of the text to be recognized.
The text to be recognized contains the affair relation to be recognized. The physical relationships are also the action relationships among the events, such as causal relationships, causal relationships or sequential relationships. The embodiment of the present application does not limit the specific relationship type of the matter relationship.
Illustratively, the text to be recognized may be, for example, "i am sad because i know that i exam failed". In the text to be recognized, the matter relationship is as follows: there is a causal relationship between the two events "heart hurt" and "test failed". Alternatively, the text to be recognized may be "a civil house is on fire, 2 people are injured, and a hospital is being treated", for example. In the text to be recognized, the matter relationship is as follows: there is a causal relationship between two events, namely "fire" and "injury", and between two events, namely "injury" and "treatment".
And S120, constructing a text pair to be recognized according to the text to be recognized.
And S130, identifying the affair relation in the text to be identified according to the text pair to be identified.
The text pair to be recognized may be a text pair constructed according to the text to be recognized and the associated text to be recognized after the associated text to be recognized associated with the text to be recognized is generated according to the text to be recognized.
In the embodiment of the application, after the text to be recognized, of which the case relationship needs to be recognized, is obtained, the text pair to be recognized can be constructed according to the obtained text to be recognized, and the case relationship included in the text to be recognized can be specifically recognized according to the constructed text pair to be recognized. Optionally, the classification model may be used to classify the text pairs to be recognized, so as to recognize the matter relationship in the text to be recognized.
For example, assuming that the text to be recognized is "i am sad because i know that i exam failed", a plurality of types of text to be recognized associated with the text to be recognized may be generated from the text to be recognized. For example, the associated text to be recognized may be "the test is not passed, so the patient is injured", or may be "do the test not pass, which causes the patient to be injured? Accordingly, the pair of texts to be recognized constructed from the text to be recognized and the associated text to be recognized associated with the text to be recognized may be, for example, "i am sad because i know that i'm' did not pass the examination" and "did not pass the examination, i am sad", or may also be "i am sad because i know that i'm' did not pass the examination" and did not pass the examination, which causes i am wounded? ".
In the prior art, when a matter relation contained in an acquired text to be recognized is recognized, the text to be recognized is often directly used as a recognition object, and the text to be recognized is directly recognized by using a classification model. For example, the text to be recognized is input into the classification model to identify the fact-of-affairs relationships it contains. The method for directly classifying the texts to be recognized belongs to the problem of single sentence classification, and has the problem of low accuracy of case relation recognition. In the embodiment of the application, in order to solve the problem of low recognition accuracy of the matter relationship existing in the problem of single sentence classification, the problem of single sentence classification of the matter relationship in the text to be recognized can be converted into the problem of sentence pair classification by constructing the text pair to be recognized according to the acquired text to be recognized and recognizing the matter relationship included in the text to be recognized according to the text pair to be recognized, instead of using the text to be recognized as the recognition object, and inputting the converted sentence pair into the classification model to specifically recognize the matter relationship included in the text to be recognized, so that the accuracy of recognition of the matter relationship can be improved.
According to the method and the device for recognizing the text, the text pair to be recognized is constructed for the acquired text to be recognized, so that the problem that the recognition accuracy of the matter relation in the existing text is low is solved according to the matter relation in the constructed text pair to be recognized, and the recognition accuracy of the matter relation in the text is improved.
In an example, fig. 2 is a flowchart of a text case relationship recognition method provided in an embodiment of the present application, and the embodiment of the present application performs optimization and improvement on the basis of the technical solutions of the above embodiments, and provides a plurality of specific selectable implementation manners for constructing a text pair to be recognized according to the text to be recognized and for recognizing a case relationship in the text to be recognized according to the text pair to be recognized.
As shown in fig. 2, a method for identifying a text event relationship includes:
and S210, acquiring a text to be recognized.
S220, acquiring event trigger words in the text to be recognized; the text to be recognized at least comprises two event trigger words.
The event trigger word may be a word in the text to be recognized, which is used for indicating an event.
It is understood that the relationship of action between events is a matter of physical reaction. Therefore, the text to be recognized necessarily includes an event. In this embodiment of the application, optionally, the events in the text to be recognized may be represented by event trigger words, and one text to be recognized includes at least two event trigger words.
Illustratively, for the text to be recognized "a civil house is on fire, 2 people are injured, and are being treated in a hospital", the event triggers are "fire", "injury", and "treatment". For the text to be recognized "he is injured because of the just fire", the event triggers are "injured" and "fire".
And S230, constructing the text pair to be recognized according to the event trigger word.
Correspondingly, after the event trigger word in the text to be recognized is obtained, the associated text to be recognized can be constructed according to the obtained event trigger word, and then the text pair to be recognized can be constructed according to the text to be recognized and the associated text to be recognized. The text pair to be recognized is constructed through the event trigger words, the event trigger words capable of reflecting the event relation can be included in each text in the text pair to be recognized, the event relation among the events represented by the event trigger words in each text is combed, and the event relation among the events represented by the event trigger words in each text is taken as the event relation of the text to be recognized when the event relation among the events represented by the event trigger words in each text is determined to be the same, so that the problem of low recognition accuracy caused by single sentence classification is solved.
In an optional embodiment of the present application, the associated text to be recognized may be a question text to be recognized.
The question text to be recognized is also the question constructed according to the time trigger words. It should be noted that the question text to be recognized is a single-sentence text, that is, only a single question is included.
The question text to be recognized is adopted as the associated text to be recognized, so that the classification model can directly know the recognition intention of the text to be recognized according to the question text to be recognized. For example, the classification model "is injured causing fire? The purpose of the direct identification is to judge whether a causal relationship exists between the two events of injury and fire.
In an optional embodiment of the present application, the constructing the text pair to be recognized according to the event trigger word may include: under the condition that the number of the event trigger words is a first number, constructing a to-be-recognized associated text matched with the to-be-recognized text directly according to the first number of the event trigger words; and constructing the text pair to be recognized according to the text to be recognized and the associated text to be recognized.
Wherein the first number may be 2.
Optionally, when the text to be recognized only includes 2 event trigger words, a text to be recognized that is matched with the text to be recognized may be directly constructed according to the 2 event trigger words, and a text pair to be recognized may be constructed according to the text to be recognized and the text to be recognized.
For example, for the text to be recognized "he is injured because of the just fire", only 2 event triggers are included: "injury" and "fire". Then constructing a text to be identified that matches the text to be identified according to the 2 event triggers may be "injury causing fire? ". Accordingly, the text pair to be recognized is "he is injured because of the just-left fire" and "is the injury causing a fire? ".
In an optional embodiment of the present application, the constructing the text pair to be recognized according to the event trigger word may include: under the condition that the number of the event trigger words is larger than the first number, constructing a plurality of event trigger word pairs according to the event trigger words; respectively constructing a plurality of associated texts to be recognized which are matched with the texts to be recognized according to the event trigger word pairs; and constructing a plurality of text pairs to be recognized according to the text to be recognized and each associated text to be recognized.
Correspondingly, when the text to be recognized comprises 3 or more event trigger words, a plurality of associated texts to be recognized matched with the text to be recognized can be constructed according to the event trigger words, and a plurality of text pairs to be recognized can be constructed according to the text to be recognized and the associated texts to be recognized. Wherein, each associated text to be recognized may include 2 event trigger words therein.
Illustratively, for the text to be recognized, "a civil house is on fire, 2 people are injured, and a hospital is being treated," includes 3 event triggers: "fire", "injury" and "treatment". Then constructing two associated texts to be recognized that match the texts to be recognized according to the 3 event triggers may be "is a fire causing injury? "and" do injuries result in aid? ". Accordingly, the two text pairs to be recognized may be "a civilian house is on fire, 2 people are injured, and is in hospital treatment" and "is a fire causing an injury? And, "a civil house is on fire, 2 people are injured, and is being treated in hospital" and "is the injury causing treatment? ".
In the scheme, when the text to be recognized comprises 3 or more event trigger words, corresponding associated texts to be recognized are respectively constructed according to the event trigger words, and a plurality of text pairs to be recognized are respectively constructed according to the plurality of constructed associated texts to be recognized, so that the action relationship among a plurality of events in the text to be recognized can be effectively recognized.
And S240, inputting the text pair to be recognized into a case relation recognition model.
In an alternative embodiment of the present application, the case relationship model may be a BERT (Bidirectional Encoder retrieval from Transformer) model.
It should be noted that, in the prior art, when using the BERT model to identify the event relationship in the text to be recognized, it is a common practice to add special symbols on both sides of the event trigger in the text to be recognized to identify which event is the first event and which event is the second event. And then inputting the marked text to be recognized into a BERT model, splicing a vector of a CLS (classification) position of the BERT and a vector of an event trigger word position, and performing event relation classification based on the obtained vectors. For example, the sentence "a civil house is on fire, 2 people are injured, and the patient is being treated in a hospital. "and two events" fire "and" injury ", the labeled sentence is such that: ' A house is in a fire $, 2 people are injured #, and the house is being treated in a hospital. ".
In the scheme, the marking mode of adding special symbols on two sides of the event trigger word only tells the BERT model which word indicates the first event and which word indicates the second event, and does not directly tell the BERT model to classify the causal relationship. Therefore, the BERT model is not ideal for the classification effect of the single sentence classification task.
Because the BERT model uses a 'sentence pair classification' task in the pre-training process, when the text to be recognized is input into the BERT model for classification in a sentence pair mode, the BERT model can obtain a better classification effect. For example, in the scene of causal relationship classification, constructed question texts to be identified can directly tell the BERT model to perform causal relationship classification, so that a better classification effect is achieved.
And S250, acquiring an output result of the affair relation model.
S260, determining the matter relation in the text to be recognized according to the output result of the matter relation model.
The output result of the matter relation model is also the classification result of the matter relation model for the text to be recognized.
Correspondingly, after the text pair to be recognized is input into the BERT model, the event relation in the text to be recognized can be determined according to the classification result output by the BERT model.
In an alternative embodiment of the present application, the fact relationships include causal relationships, causal relationships and non-event-effect relationships.
Wherein a causal relationship means that the first event is a causal event and the second event is an outcome event. An effect relationship means that the first event is a result event and the second event is a cause event. The non-event action relationship may be that there is no causal relationship or no causal relationship between two events, such as a sequential relationship, as long as it is not a causal relationship or a causal relationship, and the embodiment of the present application does not limit the specific relationship type of the non-event action relationship.
Optionally, the text to be recognized may be converted into a question-answer sentence pair classification problem to be applied to a classification scenario of causal relationships. That is, given a sentence, which may include multiple events, a question may first be constructed based on every two events: "is event 1 leading to event 2? ". Then, the original sentence is used as a first sentence, the constructed question sentence is used as a second sentence, and the text pair to be recognized is constructed according to the first sentence and the second sentence and is input to the BERT model.
Fig. 3 is a schematic diagram illustrating an effect of identifying a causal relationship of a constructed text to be identified through a BERT model according to an embodiment of the present application. In one example, as shown in fig. 3, for the sentence "a folk house is on fire, 2 people are injured. "and two events" fire "and" injury ", the question constructed may be" does fire cause injury? "the text pair to be recognized that is input to the BERT is in the form of" [ CLS ] A civil house that is on fire and 2 people are injured. [ SEP ] injury caused by a fire [ SEP ]. And finally, splicing the vector of the CLS position of the BERT model and the vector of the event trigger word position, and carrying out causal relationship classification based on the obtained vectors by utilizing the network structure of the BERT model to obtain a classification label output by the BERT model to serve as a final classification result of the text to be recognized.
In the above scheme, all event pairs having causal relationship are identified from the text, and whether the event is a cause event or a result event is determined, so that the causal consequence of the event can be determined. Meanwhile, the form of the constructed question text to be recognized is consistent with that of the traditional question-answering question, namely, a question and a text possibly containing the answer of the question are given, and the BERT model searches knowledge from the given text pair to answer the question. The recognition mode of the text affair relation fully utilizes the advantages of the BERT model in sentence pair classification, the constructed question sentence more directly tells the model recognition that the causal relation classification is carried out, so that the BERT model is easier to learn, the BERT model obtains a better classification effect, and the recognition accuracy of the causal relation is higher.
In an example, fig. 4 is a structural diagram of an apparatus for recognizing a text event relationship provided in an embodiment of the present application, which is implemented by software and/or hardware and is specifically configured in an electronic device, and the embodiment of the present application is applicable to a case of accurately recognizing an event relationship included in a text. The electronic device may be a computer device or the like.
An apparatus 300 for recognizing a text event relation as shown in fig. 4 comprises: the system comprises a text to be recognized acquisition module 310, a text to be recognized pair construction module 320 and a case relation recognition module 330. Wherein the content of the first and second substances,
a text to be recognized obtaining module 310, configured to obtain a text to be recognized;
a text pair to be recognized constructing module 320, configured to construct a text pair to be recognized according to the text to be recognized;
and the matter relationship identification module 330 is configured to identify a matter relationship in the text to be identified according to the text pair to be identified.
According to the method and the device for recognizing the text, the text pair to be recognized is constructed for the acquired text to be recognized, so that the problem that the recognition accuracy of the matter relation in the existing text is low is solved according to the matter relation in the constructed text pair to be recognized, and the recognition accuracy of the matter relation in the text is improved.
Optionally, the text pair to be recognized constructing module 320 is configured to: acquiring an event trigger word in the text to be recognized; the text to be recognized at least comprises two event trigger words; and constructing the text pair to be recognized according to the event trigger word.
Optionally, the text pair to be recognized constructing module 320 is configured to: under the condition that the number of the event trigger words is a first number, constructing a to-be-recognized associated text matched with the to-be-recognized text directly according to the first number of the event trigger words; and constructing the text pair to be recognized according to the text to be recognized and the associated text to be recognized.
Optionally, the text pair to be recognized constructing module 320 is configured to: under the condition that the number of the event trigger words is larger than the first number, constructing a plurality of event trigger word pairs according to the event trigger words; respectively constructing a plurality of associated texts to be recognized which are matched with the texts to be recognized according to the event trigger word pairs; and constructing a plurality of text pairs to be recognized according to the text to be recognized and each associated text to be recognized.
Optionally, the associated text to be recognized is a question text to be recognized.
Optionally, the case relationship identifying module 330 is configured to: inputting the text pair to be recognized into a physical relation recognition model; acquiring an output result of the affair relation model; and determining the matter relation in the text to be recognized according to the output result of the matter relation model.
Optionally, the matter relation model is a BERT model.
Optionally, the event relationship includes a causal relationship, an effect relationship and a non-event action relationship.
The device for recognizing the text affair relationship can execute the method for recognizing the text affair relationship provided by any embodiment of the application, and has the corresponding functional modules and the beneficial effects of the execution method. For the technical details that are not described in detail in this embodiment, reference may be made to the text affair relationship recognition method provided in any embodiment of the present application.
Since the above-described device for recognizing text case relations is a device capable of executing the method for recognizing text case relations in the embodiment of the present application, based on the method for recognizing text case relations described in the embodiment of the present application, a person skilled in the art can understand the specific implementation and various variations of the device for recognizing text case relations in the embodiment of the present application, and therefore, how to implement the method for recognizing text case relations in the embodiment of the present application by the device for recognizing text case relations is not described in detail herein. The device used by those skilled in the art to implement the method for identifying the text affair relationship in the embodiment of the present application is all within the scope of the present application.
In one example, the present application also provides an electronic device and a readable storage medium.
Fig. 5 is a schematic structural diagram of an electronic device for implementing the method for recognizing a text case relationship according to the embodiment of the present application. Fig. 5 is a block diagram of an electronic device according to an embodiment of the present application. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the present application that are described and/or claimed herein.
As shown in fig. 5, the electronic apparatus includes: one or more processors 401, memory 402, and interfaces for connecting the various components, including high-speed interfaces and low-speed interfaces. The various components are interconnected using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions for execution within the electronic device, including instructions stored in or on the memory to display graphical information of a GUI on an external input/output apparatus (such as a display device coupled to the interface). In other embodiments, multiple processors and/or multiple buses may be used, along with multiple memories and multiple memories, as desired. Also, multiple electronic devices may be connected, with each device providing portions of the necessary operations (e.g., as a server array, a group of blade servers, or a multi-processor system). In fig. 5, one processor 401 is taken as an example.
Memory 402 is a non-transitory computer readable storage medium as provided herein. The memory stores instructions executable by at least one processor to cause the at least one processor to perform the method for identifying textual matter relationships provided herein. The non-transitory computer-readable storage medium of the present application stores computer instructions for causing a computer to perform the method for identifying textual matter relationships provided herein.
The memory 402, as a non-transitory computer readable storage medium, may be used to store non-transitory software programs, non-transitory computer executable programs, and modules, such as program instructions/modules corresponding to the text-to-be-recognized-relationship identification method in the embodiment of the present application (for example, the to-be-recognized text acquisition module 310, the to-be-recognized text pair construction module 320, and the physical relationship identification module 330 shown in fig. 4). The processor 401 executes various functional applications of the server and data processing, namely, implements the method for recognizing the text fact relationship in the above-described method embodiments, by running the non-transitory software programs, instructions and modules stored in the memory 402.
The memory 402 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created by use of the electronic device implementing the recognition method of the text matter relationship, and the like. Further, the memory 402 may include high speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory 402 may optionally include memory located remotely from the processor 401, and such remote memory may be connected over a network to an electronic device implementing the method of identifying textual matter relationships. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The electronic device implementing the method for recognizing the text affair relationship may further include: an input device 403 and an output device 404. The processor 401, the memory 402, the input device 403 and the output device 404 may be connected by a bus or other means, and fig. 5 illustrates an example of a connection by a bus.
The input device 403 may receive input numeric or character information and generate key signal inputs related to user settings and function control of the electronic apparatus implementing the recognition method of the textual matter, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, a pointing stick, one or more mouse buttons, a track ball, a joystick, or other input devices. The output devices 404 may include a display device, auxiliary lighting devices (e.g., LEDs), and haptic feedback devices (e.g., vibrating motors), among others. The display device may include, but is not limited to, a Liquid Crystal Display (LCD), a Light Emitting Diode (LED) display, and a plasma display. In some implementations, the display device can be a touch screen.
Various implementations of the systems and techniques described here can be realized in digital electronic circuitry, integrated circuitry, application specific ASICs (application specific integrated circuits), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
These computer programs (also known as programs, software applications, or code) include machine instructions for a programmable processor, and may be implemented using high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or device (e.g., magnetic discs, optical disks, memory, Programmable Logic Devices (PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. The client may be a smart phone, a notebook computer, a desktop computer, a tablet computer, a smart speaker, etc., but is not limited thereto. The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as cloud computing, cloud service, a cloud database, cloud storage and the like. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. …
According to the method and the device for recognizing the text, the text pair to be recognized is constructed for the acquired text to be recognized, so that the problem that the recognition accuracy of the matter relation in the existing text is low is solved according to the matter relation in the constructed text pair to be recognized, and the recognition accuracy of the matter relation in the text is improved.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present application may be executed in parallel, sequentially, or in different orders, and the present invention is not limited thereto as long as the desired results of the technical solutions disclosed in the present application can be achieved.
The above-described embodiments should not be construed as limiting the scope of the present application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (18)

1. A method for recognizing text affair relations comprises the following steps:
acquiring a text to be identified;
constructing a text pair to be recognized according to the text to be recognized;
and identifying the affair relation in the text to be identified according to the text pair to be identified.
2. The method of claim 1, wherein the constructing the text pair to be recognized from the text to be recognized comprises:
acquiring an event trigger word in the text to be recognized; the text to be recognized at least comprises two event trigger words;
and constructing the text pair to be recognized according to the event trigger word.
3. The method of claim 2, wherein the constructing the text pair to be recognized according to the event trigger word comprises:
under the condition that the number of the event trigger words is a first number, constructing a to-be-recognized associated text matched with the to-be-recognized text directly according to the first number of the event trigger words;
and constructing the text pair to be recognized according to the text to be recognized and the associated text to be recognized.
4. The method of claim 2, wherein the constructing the text pair to be recognized according to the event trigger word comprises:
under the condition that the number of the event trigger words is larger than the first number, constructing a plurality of event trigger word pairs according to the event trigger words;
respectively constructing a plurality of associated texts to be recognized which are matched with the texts to be recognized according to the event trigger word pairs;
and constructing a plurality of text pairs to be recognized according to the text to be recognized and each associated text to be recognized.
5. The method according to claim 3 or 4, wherein the associated text to be identified is a question text to be identified.
6. The method of claim 1, wherein the identifying a case relationship in the text to be identified according to the text pair to be identified comprises:
inputting the text pair to be recognized into a physical relation recognition model;
acquiring an output result of the affair relation model;
and determining the matter relation in the text to be recognized according to the output result of the matter relation model.
7. The method of claim 6, wherein the case relationship model is a BERT model.
8. The method of claim 1, wherein the incident relationships comprise causal relationships, and non-event-effect relationships.
9. An apparatus for recognizing a text event relationship, comprising:
the text to be recognized acquisition module is used for acquiring a text to be recognized;
the text pair to be recognized building module is used for building a text pair to be recognized according to the text to be recognized;
and the matter relation identification module is used for identifying the matter relation in the text to be identified according to the text pair to be identified.
10. The apparatus of claim 9, wherein the text pair to be recognized construction module is configured to:
acquiring an event trigger word in the text to be recognized; the text to be recognized at least comprises two event trigger words;
and constructing the text pair to be recognized according to the event trigger word.
11. The apparatus of claim 10, wherein the text pair to be recognized construction module is configured to:
under the condition that the number of the event trigger words is a first number, constructing a to-be-recognized associated text matched with the to-be-recognized text directly according to the first number of the event trigger words;
and constructing the text pair to be recognized according to the text to be recognized and the associated text to be recognized.
12. The apparatus of claim 10, wherein the text pair to be recognized construction module is configured to:
under the condition that the number of the event trigger words is larger than the first number, constructing a plurality of event trigger word pairs according to the event trigger words;
respectively constructing a plurality of associated texts to be recognized which are matched with the texts to be recognized according to the event trigger word pairs;
and constructing a plurality of text pairs to be recognized according to the text to be recognized and each associated text to be recognized.
13. The apparatus according to claim 11 or 12, wherein the associated text to be identified is question text to be identified.
14. The apparatus of claim 9, wherein the incident relationship identification module is to:
inputting the text pair to be recognized into a physical relation recognition model;
acquiring an output result of the affair relation model;
and determining the matter relation in the text to be recognized according to the output result of the matter relation model.
15. The apparatus of claim 14, wherein the case relationship model is a BERT model.
16. The apparatus of claim 9, wherein the incident relationships comprise causal relationships, and non-event-effect relationships.
17. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of identifying textual matter relationships of any of claims 1-8.
18. A non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the method of identifying textual matter relationships of any of claims 1-8.
CN202010807360.8A 2020-08-12 2020-08-12 Text event relationship identification method, device, equipment and storage medium Active CN111985221B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010807360.8A CN111985221B (en) 2020-08-12 2020-08-12 Text event relationship identification method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010807360.8A CN111985221B (en) 2020-08-12 2020-08-12 Text event relationship identification method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111985221A true CN111985221A (en) 2020-11-24
CN111985221B CN111985221B (en) 2024-03-26

Family

ID=73433897

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010807360.8A Active CN111985221B (en) 2020-08-12 2020-08-12 Text event relationship identification method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111985221B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150310020A1 (en) * 2014-04-28 2015-10-29 Elwha LLC, a limited liability company of the State of Delaware Methods, systems, and devices for outcome prediction of text submission to network based on corpora analysis
CN110597994A (en) * 2019-09-17 2019-12-20 北京百度网讯科技有限公司 Event element identification method and device
CN110674840A (en) * 2019-08-22 2020-01-10 中国司法大数据研究院有限公司 Multi-party evidence association model construction method based on Bayesian network and evidence chain extraction method and device
CN111143576A (en) * 2019-12-18 2020-05-12 中科院计算技术研究所大数据研究院 Event-oriented dynamic knowledge graph construction method and device
CN111222305A (en) * 2019-12-17 2020-06-02 共道网络科技有限公司 Information structuring method and device
CN111506734A (en) * 2019-01-30 2020-08-07 国家计算机网络与信息安全管理中心 Event evolution knowledge graph construction method, device, equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150310020A1 (en) * 2014-04-28 2015-10-29 Elwha LLC, a limited liability company of the State of Delaware Methods, systems, and devices for outcome prediction of text submission to network based on corpora analysis
CN111506734A (en) * 2019-01-30 2020-08-07 国家计算机网络与信息安全管理中心 Event evolution knowledge graph construction method, device, equipment and storage medium
CN110674840A (en) * 2019-08-22 2020-01-10 中国司法大数据研究院有限公司 Multi-party evidence association model construction method based on Bayesian network and evidence chain extraction method and device
CN110597994A (en) * 2019-09-17 2019-12-20 北京百度网讯科技有限公司 Event element identification method and device
CN111222305A (en) * 2019-12-17 2020-06-02 共道网络科技有限公司 Information structuring method and device
CN111143576A (en) * 2019-12-18 2020-05-12 中科院计算技术研究所大数据研究院 Event-oriented dynamic knowledge graph construction method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
GAO PENG等: "Multi-modality latent interaction network for visual question answering", 2019 IEEE/CVF INTERNATIONAL CONFERENCE ON COMPUTER VISION (ICCV), 27 February 2019 (2019-02-27) *
刘铭;郑子豪;秦兵;刘一仝;李阳;: "基于篇章级事件表示的文本相关度计算方法", 中国科学:信息科学, no. 07, 15 July 2020 (2020-07-15) *

Also Published As

Publication number Publication date
CN111985221B (en) 2024-03-26

Similar Documents

Publication Publication Date Title
CN111428507B (en) Entity chain finger method, device, equipment and storage medium
CN111428008B (en) Method, apparatus, device and storage medium for training a model
CN111221983B (en) Time sequence knowledge graph generation method, device, equipment and medium
CN111414482B (en) Event argument extraction method and device and electronic equipment
US11669690B2 (en) Method and apparatus for processing sematic description of text entity, and storage medium
CN111325020A (en) Event argument extraction method and device and electronic equipment
JP7395445B2 (en) Methods, devices and electronic devices for human-computer interactive interaction based on search data
CN111611468B (en) Page interaction method and device and electronic equipment
CN111274397B (en) Method and device for establishing entity relation detection model
CN111967256A (en) Event relation generation method and device, electronic equipment and storage medium
CN111079945B (en) End-to-end model training method and device
US20220358292A1 (en) Method and apparatus for recognizing entity, electronic device and storage medium
US20220027575A1 (en) Method of predicting emotional style of dialogue, electronic device, and storage medium
CN111401033A (en) Event extraction method, event extraction device and electronic equipment
CN112506949B (en) Method, device and storage medium for generating structured query language query statement
CN111522944A (en) Method, apparatus, device and storage medium for outputting information
CN111858880B (en) Method, device, electronic equipment and readable storage medium for obtaining query result
CN110674260A (en) Training method and device of semantic similarity model, electronic equipment and storage medium
CN111782785B (en) Automatic question and answer method, device, equipment and storage medium
CN111738015A (en) Method and device for analyzing emotion polarity of article, electronic equipment and storage medium
CN111708800A (en) Query method and device and electronic equipment
CN114357951A (en) Method, device, equipment and storage medium for generating standard report
CN112559715B (en) Attitude identification method, device, equipment and storage medium
CN111523019B (en) Method, apparatus, device and storage medium for outputting information
CN111985221B (en) Text event relationship identification method, device, equipment and storage 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