Event processing method and apparatus, electronic device, and storage medium
By constructing events and using an event association discrimination model to process intermediate text, the problem of insufficient accuracy in existing text association methods is solved, achieving high accuracy and completeness in database updates.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2024-12-12
- Publication Date
- 2026-06-12
Smart Images

Figure CN122195992A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of computer technology, and specifically relates to an event processing method, apparatus, electronic device and storage medium. Background Technology
[0002] Text contained in various channels such as internet pages and social networks often contains rich information. Correlating this text can update relevant databases in various scenarios. For example, in map navigation applications, it is necessary to frequently obtain text information about roads from the aforementioned channels to facilitate timely updates to the navigation display information on the map, providing people with reliable and efficient travel guidance.
[0003] In related technologies, clustering-based or text similarity-based text association methods are commonly used to associate texts. However, these text association methods are based on the semantic features of the text itself, resulting in low accuracy in association judgment and thus reducing the accuracy of updating data in related databases. Summary of the Invention
[0004] To address the aforementioned technical problems, this application provides an event processing method, apparatus, electronic device, and storage medium.
[0005] On the one hand, this application proposes an event handling method, the method comprising:
[0006] Obtain the text to be recognized corresponding to the target scene;
[0007] Extract action entities associated with the target scene from the text to be identified, and non-action entities that have a first association relationship with the action entities;
[0008] Different events are constructed based on the action entity, the non-action entity, and the first association relationship;
[0009] Obtain the intermediate text located between the target action entities from the text to be identified; the target action entities are the action entities that construct any two events in the different events;
[0010] The arbitrary two events and the intermediate text are input into the target event association discrimination model for association discrimination processing to obtain the association discrimination result of the arbitrary two events; wherein, the target event association discrimination model is obtained by training a preset association discrimination model based on the arbitrary two sample events and the intermediate sample text that constructs the action entities between the arbitrary two sample events; the different sample events are constructed based on the sample action entities in the sample text to be identified that are associated with the target scene, the non-sample action entities that have a second association relationship with the sample action entities, and the second association relationship.
[0011] The text to be identified is updated based on the association discrimination result.
[0012] On the other hand, this application proposes an event handling method apparatus, the apparatus comprising:
[0013] The text to be recognized module is used to acquire the text to be recognized corresponding to the target scene;
[0014] The entity extraction module is used to extract action entities associated with the target scene and non-action entities that have a first association relationship with the action entities from the text to be identified.
[0015] The event construction module is used to construct different events based on the action entity, the non-action entity, and the first association relationship;
[0016] The intermediate text acquisition module is used to acquire intermediate text located between target action entities from the text to be identified; the target action entity is the action entity that constructs any two events in the different events.
[0017] The association discrimination module is used to input the arbitrary two events and the intermediate text into the target event association discrimination model for association discrimination processing, and obtain the association discrimination result of the arbitrary two events; wherein, the target event association discrimination model is obtained by training a preset association discrimination model based on the arbitrary two sample events and the intermediate sample text that constructs the action entities between the arbitrary two sample events; the different sample events are constructed based on the sample action entities in the sample text to be identified that are associated with the target scene, the non-sample action entities that have a second association relationship with the sample action entities, and the second association relationship.
[0018] The update module is used to update the text to be identified based on the association discrimination result.
[0019] On the other hand, this application proposes an electronic device for an event handling method, the electronic device including a processor and a memory, the memory storing at least one instruction or at least one program, the at least one instruction or at least one program being loaded and executed by the processor to implement the event handling method as described above.
[0020] On the other hand, this application proposes a computer-readable storage medium storing at least one instruction or at least one program segment, which is loaded and executed by a processor to implement the event handling method as described above.
[0021] On the other hand, this application proposes a computer program product, including a computer program that, when executed by a processor, implements the event handling method as described above.
[0022] This application proposes an event processing method, apparatus, electronic device, and storage medium. The method first combines any two sample events and constructs intermediate sample text between the action entities of any two sample events to train a preset association discrimination model. Since the intermediate sample text between the action entities of any two sample events can reflect the association relationship between any two sample events to a certain extent, the preset association discrimination model is trained by combining any two sample events and the intermediate sample text corresponding to any two sample events, so that the trained target event association discrimination model can accurately predict the association discrimination result between any two events.
[0023] For the text to be identified corresponding to the target scene, the training target event association discrimination model can be used to perform association discrimination processing on any two events extracted from the text to be identified and the intermediate text between the action entities of any two events. This can accurately predict the association discrimination result between any two events, thereby ensuring the recall completeness and accuracy of the relevant elements of the extracted events. Finally, the text to be identified is updated based on the association discrimination result, which effectively improves the accuracy of updating the data in the relevant database. Attached Figure Description
[0024] To more clearly illustrate the technical solutions and advantages in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0025] Figure 1 This is a schematic diagram illustrating the implementation environment of an event handling method according to an exemplary embodiment.
[0026] Figure 2 This is a flowchart illustrating an event handling method according to an exemplary embodiment. Figure 1 .
[0027] Figure 3 This is a flowchart illustrating an event handling method according to an exemplary embodiment. Figure 2 .
[0028] Figure 4 This is a schematic diagram illustrating a construction event according to an exemplary embodiment.
[0029] Figure 5 This is a schematic diagram illustrating the construction of an event subgraph and the extraction of intermediate text according to an exemplary embodiment.
[0030] Figure 6 This is a schematic diagram illustrating the structure of a target event association discrimination model according to an exemplary embodiment.
[0031] Figure 7 This is a flowchart illustrating the training process of a target event association discrimination model according to an exemplary embodiment.
[0032] Figure 8 This is a block diagram illustrating an event processing apparatus according to an exemplary embodiment.
[0033] Figure 9 This is a hardware structure block diagram of a server provided according to an exemplary embodiment. Detailed Implementation
[0034] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0035] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of the embodiments of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the present application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or server that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to these processes, methods, products, or devices.
[0036] It should be noted that, in the embodiments of this application, the terms "module" or "unit" refer to a computer program or part of a computer program with a predetermined function, which works together with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0037] Figure 1 This is a schematic diagram illustrating an implementation environment for an event handling method according to an exemplary embodiment. For example... Figure 1 As shown, the implementation environment may include at least a client 01 and a server 02. The client 01 and the server 02 may be directly or indirectly connected through wired or wireless communication. This embodiment of the application does not impose any limitations on this.
[0038] Specifically, server 02 can be used to train a target event association discrimination model, and based on the trained target event association discrimination model, perform association discrimination processing on any two events and intermediate text to obtain the association discrimination result of any two events; and to update the text to be identified based on the association discrimination result. Optionally, server 02 can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.
[0039] Specifically, client 01 can be used to display the updated text to be recognized. Client 01 can be, but is not limited to, mobile phones, computers, smart voice interaction devices, smart home appliances, vehicle terminals, aircraft, etc.
[0040] It should be noted that, Figure 1 This is just one example. Other implementation environments may also be included in other scenarios.
[0041] It should be noted that in the specific implementation of this application, user information, such as text to be identified and other related data, is involved. When the embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with relevant laws, regulations and standards.
[0042] Figure 2 This is a flowchart illustrating an event handling method according to an exemplary embodiment. Figure 1 This method can be used for Figure 1In the implementation environment described in this specification, the method operation steps are as illustrated in the embodiments or flowcharts. However, based on conventional or non-inventive labor, more or fewer operation steps may be included. The order of steps listed in the embodiments is merely one possible execution order among many and does not represent the only possible execution order. In actual system or server product execution, the method can be executed sequentially according to the embodiments or drawings, or in parallel (e.g., in a parallel processor or multi-threaded processing environment). Specifically, as shown in the embodiments or drawings... Figure 2 As shown, the method may include:
[0043] S101. Obtain the text to be recognized corresponding to the target scene.
[0044] Optionally, the target scenario can be any business scenario, without specific limitations. For example, a text content recognition scenario involving the opening and closing of roads, or a text content recognition scenario involving sports activities.
[0045] Optionally, the text to be identified is text that corresponds to and is related to the target scenario. For example, in a text content recognition scenario where the target scenario is the opening and closing of a road, the text to be identified can be text related to the opening and closing of a road, such as whether the road is passable or whether there is congestion. In a text content recognition scenario where the target scenario is sports, the text to be identified can be text related to sports.
[0046] S103. Extract action entities associated with the target scene and non-action entities with the first association relationship with the action entities from the text to be identified.
[0047] S105. Construct different events based on action entities, non-action entities, and the first association relationship.
[0048] The text to be identified may contain multiple sentences, and therefore may contain multiple events. Events can be constructed by extracting entities and their relationships from these sentences to create different events.
[0049] Optionally, the type of event corresponds to the target scenario. In the text content recognition scenario of road opening and closing, the event can be a road opening and closing event.
[0050] Optionally, an entity refers to any element mentioned in text, such as nouns, verbs, and numerals, due to the diverse forms of language organization and expression. For example, in a text content recognition scenario involving the opening and closing of roads, this entity could include, but is not limited to, road name, opening, closing, control, and time. Among these, opening, closing, and control are verbs expressing events and can be considered action entities.
[0051] Furthermore, to improve the accuracy of association discrimination, events can be triggered by action entities, and then associated with other non-action entities, as well as the relationships between action and non-action entities. There may be multiple action entities, but not every action entity is associated with the target scene. Therefore, when constructing events, it is necessary to extract action entities associated with the target scene and non-action entities with a primary association with the action entities from the text to be recognized, and then construct different events based on the action entities, non-action entities, and the primary association.
[0052] For example, in the text content recognition scenario of road opening and closing, suppose the text to be recognized includes actions such as "reporting," "controlling," "opening," and "closing." However, the action of "reporting" is not related to the opening and closing of roads. When constructing events, the action of "reporting" needs to be removed, and actions such as "controlling," "opening," and "closing" are used as trigger words. At the same time, non-action entities with the first association relationship with the action entities are obtained from the text to be recognized, and different events are constructed based on the action entities, non-action entities, and the first association relationship.
[0053] Optionally, the first association refers to the intrinsic connection between an action entity and a non-action entity. This first association may include, but is not limited to, changes, belonging, beginning, and ending relationships. Among these, a change relationship refers to the relationship that represents the generation of a change phenomenon between entities. For example, in the text "Traffic control is implemented on XX road," "XX road" is a non-action entity, and "control" in "traffic control" is an action entity. The entity category of "XX road" is road, and the entity category of "control" is closed. The change from "XX road" to "control" indicates that the road has been closed. Therefore, a change phenomenon has occurred between the entity "XX road" and the entity "control," and the first association between them is a change relationship.
[0054] For example, if a text is “XX Expressway K000-K1111”, the entity category of “XX Expressway” is “Road”, and the entity category of “K000-K1111” is “Mileage Post”. The “Mileage Post” is a part of the road. Therefore, the first association between the entity “XX Expressway” and the entity “K000-K1111” is a membership relationship.
[0055] For example, consider the text "Control period: XX month XX day, 2023 to XX month XX day, 2024". "Control" is an action entity, "XX month XX day, 2023" is a non-action entity, and "XX month XX day, 2024" is a non-action entity. The entity category of "Control" is closed, the entity category of "XX month XX day, 2023" is time, and the entity category of "XX month XX day, 2024" is also time. "XX month XX day, 2023" represents the start time of the closed period, and "XX month XX day, 2024" represents the end time of the closed period. Therefore, the first association between the entity "Control" and the entity "XX month XX day, 2023" is a starting association, and the first association between the entity "Control" and the entity "XX month XX day, 2024" is a ending association.
[0056] Optionally, one event corresponds to one action entity. Since there can be multiple action entities in the text to be identified, multiple different events can be constructed. Each event corresponds to one action entity, which can be understood as the core vocabulary of the event. This allows for the construction of events using an action entity as a trigger word, thereby improving the prediction accuracy of the association judgment results between any two events during the event association judgment process.
[0057] S107. Obtain the intermediate text located between the target action entities from the text to be recognized; the target action entities are the action entities of any two events in different events.
[0058] Since multiple different events can be constructed based on action entities, the action entities of any two events in the construction of different events can be used as target action entities, and the intermediate text located between the target action entities can be obtained from the text to be recognized.
[0059] For example, different events include event 1, event 2, and event 3. Event 1 is constructed from action entity 1, event 2 from action entity 2, and event 3 from action entity 3. Any two events can refer to event 1 and event 2, event 2 and event 3, or event 1 and event 3. The target action entities for constructing event 1 and event 2 are action entity 1 and action entity 2; the target action entities for constructing event 2 and event 3 are action entity 2 and action entity 3; and the target action entities for constructing event 1 and event 3 are action entity 1 and action entity 3. Intermediate text between action entity 1 and action entity 2 can be obtained from the text to be recognized, thus obtaining the intermediate text corresponding to event 1 and event 2; intermediate text between action entity 2 and action entity 3 can be obtained, thus obtaining the intermediate text corresponding to event 2 and event 3; and intermediate text between action entity 1 and action entity 3 can be obtained, thus obtaining the intermediate text corresponding to event 1 and event 3.
[0060] S109. Input any two events and intermediate text into the target event association discrimination model for association discrimination processing to obtain the association discrimination result of any two events; wherein, the target event association discrimination model is obtained by training a preset association discrimination model based on any two sample events and the intermediate sample text between the action entities of any two sample events; different sample events are constructed based on the sample action entities in the sample text to be identified that are associated with the target scene, the non-sample action entities that have a second association relationship with the sample action entities, and the second association relationship.
[0061] Optionally, the association discrimination result can characterize the degree of association between any two events, which can include two cases: any two events are related and any two events are not related. For example, the association discrimination result can be a probability value between [0, 1]. The larger the probability value, the greater the degree of association between any two events; the smaller the probability value, the smaller the degree of association between any two events.
[0062] S1011. Update the text to be identified based on the association discrimination results.
[0063] In this embodiment, sample action entities associated with the target scene and non-sample action entities with a second association relationship with the sample action entities can be extracted from the sample text to be identified in advance. Different sample events are then constructed based on the sample action entities, non-sample action entities, and the second association relationship. Next, intermediate sample text located between the target sample action entities is obtained from the sample text to be identified. The target action entity is the action entity of any two sample events constructed from the different sample events. Finally, a preset association discrimination model is trained based on any two sample events, the intermediate sample text between the action entities of any two sample events, and the association tags corresponding to any two sample events to obtain a target event association discrimination model. Since the intermediate sample text between the action entities of any two sample events can reflect the association relationship between any two sample events to a certain extent, training the preset association discrimination model by combining any two sample events and the intermediate sample text corresponding to any two sample events enables the trained target event association discrimination model to accurately predict the association discrimination result between any two events.
[0064] For the text to be identified corresponding to the target scene, after obtaining any two events and the intermediate text of any two events, the association discrimination processing of any two events and the intermediate text can be performed based on the trained target event association discrimination model to accurately predict the association discrimination result between any two events, thereby ensuring the recall completeness and accuracy of the relevant elements of the extracted events. Finally, the text to be identified is updated based on the association discrimination result, which effectively improves the accuracy of updating the data in the relevant database.
[0065] It should be noted that in step S103 above, the extraction of action entities associated with the target scene from the text to be identified, as well as non-action entities with a first association relationship with the action entities, can be achieved in various ways, and no specific limitation is made here.
[0066] In one approach, an entity extraction model can be pre-trained, and the text to be recognized can be input into this model to obtain action entities and non-action entities. In another approach, Figure 3 This is a flowchart illustrating an event handling method according to an exemplary embodiment. Figure 2 ,like Figure 3 As shown, step S103 above may include:
[0067] S1031. Extract sentences from the text to be identified that contain action entities associated with the target scene, and obtain them as candidate sentences.
[0068] S1033. Determine the action entities in the candidate sentences that are associated with the target scene, and the non-action entities that have a first association with the action entities.
[0069] The text to be identified may contain multiple sentences. Since not every action entity is associated with the target scene, to improve the accuracy of association determination, an event can be constructed using action entities as trigger words. This allows sentences in the text containing action entities associated with the target scene to be identified as candidate sentences. From these candidate sentences, action entities associated with the target scene, as well as non-action entities with a primary association with the action entities, can be extracted. Optionally, since one event corresponds to one action entity, when extracting candidate sentences from the text to be identified, each extracted candidate sentence can include one action entity. This ensures that one event corresponds to one action entity when constructing events.
[0070] Figure 4 This is a schematic diagram illustrating a construction event according to an exemplary embodiment, such as... Figure 4As shown, for the text content recognition scenario involving road opening and closing, the text to be recognized is: "Due to the construction needs of XX Highway, in order to ensure the smooth progress of the project and road traffic safety during the construction period, in accordance with XX regulations, it has been decided to implement temporary traffic control on the construction section. The relevant matters are hereby announced as follows: I. Control period: XX month XX day, 2023 to XX month XX day, 2024. II. Controlled section: XX Expressway K000-K1111."
[0071] First, sentences containing action entities associated with the target scene can be extracted from the text to be identified, resulting in candidate sentences. These candidate sentences are as follows:
[0072] The first sentence states: "Due to the construction needs of XX Highway, in order to ensure the smooth progress of the project and road traffic safety during the construction period, in accordance with XX regulations, it has been decided to implement temporary traffic control on the construction section. The relevant matters are hereby announced as follows:"
[0073] The second sentence reads: "I. Control period: from XX month XX day, 2023 to XX month XX day, 2024."
[0074] The third sentence: "II. Controlled section: XX Expressway, XX section."
[0075] Next, it is determined whether each sentence contains an action entity associated with the road opening and closing scenario. Specifically: if the first sentence contains the action entity "control" in "traffic control", the second sentence contains the action entity "control time" in "control time", and the third sentence contains the action entity "control section" in "control", and all of these are action entities associated with the text content recognition scenario of road opening and closing, then the first, second, and third sentences can all be identified as candidate sentences.
[0076] Regarding the first sentence, the action entity associated with the target scene is "control" in "traffic control," and the non-action entity associated with the target scene is XX Highway. The entity category of "XX Highway" is "road," and the entity category of "control" in "traffic control" is "closed." The part of speech of the entity "XX Highway" is a noun, and the part of speech of the entity "control" in "traffic control" is a verb. The change from "XX road" to "control" indicates that the road has been closed. Therefore, a change has occurred between the entity "XX road" and the entity "control," and the primary relationship between the two is a change relationship.
[0077] Regarding the second sentence, the action entity associated with the target scenario is "control" in "control time," while the non-action entities associated with the target scenario are "2023 year XX month XX day" and "2024 year XX month XX day." The entity category of "2023 year XX month XX day" and "2024 year XX month XX day" is "time," and the part of speech is numeral. The entity category of "control" is "closed," and the part of speech is verb. From closed to time, it can be the start and end time of the closure. Therefore, the first association between the non-action entity "2023 year XX month XX day" and "control" is a start relationship, and the first association between the non-action entity "2024 year XX month XX day" and "control" is an end relationship.
[0078] Regarding the third sentence, the action entity associated with the target scenario is "control" in "controlled road section," while the non-action entities associated with the target scenario are "XX Expressway" and "K000-K1111." The entity category of "XX Expressway" is "expressway," and its part of speech is a noun. The entity category of "K000-K1111" is "mileage marker," and its part of speech is a numeral. The entity category of "control" is "closed," and its part of speech is a verb. The change from "closed" to "expressway" indicates a change relationship; therefore, the primary relationship between "control" and "XX Expressway" is a change relationship. Since "mileage marker" belongs to "expressway," the primary relationship between "XX road section" and "XX Expressway" is a belonging relationship.
[0079] Optionally, in step S1055 above, after obtaining the action entity, non-action entity, and first association relationship, events corresponding to each action entity can be constructed based on the action entity, non-action entity, and first association relationship to obtain different events. For example, for the first sentence above, an event (defined as the first event) can be constructed based on "XX Highway", "traffic control", and change relationship. The first event can be as follows: XX Highway - Control. For the second sentence, an event (defined as the second event) can be constructed based on "Control", "XX Month XX Day, 2023", "XX Month XX Day, 2024", start relationship, and end relationship. The second event can be as follows: Control - XX Month XX Day, 2023 to XX Month XX Day, 2024. For the third sentence, an event (defined as the third event) can be constructed based on "XX Expressway", "K000-K1111", and belonging relationship. The third event can be as follows: XX Expressway - K000-K1111.
[0080] In an optional embodiment, in order to better determine the associations of the extracted events and thus merge multiple separate events into a complete event, after constructing different events based on action entities, non-action entities, and the first association relationship, an event subgraph corresponding to each event can be constructed, and the event subgraph corresponding to each event can be used as input to the target event association discrimination model. Accordingly, after step S105, the method may further include:
[0081] The event subgraph for each event is determined by constructing action entities and non-action entities for each event as nodes and constructing the first association between action entities and non-action entities for each event as edges. The attribute information of the nodes includes at least one of the entity's text, category, and part-of-speech tag, and the attributes of the edges include the category of the first association.
[0082] Figure 5 This is a schematic diagram illustrating the construction of an event subgraph and the extraction of intermediate text according to an exemplary embodiment, such as... Figure 5 As shown, for the aforementioned first event, its entities include "XX Highway" and "Control" in "Traffic Control." This first association is a change relationship. Therefore, we can construct an event subgraph corresponding to this first event using the entities "XX Highway" and "Control" in "Traffic Control" as nodes and the change relationship as edges. The attribute information of the nodes in the event subgraph corresponding to this first event includes at least one of the entity's text, category, and part of speech. Specifically, the attribute information of the node corresponding to "XX Highway" includes at least one of the following: the text "XX Highway," the category of "XX Highway" (road), and the part of speech of "XX Highway" (noun). The attribute information of the node corresponding to "Traffic Control" includes at least one of the following: the text "Traffic Control," the category of "Traffic Control" (closed), and the part of speech of "Control" in "Traffic Control" (verb). The attributes of the edges corresponding to this first event include the category of the first association, i.e., the category of the change relationship.
[0083] Continue as Figure 5 As shown, for the second event mentioned above, its entities include "Control", "XX Month XX Day, 2023" and "XX Month XX Day, 2024" in "Control Time". The first association between the non-action entity "XX Month XX Day, 2023" and "Control" is the start relationship, and the first association between the non-action entity "XX Month XX Day, 2024" and "Control" is the end relationship. Therefore, we can construct the event subgraph corresponding to the second event by using the three entities "Control", "XX Month XX Day, 2023" and "XX Month XX Day, 2024" as nodes, using the "start relationship" as the edge between "XX Month XX Day, 2023" and "Control", and using the "end relationship" as the edge between "Control" and "XX Month XX Day, 2024".
[0084] The attribute information of the nodes in the event subgraph corresponding to the second event includes at least one of the text, category, and word nature of the entity. Specifically, the attribute information of the node corresponding to "control" includes at least one of the text "control", the category of "control" (closed), and the word nature of "control" (verb). The attribute information of the node corresponding to "XX, XX, 2023" includes at least one of the text "XX, XX, 2023", the category of "XX, XX, 2023" (time), and the word nature of "XX, XX, 2023" (verb). The attribute information of the node corresponding to "XX, XX, 2024" includes at least one of the text "XX, XX, 2024", the category of "XX, XX, 2024" (time), and the word nature of "XX, XX, 2024" (verb).
[0085] The edges corresponding to the second event include the edge between "XX, XX, 2023" and "control", and the attribute of this edge includes the category of "start relationship". The edges corresponding to the second event also include the edge between "control" and "XX, XX, 2024", and the attribute of this edge includes the category of "end relationship".
[0086] Continue as Figure 5 shown. For the above-mentioned third event, its entities include "control" in the "control section", "XX Expressway", and "K000 - K1111". The first association relationship type between "control" and "XX Expressway" is a change relationship, and the first association relationship between "XX Expressway" and "K000 - K1111" is a belonging relationship. Then, taking "control", "XX Expressway", and "K000 - K1111" as nodes and the change relationship and belonging relationship as edges, an event subgraph corresponding to the third event can be constructed.
[0087] The attribute information of the nodes in the event subgraph corresponding to the third event includes at least one of the following: entity text, category, and part of speech. Specifically, the attribute information of the node corresponding to "Control" includes at least one of the following: the text "Control", the category of "Control" (closed), and the part of speech of "Control" (verb). The attribute information of the node corresponding to "XX Expressway" includes at least one of the following: the text "XX Expressway", the category of "XX Expressway" (expressway), and the part of speech of "XX Expressway". The attribute information of the node corresponding to "K000-K1111" includes at least one of the following: the text "K000-K1111", the category of "K000-K1111" (mileage marker), and the part of speech of "K000-K1111" (numeral). The edge corresponding to the third event includes the edge between "Control" and "XX Expressway", the attribute of which includes the category of change relationship; the edge corresponding to the third event also includes the edge between "XX Expressway" and "K000-K1111", the attribute of which includes the category of belonging relationship.
[0088] In this embodiment, each event is constructed with action entities and non-action entities as nodes, and the first association between action entities and non-action entities in each event is constructed as edges to determine an event subgraph for each event. Since the node attribute information includes at least one of the entity's text, category, and part of speech, and the edge attributes include the category of the association between action entities and non-action entities, the subsequent determination of event association through this event subgraph can better determine the association of the extracted events, thereby accurately merging multiple separate events into a complete event.
[0089] In an optional embodiment, in step S107 above, after different events are constructed, any two of the different events can be combined to obtain any two events. For example, for events 1, 2, and 3, any two events can be events 1 and 2, events 2 and 3, or events 1 and 3. Simultaneously, action entity 1 corresponding to event 1, action entity 2 corresponding to event 2, and action entity 3 corresponding to event 3 are obtained. For events 1 and 2, action entities 1 and 2 can be used as the target action entities for constructing events 1 and 2, action entities 2 and 3 can be used as the target action entities for constructing events 2 and 3, and action entities 1 and 3 can be used as the target action entities for constructing events 1 and 3. Next, the intermediate text between action entities 1 and 2 is obtained from the text to be identified, thus obtaining the intermediate text corresponding to events 1 and 2. The intermediate text between action entities 2 and 3 is obtained from the text to be identified, thus obtaining the intermediate text corresponding to events 2 and 3. The intermediate text between action entities 1 and 3 is obtained from the text to be identified, thus obtaining the intermediate text corresponding to events 1 and 3.
[0090] For example, continue as Figure 5 As shown, the action entity 1 corresponding to event 1 is "control" in "traffic control"; the action entity 2 corresponding to event 2 is "control" in "control time"; and the action entity 3 corresponding to event 3 is "control" in "control section". Therefore, the text between "control" in "traffic control" and "control time" can be obtained from the text to be identified. The resulting intermediate text for events 1 and 2 is: "The relevant matters are hereby announced as follows: I. ". The text between "control" in "control time" and "control" in "control section" can be obtained from the text to be identified. The resulting intermediate text for events 2 and 3 is: "Time: XX / XX / 2023 to XX / XX / 2024. II. ". The text between "control" in "traffic control" and "control time" can be obtained from the text to be identified. The resulting intermediate text for events 1 and 3 is: "The relevant matters are hereby announced as follows: I. Control time: XX / XX / 2023 to XX / XX / 2024. II. ".
[0091] It should be noted that step S109 above can be implemented in various ways, and no specific limitation is made. In one implementation, any two events and the intermediate text can be directly input into the target event association discrimination model for association discrimination processing to obtain the association discrimination result of any two events.
[0092] In another implementation, in order to better determine the association of the extracted events and thus accurately merge multiple events into a complete event, the event subgraphs and intermediate text of any two events can be input into the target event association discrimination model for association discrimination processing to obtain the association discrimination result of any two events. Figure 6 This is a schematic diagram illustrating the structure of a target event association discrimination model according to an exemplary embodiment, such as... Figure 6 As shown, the target event association discrimination model includes a text feature processing layer, a subgraph vector feature processing layer, a vector concatenation layer, and an event association discrimination layer. The text feature processing layer is used to extract and update text features from the intermediate text. The subgraph vector feature processing layer is used to extract vector features from the event subgraphs. The vector concatenation layer concatenates the subgraph representation vectors corresponding to any two events with the global feature input vector corresponding to the intermediate text. The event association discrimination layer performs association discrimination processing on the concatenated vectors.
[0093] The above-mentioned process of inputting the event subgraphs and intermediate text of any two events into the target event association discrimination model for association discrimination processing, and obtaining the association discrimination result of any two events, can include:
[0094] The event subgraphs of any two events are input into the subgraph vector feature processing layer for subgraph vector extraction to obtain the subgraph representation vectors corresponding to the two events; and the intermediate text is input into the text feature processing layer for text feature extraction and update to obtain the global features corresponding to the intermediate text.
[0095] The concatenation layer concatenates the subgraph representation vectors corresponding to any two events with the global feature input vector corresponding to the intermediate text to obtain the concatenated vector.
[0096] The concatenated vector is input to the event association discrimination layer for association discrimination processing to obtain the association discrimination result of any two events.
[0097] Taking the extracted events 1, 2, and 3 as examples, the above process will be explained as follows:
[0098] For the combination of events 1 and 2, the event subgraphs corresponding to each event 1 and event 2 can be input into a subgraph vector feature processing layer for subgraph vector extraction, resulting in subgraph representation vectors for each event 1 and event 2. Simultaneously, the intermediate text corresponding to events 1 and 2 is input into a text feature processing layer for text feature extraction and updating, yielding the global features corresponding to the intermediate text. Next, the subgraph representation vectors for events 1 and 2, along with the global feature input vectors of the intermediate text, are concatenated to obtain a concatenated vector. Finally, an event association discrimination layer is used to perform association discrimination, yielding the association discrimination result for events 1 and 2.
[0099] For the combination of events 2 and 3, the event subgraphs corresponding to events 2 and 3 can be input into a subgraph vector feature processing layer for subgraph vector extraction, yielding subgraph representation vectors for each event. Simultaneously, the intermediate text corresponding to events 2 and 3 is input into a text feature processing layer for text feature extraction and updating, resulting in global features for that intermediate text. Next, the subgraph representation vectors for events 2 and 3, along with the intermediate text feature input vectors for events 1 and 2, are concatenated to obtain a concatenated vector. Finally, an event association discrimination layer is used to perform association discrimination, yielding the association discrimination results for events 2 and 3.
[0100] For the combination of events 1 and 3, the event subgraphs corresponding to events 1 and 3 are input into a subgraph vector feature processing layer for subgraph vector extraction, yielding subgraph representation vectors for each event. Simultaneously, the intermediate input text feature processing layer for events 1 and 3 performs text feature extraction and updating, obtaining the global features corresponding to that intermediate text. Next, the subgraph representation vectors for events 1 and 3, along with the intermediate text feature input vectors, are concatenated to obtain a concatenated vector. Finally, an event association discrimination layer performs association discrimination to obtain the association results for events 1 and 3.
[0101] The target event association discrimination model in this embodiment includes a text feature processing layer, a subgraph vector feature processing layer, a vector concatenation layer, and an event association discrimination layer. Through the interaction of these layers, the extracted events can be accurately associated, improving the accuracy of the association discrimination results and thus improving the accuracy of merging the extracted events into a complete event. In addition, since the node attributes in the event subgraph include at least one of the entity's text, category, and part-of-speech, and the edge attributes include the category of the first association relationship, using the subgraph as the input of the target event association discrimination model allows for the consideration of not only the influence of at least one of the entity's text, category, and part-of-speech, but also the influence of the category of the first association relationship when extracting subgraph features. This further improves the accuracy of the association discrimination results, thereby further improving the accuracy of merging the extracted events into a complete event and ultimately improving the accuracy of updating the data in the relevant database.
[0102] In an optional embodiment, the subgraph vector feature processing layer includes a graph pooling layer and a graph convolutional network. Therefore, the above-mentioned inputting the event subgraphs of any two events into the subgraph vector feature processing layer for subgraph vector extraction to obtain the subgraph representation vectors corresponding to each of the two events can include:
[0103] Input the event subgraphs of any two events into a graph convolutional network. Based on the graph convolutional network, obtain the features of each node in the event subgraphs of any two events, as well as the features of each node's neighboring nodes. Aggregate and update the features of each node and the features of each node's neighboring nodes to obtain the node representation vectors in the event subgraphs of any two events.
[0104] The node representation vectors are input into the graph pooling layer for graph pooling processing to obtain the subgraph representation vectors corresponding to any two events.
[0105] In this embodiment, continue as follows Figure 6As shown, the subgraph vector feature processing layer can include two layers of Graph Convolutional Networks (GCN) and a graph pooling layer. These two layers learn the node representation by aggregating and updating the information of each node and its neighboring nodes, thus obtaining the node representation vectors in the event subgraphs of any two events. This process mainly includes two steps:
[0106] Feature aggregation: Each node collects features from its neighboring nodes and may include its own features, typically achieved by multiplying the adjacency matrix and the feature matrix.
[0107] Feature update: Each node updates based on the collected features of its neighbors and its own features. For example, the aggregated information is processed through a neural network layer (usually a linear transformation followed by a non-linear activation function) to generate a new node representation.
[0108] Next, graph pooling is used to perform graph pooling on the node representation vectors in the event subgraphs of any two events, resulting in the subgraph representation vectors corresponding to each of the two events (e.g., Figure 6 (E1 and E2 in the original text). For example, this graph pooling can include, but is not limited to, flat graph pooling and hierarchical graph pooling. Flat graph pooling directly obtains the overall graph representation by reducing or aggregating the nodes in the graph in a single operation, thus quickly extracting the global representation of the graph. Hierarchical graph pooling simplifies the graph structure progressively through a phased strategy, that is, by reducing the number of nodes at each layer of the graph, it gradually builds a higher-level representation of the graph.
[0109] For example, for events 1 and 2 mentioned above, the event subgraphs of events 1 and 2 can be input into a graph convolutional network to obtain the features of each node in the event subgraphs of events 1 and 2, as well as the features of each node's neighboring nodes. The features of each node and the features of each node's neighboring nodes are then aggregated and updated to obtain the node representation vectors in the event subgraphs of events 1 and 2. These node representation vectors are then input into a graph pooling layer for graph pooling processing to obtain the corresponding subgraph representation vectors for events 1 and 2.
[0110] For example, for events 1 and 3 mentioned above, the event subgraphs of events 1 and 3 can be input into a graph convolutional network to obtain the features of each node in the event subgraphs of events 1 and 3, as well as the features of each node's neighboring nodes. The features of each node and the features of each node's neighboring nodes are then aggregated and updated to obtain the node representation vectors in the event subgraphs of events 1 and 3. These node representation vectors are then input into a graph pooling layer for graph pooling processing to obtain the corresponding subgraph representation vectors for events 1 and 3.
[0111] For example, for events 2 and 3 mentioned above, the event subgraphs of events 2 and 3 can be input into a graph convolutional network to obtain the features of each node in the event subgraphs of events 2 and 3, as well as the features of each node's neighboring nodes. The features of each node and the features of each node's neighboring nodes are then aggregated and updated to obtain the node representation vectors in the event subgraphs of events 2 and 3. These node representation vectors are then input into a graph pooling layer for graph pooling processing to obtain the corresponding subgraph representation vectors for events 2 and 3.
[0112] For example, this application does not limit the dimension of the subgraph representation vector corresponding to each event. For instance, the dimension of the subgraph representation vector corresponding to each event can be 64 dimensions.
[0113] In other implementations, in addition to extracting graph features through graph convolutional networks, graph neural networks (GNNs) can also be used to extract graph features.
[0114] Since the target event association discrimination model in this application is based on an event subgraph, and graph convolutional networks can efficiently and accurately process graph data, extracting node representation vectors from the event subgraph using graph convolutional networks can improve the accuracy and efficiency of node representation vector extraction, thereby improving the accuracy and efficiency of association discrimination. In addition, since graph pooling operations can perform dimensionality reduction and aggregation on nodes in the graph, the subgraph representation vectors can be accurately obtained, further improving the accuracy of association discrimination results.
[0115] In an optional embodiment, the text feature processing layer includes a text feature extraction layer and a fully connected layer. The process of inputting the intermediate text into the text feature processing layer for text feature extraction and updating to obtain the global features corresponding to the intermediate text includes:
[0116] The intermediate text is input into the text feature extraction layer for text vector extraction to obtain the initial global features corresponding to the intermediate text.
[0117] The initial global features are input into the fully connected layer for dimensionality transformation to obtain the global features.
[0118] In this embodiment, the text feature processing layer may further include a text feature extraction layer and a fully connected layer.
[0119] For example, a start marker ([CLS] marker) can be added at the beginning position of the intermediate text, and an end marker (SEP) can be added at the end position of the intermediate text. This text feature extraction layer is used to extract the text feature vector of each word in the intermediate text through a pre-trained BERT model, and the text feature vector corresponding to the position of the [CLS] marker is used as the initial global feature of the intermediate text. That is, the text feature vector corresponding to the position of the [CLS] marker represents the global information of the intermediate text. This application embodiment does not limit the vector dimension of the initial global feature; for example, it can be 768-dimensional. Here, BERT is a language representation model.
[0120] To ensure that the dimension of the global features of the text vector is equal to the dimension of the subgraph representation vector, a fully connected layer can be used to perform a dimension transformation on the initial global features, converting the vector dimension of the global features to the same dimension as the subgraph representation vector, for example, converting it to 64 dimensions, thus obtaining the global features of the intermediate text corresponding to any two events (e.g., ...). Figure 6 (M).
[0121] In other implementations, for the global features of the intermediate text, pre-trained word vectors + convolutional neural networks (CNNs) or word vectors + long short-term memory networks (LSTMs) can also be used to extract text features.
[0122] For example, regarding events 1 and 2, the intermediate text corresponding to events 1 and 2 can be input into a text feature extraction layer for text vector extraction to obtain initial global features corresponding to events 1 and 2. These initial global features are then input into a fully connected layer for dimension transformation to obtain the global features of the intermediate text corresponding to events 1 and 2. Similarly, for events 1 and 3, the intermediate text corresponding to events 1 and 3 can be input into a text feature extraction layer for text vector extraction to obtain initial global features corresponding to events 1 and 3. These initial global features are then input into a fully connected layer for dimension transformation to obtain the global features of the intermediate text corresponding to events 1 and 3. Likewise, for events 2 and 3, the intermediate text corresponding to events 2 and 3 can be input into a text feature extraction layer for text vector extraction to obtain initial global features corresponding to events 2 and 3. These initial global features are then input into a fully connected layer for dimension transformation to obtain the global features of the intermediate text corresponding to events 2 and 3.
[0123] Therefore, by first performing initial global feature extraction on the intermediate text through a text feature extraction layer, the initial global features corresponding to the intermediate text can be accurately obtained. Then, the initial global features are transformed through a fully connected layer to convert the vector dimension of the global features to the same dimension as the subgraph representation vector, thereby improving the accuracy of subsequent vector concatenation and thus improving the accuracy of event association discrimination processing.
[0124] In an optional embodiment, the above-mentioned concatenation layer, which concatenates the subgraph representation vectors corresponding to any two events and the global feature input vector corresponding to the intermediate text, to obtain the concatenated vector, may include:
[0125] The concatenation layer is used to concatenate the subgraph representation vectors corresponding to any two events with the global feature input vector corresponding to the intermediate text, so that the global features are concatenated between the subgraph representation vectors corresponding to any two events, resulting in a concatenated vector.
[0126] In this embodiment, continue as follows Figure 6 As shown, a vector concatenation layer can be used to concatenate the global features of the intermediate text corresponding to any two events between the subgraph representation vectors corresponding to each of the two events, resulting in a concatenated vector. Since the global features are accurately extracted through the text feature extraction layer and the fully connected layer, and the subgraph representation vectors are accurately extracted through the graph pooling layer and the graph convolutional network, concatenating the highly accurate global features and subgraph representation vectors improves the accuracy of the concatenated vector, thereby enhancing the accuracy of the association discrimination result.
[0127] For example, when the global feature is 64-dimensional and the subgraph representation vector is 64-dimensional, the dimension of the concatenated vector can be 3*64-dimensional.
[0128] For example, for events 1 and 2 above, the global features of the intermediate text corresponding to events 1 and 2 can be concatenated between the subgraph representation vectors corresponding to events 1 and 2 respectively, resulting in a concatenated vector for events 1 and 2. Similarly, for events 1 and 3 above, the global features of the intermediate text corresponding to events 1 and 3 can be concatenated between the subgraph representation vectors corresponding to events 1 and 3 respectively, resulting in a concatenated vector for events 1 and 3. Likewise, for events 2 and 3 above, the global features of the intermediate text corresponding to events 2 and 3 can be concatenated between the subgraph representation vectors corresponding to events 2 and 3 respectively, resulting in a concatenated vector for events 2 and 3.
[0129] In an optional embodiment, if the target scenario is a text content recognition scenario involving the opening and closing of roads, then in step S1011, updating the text to be recognized based on the association discrimination result may include:
[0130] If the association determination result indicates that any two events are related, then the two events are merged to obtain a merged event.
[0131] The text to be identified is updated based on the merged event; the updated text to be identified is used to update the map data.
[0132] In this embodiment, in the text content recognition scenario involving open and closed roads, if the probability value corresponding to the association judgment result is relatively high, then any two events are considered to be related. These two events are then merged to obtain a merged event, and the text to be recognized is updated based on this merged event. Simultaneously, the updated text is pushed to the operation platform, which then writes it into the map database to update the map data. This facilitates timely updates to navigation display information within the map, providing people with reliable and efficient travel guidance.
[0133] In other embodiments, if the probability value corresponding to the association judgment result is small, then any two events are considered to be independent events with no association relationship, and there is no need to merge the two events.
[0134] In another optional embodiment, if the target scenario is a text content recognition scenario related to sports, then in step S1011, updating the text to be recognized based on the association discrimination result may include:
[0135] If the association determination result indicates that any two events are related, the two events are merged to obtain a merged event. The text to be identified is then updated based on the merged event; the updated text is used to update sports news.
[0136] In this embodiment, in the text content recognition scenario of sports, if the probability value corresponding to the association judgment result is large, it is considered that any two events are related. Then, any two events are merged to obtain a merged event, and the text to be recognized is updated based on the merged event, thereby updating the sports news.
[0137] This application embodiment constructs an event subgraph based on the text, type, part-of-speech, and relationships of entities. It extracts subgraph features using a graph convolutional network and concatenates intermediate text features between action entities to jointly predict the association judgment result between any two events, such as the association probability. This allows for effective association judgment of the extracted events, thereby merging multiple separate events into a complete event and accurately updating the text to be identified. For example, the text to be identified is: "Due to the construction of XX Highway, in order to ensure the smooth progress of the project and road traffic safety during construction, according to XX regulations, it has been decided to implement temporary traffic control on the construction section. The relevant matters are hereby announced as follows: 1. Control period: XX month XX day, 2023 to XX month XX day, 2024. 2. Controlled section: XX Expressway K000-K1111." From this text, three events are extracted: "XX Highway - Traffic Control", "Control - XX month XX day, 2023 to XX month XX day, 2024", and "Control - XX Expressway K000-K1111". The method in this application embodiment can input any two of the three independent events into the target event association discrimination model to determine whether there is an association between the two events. If there is an association, the three independent events can be spliced into a complete event, namely "XX Highway, XX Expressway K000-K1111-Control-2023 XX Month XX Day to 2024 XX Month XX Day".
[0138] The following describes the training process of the target event association discrimination model:
[0139] Figure 7 This is a flowchart illustrating the training process of a target event association discrimination model according to an exemplary embodiment, such as... Figure 7 As shown, the training process includes:
[0140] S201. Obtain the sample text to be identified corresponding to the target scene.
[0141] Optionally, the sample text to be identified is a sample text that corresponds to and is related to the target scene. For example, in a text content recognition scenario where the target scene is a road opening / closing situation, the sample text to be identified can be text related to road opening / closing, such as whether the road is passable or whether there is congestion. In a text content recognition scenario where the target scene is a sports activity, the sample text to be identified can be text related to sports activities.
[0142] S203. Extract sample action entities associated with the target scene from the sample text to be identified, as well as non-sample action entities that have a second association with the sample action entities.
[0143] S205. Construct different sample events based on sample action entities, non-sample action entities, and the second association relationship.
[0144] It should be noted that the specific process of steps S203-S205 can be found in steps S103-S105 above, and no specific limitations are made here.
[0145] S207. Obtain intermediate sample text located between target sample action entities from the sample text to be identified; the target action entity is the action entity of any two sample events in different sample events.
[0146] It should be noted that the specific process of step S207 can be referred to step S107 above, and no specific limitations are made thereto.
[0147] S209. Input any two sample events and intermediate sample text into a preset event association discrimination model for association discrimination processing to obtain the predicted association discrimination result of any two events.
[0148] S2011. Determine the loss data based on the difference between the preset association discrimination results and the association labels corresponding to any two sample events, and adjust the model parameters of the preset event association discrimination model based on the loss data to obtain the target event association discrimination model.
[0149] In this embodiment of the application, for the training process, association labels can be pre-set for any two sample events. These association labels indicate whether the two events are related or not. Loss data is calculated based on the difference between the predicted association judgment result of any two sample events and the corresponding association labels. For example, this loss data can be cross-entropy loss, and the specific calculation formula can be as follows:
[0150] L=-∑y i logp i ;
[0151] Where L refers to the cross-entropy loss, p i This refers to the predicted association result of any two sample events, y i This refers to the associated labels corresponding to any two sample events.
[0152] Next, the model parameters of the preset event association discrimination model are adjusted based on the loss data until the preset event association discrimination model converges, thus obtaining the target event association discrimination model.
[0153] In the model training process of this application embodiment, different sample events are constructed through non-sample action entities, and intermediate sample texts corresponding to any two events are extracted from the sample text to be identified based on the non-sample action entities. Then, the preset association discrimination model is trained by combining any two events and the intermediate sample texts corresponding to any two events. Since the intermediate sample texts between the action entities of any two sample events can reflect the association relationship between any two sample events to a certain extent, the preset association discrimination model is trained by combining any two sample events and the intermediate sample texts corresponding to any two sample events, so that the trained target event association discrimination model can accurately predict the association discrimination result between any two events.
[0154] In an optional embodiment, in step S203 above, the extraction of sample action entities associated with the target scene and non-sample action entities having a second association with the sample action entities from the sample text to be identified may include:
[0155] Extract sample sentences from the text to be identified that contain sample action entities associated with the target scene, and determine them as candidate sample sentences.
[0156] Identify the sample action entities in the candidate sample sentences that are associated with the target scene, and the non-sample action entities that have a second association with the sample action entities.
[0157] It should be noted that the process of "extracting sample action entities associated with the target scene from the sample text to be identified, and non-sample action entities that have a second association with the sample action entities" is the same as steps S1031-S1033 above, and will not be repeated here.
[0158] In an optional embodiment, in order to better determine the association of the extracted sample events, thereby merging multiple separate events into a complete sample event, after constructing different sample events based on sample action entities, non-sample action entities, and the second association relationship, a sample event subgraph corresponding to each sample event can be constructed, and the sample event subgraph corresponding to each event can be used as input to a preset event association discrimination model. Accordingly, after step S205, the method may further include:
[0159] The sample event subgraph for each sample event is determined by using the sample action entities and non-sample action entities that constitute each sample event as sample nodes and the second association relationship between the sample action entities and non-sample action entities that constitute each sample event as sample edges. The attribute information of the sample nodes includes at least one of the text, category, and part-of-speech of the sample entity, and the attributes of the sample edges include the category of the second association relationship.
[0160] In an optional embodiment, in step S207 above, after the different sample events are constructed, any two of the different sample events can be combined to obtain any two sample events. This process can be referred to step S107 above, and is not specifically limited thereto.
[0161] It should be noted that step S209 above can be implemented in various ways, and no specific limitation is made. In one embodiment, any two sample events and intermediate sample text can be directly input into a preset event association discrimination model for association discrimination processing to obtain the predicted association discrimination result of any two sample events.
[0162] In another implementation, to better determine the associations of the extracted sample events and accurately merge multiple separate sample events into a complete event, the sample event subgraphs of any two sample events and the intermediate sample text can be input into a preset event association discrimination model for association discrimination processing to obtain the predicted association discrimination result of any two preset events. Accordingly, the preset event association discrimination model includes a text feature processing layer, a subgraph vector feature processing layer, a vector concatenation layer, and an event association discrimination layer. The text feature processing layer is used to extract and update text features from the intermediate sample text. The subgraph vector feature processing layer is used to extract vector features from the sample event subgraphs. The vector concatenation layer is used to concatenate the subgraph representation vectors corresponding to any two sample events and the global feature input vector corresponding to the intermediate sample text. The event association discrimination layer is used to perform association discrimination processing on the concatenated vectors.
[0163] The above-mentioned input of any two sample events and intermediate sample text into a preset event association discrimination model for association discrimination processing, to obtain the predicted association discrimination result of any two sample events, can include:
[0164] The sample event subgraphs of any two sample events are input into the subgraph vector feature processing layer for subgraph vector extraction to obtain the subgraph representation vectors corresponding to each of the two sample events; and the intermediate sample text is input into the text feature processing layer for text feature extraction and update to obtain the global features corresponding to the intermediate sample text.
[0165] The concatenation layer concatenates the subgraph representation vectors corresponding to any two sample events and the global feature input vectors corresponding to the intermediate text of the samples to obtain the concatenated vector of any two sample events.
[0166] The concatenated vector of any two sample events is input into the event association discrimination layer for association discrimination processing to obtain the predicted association discrimination result of any two sample events.
[0167] It should be noted that the process of determining the predictive association of any two sample events is the same as the process of determining the association of any two events, and will not be repeated here.
[0168] In an optional embodiment, the subgraph vector feature processing layer includes a graph pooling layer and a graph convolutional network. Therefore, the process of inputting the sample event subgraphs of any two sample events into the subgraph vector feature processing layer for subgraph vector extraction to obtain the subgraph representation vectors corresponding to each of the two sample events can include:
[0169] Input the sample event subgraphs of any two sample events into a graph convolutional network. Based on the graph convolutional network, obtain the features of each sample node in the sample event subgraphs of any two sample events, as well as the features of each sample node's neighboring nodes. Aggregate and update the features of each sample node and the features of each sample node's neighboring nodes to obtain the node representation vectors in the event subgraphs of any two sample events.
[0170] The node representation vectors in the event subgraphs of any two sample events are input into the graph pooling layer for graph pooling processing to obtain the subgraph representation vectors corresponding to each of the two sample events.
[0171] It should be noted that the process of determining the subgraph representation vectors corresponding to any two sample events is the same as the process of determining the node representation vectors in the event subgraphs of any two events, and no specific limitations are imposed on it.
[0172] In an optional embodiment, the text feature processing layer includes a text feature extraction layer and a fully connected layer. The process of inputting intermediate sample text into the text feature processing layer for text feature extraction and updating to obtain the global features corresponding to the intermediate sample text includes:
[0173] The intermediate sample text is input into the text feature extraction layer for text vector extraction processing to obtain the initial global features corresponding to the intermediate sample text.
[0174] The initial global features corresponding to the intermediate sample text are input into the fully connected layer for dimensionality transformation to obtain the global features corresponding to the intermediate sample text.
[0175] It should be noted that the process of determining the "global features corresponding to the intermediate sample text" here is the same as the process of determining the "global features of any two events" mentioned above, and will not be repeated here.
[0176] In an optional embodiment, the above-described concatenation layer, which concatenates the subgraph representation vectors corresponding to any two sample events and the global feature input vectors corresponding to the intermediate text of the samples, to obtain the concatenated vector of any two sample events, may include:
[0177] The concatenation layer is formed by combining the subgraph representation vectors corresponding to any two sample events with the global feature input vector corresponding to the intermediate sample text, so that the global features are concatenated between the subgraph representation vectors corresponding to any two sample events, resulting in the concatenated vector of any two sample events.
[0178] It should be noted that the process of determining the "concatenation vector of any two sample events" here is the same as the process of determining the concatenation vector of any two events described above, and will not be repeated here.
[0179] Figure 8 This is a block diagram illustrating an event processing apparatus according to an exemplary embodiment, such as... Figure 8 The event handling device includes:
[0180] The text to be recognized module 301 is used to acquire the text to be recognized corresponding to the target scene;
[0181] The entity extraction module 303 is used to extract action entities associated with the target scene and non-action entities that have a first association relationship with the action entities from the text to be identified.
[0182] Event construction module 305 is used to construct different events based on the action entity, the non-action entity and the first association relationship;
[0183] The intermediate text acquisition module 307 is used to acquire intermediate text located between target action entities from the text to be identified; the target action entity is the action entity that constructs any two events in the different events.
[0184] The association discrimination module 309 is used to input the arbitrary two events and the intermediate text into the target event association discrimination model for association discrimination processing, and obtain the association discrimination result of the arbitrary two events; wherein, the target event association discrimination model is obtained by training a preset association discrimination model based on the arbitrary two sample events and the intermediate sample text that constructs the action entities between the arbitrary two sample events; the different sample events are constructed based on the sample action entities in the sample text to be identified that are associated with the target scene, the non-sample action entities that have a second association relationship with the sample action entities, and the second association relationship.
[0185] The update module 3011 is used to update the text to be identified based on the association discrimination result.
[0186] In an optional embodiment, the entity extraction module includes:
[0187] The sentence extraction unit is used to extract sentences in the text to be identified that contain action entities associated with the target scene, and obtain them as candidate sentences;
[0188] An entity determination unit is used to determine the action entities in the candidate sentences that are associated with the target scene, and the non-action entities that have a first association relationship with the action entities.
[0189] In an optional embodiment, the apparatus further includes:
[0190] An event subgraph construction module is used to determine the event subgraph for each event by constructing action entities and non-action entities for each event as nodes and constructing the first association relationship between action entities and non-action entities for each event as edges; the attribute information of the nodes includes at least one of the entity's text, category, and part-of-speech tag, and the attribute of the edge includes the category of the first association relationship.
[0191] Accordingly, the association discrimination module includes:
[0192] The association discrimination result generation unit is used to input the event subgraphs of any two events and the intermediate text into the target event association discrimination model for association discrimination processing, and obtain the association discrimination result of the two events.
[0193] In an optional embodiment, the target event association discrimination model includes a text feature processing layer, a subgraph vector feature processing layer, a vector concatenation layer, and an event association discrimination layer; the association discrimination result generation unit includes:
[0194] The vector extraction subunit is used to input the event subgraphs of any two events into the subgraph vector feature processing layer for subgraph vector extraction processing to obtain the subgraph representation vectors corresponding to the two events; and to input the intermediate text into the text feature processing layer for text feature extraction and update processing to obtain the global features corresponding to the intermediate text.
[0195] The vector concatenation subunit is used to input the subgraph representation vectors corresponding to each of the two events and the global features corresponding to the intermediate text into the vector concatenation layer for concatenation processing to obtain the concatenated vector.
[0196] The vector discrimination unit is used to input the concatenated vector into the event association discrimination layer for association discrimination processing to obtain the association discrimination result of any two events.
[0197] In an optional embodiment, the subgraph vector feature processing layer includes a graph pooling layer and a graph convolutional network, and the vector extraction subunit includes:
[0198] The node processing subunit is used to input the event subgraphs of any two events into the graph convolutional network, obtain the features of each node in the event subgraphs of any two events and the features of each node's neighboring nodes based on the graph convolutional network, and perform aggregation and update processing on the features of each node and the features of each node's neighboring nodes to obtain the node representation vectors in the event subgraphs of any two events.
[0199] The pooling subunit is used to input the node representation vector into the graph pooling layer for graph pooling processing to obtain the subgraph representation vectors corresponding to each of the two events.
[0200] In an optional embodiment, the vector extraction subunit includes:
[0201] An initial global feature extraction subunit is used to input the intermediate text into the text feature extraction layer for text vector extraction processing to obtain the initial global features corresponding to the intermediate text.
[0202] The dimension transformation subunit is used to input the initial global features into the fully connected layer for dimension transformation processing to obtain the global features.
[0203] In an optional embodiment, the vector splicing subunit includes:
[0204] The concatenation vector generation subunit is used to input the subgraph representation vectors corresponding to each of the two events and the global features corresponding to the intermediate text into the vector concatenation layer, so as to concatenate the global features between the subgraph representation vectors corresponding to each of the two events to obtain the concatenation vector.
[0205] In an optional embodiment, the update module includes:
[0206] The merging unit is used to merge any two events to obtain a merged event when the association discrimination result indicates that any two events are related.
[0207] A text update unit is used to update the text to be identified based on the merging event;
[0208] The updated text to be recognized is used to update the map data.
[0209] In an optional embodiment, the device includes:
[0210] The sample text acquisition module is used to acquire the sample text to be identified corresponding to the target scene;
[0211] The sample entity acquisition module is used to extract sample action entities associated with the target scene from the sample text to be identified, as well as non-sample action entities that have a second association relationship with the sample action entities;
[0212] A sample event construction module is used to construct different sample events based on the sample action entity, the non-sample action entity, and the second association relationship;
[0213] The intermediate sample text acquisition module is used to acquire intermediate sample text located between target sample action entities from the sample text to be identified; the target action entity is the action entity that constructs any two sample events in the different sample events.
[0214] The prediction association discrimination result generation module is used to input the arbitrary two sample events and the intermediate sample text into a preset event association discrimination model for association discrimination processing, and obtain the prediction association discrimination result of the arbitrary two sample events;
[0215] The parameter adjustment module is used to determine loss data based on the difference between the preset association discrimination result and the association labels corresponding to any two sample events, and to adjust the model parameters of the preset event association discrimination model based on the loss data to obtain the target event association discrimination model.
[0216] It should be noted that the device embodiments provided in this application are based on the same inventive concept as the method embodiments described above.
[0217] This application also provides an electronic device for event processing, which includes a processor and a memory. The memory stores at least one instruction or at least one program. The processor loads and executes the at least one instruction or at least one program to implement the event processing method provided in any of the above embodiments.
[0218] Embodiments of this application also provide a computer-readable storage medium that can be disposed in a terminal to store at least one instruction or at least one program for implementing an event handling method in the method embodiments, wherein the at least one instruction or at least one program is loaded and executed by a processor to implement the event handling method provided in the above method embodiments.
[0219] Optionally, in the embodiments of this specification, the storage medium may be located at at least one of the multiple network servers in a computer network. Optionally, in this embodiment, the storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0220] The memory described in this specification can be used to store software programs and modules. The processor executes various functional applications and event processing by running the software programs and modules stored in the memory. The memory may primarily include a program storage area and a data storage area. The program storage area may store the operating system, applications required for functions, etc.; the data storage area may store data created based on the use of the device, etc. Furthermore, the memory may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory may also include a memory controller to provide the processor with access to the memory.
[0221] This application also provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the event handling method provided in the above-described method embodiments.
[0222] The event handling method provided in this application can be executed on a terminal, computer terminal, server, or similar computing device. Taking running on a server as an example... Figure 9This is a hardware structure block diagram of a server according to an exemplary embodiment. For example... Figure 9 As shown, the server 400 can vary significantly due to different configurations or performance. It may include one or more Central Processing Units (CPUs) 410 (CPUs 410 may include, but are not limited to, microprocessors (MCUs) or programmable logic devices (FPGAs), a memory 430 for storing data, and one or more storage media 420 (e.g., one or more mass storage devices) for storing application programs 423 or data 422. The memory 430 and storage media 420 may be temporary or persistent storage. The program stored in the storage media 420 may include one or more modules, each module may include a series of instruction operations on the server. Furthermore, the CPU 410 may be configured to communicate with the storage media 420 and execute the series of instruction operations stored in the storage media 420 on the server 400. Server 400 may also include one or more power supplies 460, one or more wired or wireless network interfaces 450, one or more input / output interfaces 440, and / or one or more operating systems 421, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.
[0223] The input / output interface 440 can be used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of server 400. In one example, the input / output interface 440 includes a network interface controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the input / output interface 440 may be a radio frequency (RF) module for wireless communication with the Internet.
[0224] Those skilled in the art will understand that Figure 9 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, server 400 may also include... Figure 9 The more or fewer components shown, or having the same Figure 9 The different configurations shown.
[0225] It should be noted that the order of the embodiments described above is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. Furthermore, specific embodiments have been described above. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims can be performed in a different order than that shown in the embodiments and still achieve the desired result. Additionally, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0226] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the device and server embodiments are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0227] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware, or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0228] The above are merely preferred embodiments of this application and are not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. An event handling method, characterized in that, The event handling method includes: Obtain the text to be recognized corresponding to the target scene; Extract action entities associated with the target scene from the text to be identified, and non-action entities that have a first association relationship with the action entities; Different events are constructed based on the action entity, the non-action entity, and the first association relationship; Obtain the intermediate text located between the target action entities from the text to be identified; the target action entities are the action entities that construct any two events in the different events; The arbitrary two events and the intermediate text are input into the target event association discrimination model for association discrimination processing to obtain the association discrimination result of the arbitrary two events; wherein, the target event association discrimination model is obtained by training a preset association discrimination model based on the arbitrary two sample events and the intermediate sample text that constructs the action entities between the arbitrary two sample events; the different sample events are constructed based on the sample action entities in the sample text to be identified that are associated with the target scene, the non-sample action entities that have a second association relationship with the sample action entities, and the second association relationship. The text to be identified is updated based on the association discrimination result.
2. The event handling method according to claim 2, characterized in that, The step of extracting action entities associated with the target scene and non-action entities having a first association relationship with the action entities from the text to be identified includes: Sentences containing action entities associated with the target scene are extracted from the text to be identified and obtained as candidate sentences; Identify the action entities in the candidate sentences that are associated with the target scene, and the non-action entities that have a first association relationship with the action entities.
3. The event handling method according to claim 1, characterized in that, After constructing different events based on the action entity, the non-action entity, and the first association relationship, the method further includes: Using action entities and non-action entities for each event as nodes, and the first association between action entities and non-action entities for each event as edges, an event subgraph for each event is determined; the attribute information of the nodes includes at least one of the entity's text, category, and part-of-speech tag, and the attributes of the edges include the category of the first association; The step of performing association discrimination processing on the association discrimination model of any two events and the intermediate text input target event to obtain the association discrimination result of any two events includes: The event subgraphs of any two events and the intermediate text are input into the target event association discrimination model for association discrimination processing to obtain the association discrimination result of the two events.
4. The event handling method according to claim 3, characterized in that, The target event association discrimination model includes a text feature processing layer, a subgraph vector feature processing layer, a vector concatenation layer, and an event association discrimination layer. The step of inputting the event subgraphs of any two events and the intermediate text into the target event association discrimination model for association discrimination processing to obtain the association discrimination result of the two events includes: The event subgraphs of any two events are input into the subgraph vector feature processing layer for subgraph vector extraction to obtain the subgraph representation vectors corresponding to the two events; and the intermediate text is input into the text feature processing layer for text feature extraction and update to obtain the global features corresponding to the intermediate text. The subgraph representation vectors corresponding to any two events and the global features corresponding to the intermediate text are input into the vector concatenation layer for concatenation processing to obtain the concatenated vector. The concatenated vector is input into the event association discrimination layer for association discrimination processing to obtain the association discrimination result of any two events.
5. The event handling method according to claim 4, characterized in that, The subgraph vector feature processing layer includes a graph pooling layer and a graph convolutional network. The step of inputting the event subgraphs of any two events into the subgraph vector feature processing layer for subgraph vector extraction processing yields the subgraph representation vectors corresponding to each of the two events, including: The event subgraphs of any two events are input into the graph convolutional network. Based on the graph convolutional network, the features of each node in the event subgraphs of any two events, as well as the features of each node's neighboring nodes, are obtained. The features of each node and the features of each node's neighboring nodes are aggregated and updated to obtain the node representation vectors in the event subgraphs of any two events. The node representation vector is input into the graph pooling layer for graph pooling processing to obtain the subgraph representation vectors corresponding to each of the two events.
6. The event handling method according to claim 4, characterized in that, The text feature processing layer includes a text feature extraction layer and a fully connected layer. The step of inputting the intermediate text into the text feature processing layer for text feature extraction and update processing to obtain the global features corresponding to the intermediate text includes: The intermediate text is input into the text feature extraction layer for text vector extraction processing to obtain the initial global features corresponding to the intermediate text. The initial global features are input into the fully connected layer for dimensionality transformation to obtain the global features.
7. The event handling method according to claim 4, characterized in that, The step of inputting the subgraph representation vectors corresponding to each of the two events and the global features corresponding to the intermediate text into the vector concatenation layer for concatenation processing to obtain the concatenated vector includes: The subgraph representation vectors corresponding to any two events and the global features corresponding to the intermediate text are input into the vector concatenation layer to concatenate the global features between the subgraph representation vectors corresponding to any two events, thereby obtaining the concatenated vector.
8. The event handling method according to claim 1, characterized in that, The target scenario is a text content recognition scenario involving the opening and closing of roads. The step of updating the text to be recognized based on the association discrimination result includes: If the association determination result indicates that any two events are related, the two events are merged to obtain a merged event; The text to be identified is updated based on the merge event; The updated text to be recognized is used to update the map data.
9. The event handling method according to any one of claims 1 to 8, characterized in that, The training process of the target event association discrimination model includes: Obtain the sample text to be identified corresponding to the target scene; Extract sample action entities associated with the target scene from the sample text to be identified, and non-sample action entities that have a second association relationship with the sample action entities; Different sample events are constructed based on the sample action entity, the non-sample action entity, and the second association relationship; Obtain intermediate sample text located between target sample action entities from the sample text to be identified; the target action entity is the action entity that constructs any two sample events in the different sample events. The two sample events and the intermediate sample text are input into a preset event association discrimination model for association discrimination processing to obtain the predicted association discrimination result of the two sample events. Based on the difference between the preset association discrimination result and the association labels corresponding to any two sample events, the loss data is determined, and the model parameters of the preset event association discrimination model are adjusted based on the loss data to obtain the target event association discrimination model.
10. An event processing device, characterized in that, The device includes: The text to be recognized module is used to acquire the text to be recognized corresponding to the target scene; The entity extraction module is used to extract action entities associated with the target scene and non-action entities that have a first association relationship with the action entities from the text to be identified. The event construction module is used to construct different events based on the action entity, the non-action entity, and the first association relationship; The intermediate text acquisition module is used to acquire intermediate text located between target action entities from the text to be identified; the target action entity is the action entity that constructs any two events in the different events. The association discrimination module is used to input the arbitrary two events and the intermediate text into the target event association discrimination model for association discrimination processing, and obtain the association discrimination result of the arbitrary two events; wherein, the target event association discrimination model is obtained by training a preset association discrimination model based on the arbitrary two sample events and the intermediate sample text that constructs the action entities between the arbitrary two sample events; the different sample events are constructed based on the sample action entities in the sample text to be identified that are associated with the target scene, the non-sample action entities that have a second association relationship with the sample action entities, and the second association relationship. The update module is used to update the text to be identified based on the association discrimination result.
11. An electronic device for event processing, characterized in that, The electronic device includes a processor and a memory, the memory storing at least one instruction or at least one program, wherein the at least one instruction or the at least one program is loaded and executed by the processor to implement the event handling method as described in any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one instruction or at least one program, which is loaded and executed by a processor to implement the event handling method as described in any one of claims 1 to 9.