Method, device and electronic equipment for determining a traffic event

By identifying location entities and sentence relationships in the target text, and using a multi-layer graph convolutional network to process heterogeneous graphs and extract location features, the problem of low accuracy in traffic event identification is solved, achieving accurate traffic event recognition even without trigger words.

CN116450857BActive Publication Date: 2026-07-24AUTONAVI SOFTWARE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
AUTONAVI SOFTWARE CO LTD
Filing Date
2023-03-29
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

In existing technologies, the accuracy of traffic incident identification is low, especially when road notices do not contain traffic incident trigger words, resulting in valuable information being incorrectly filtered out.

Method used

By acquiring location entities and sentences from the target text, object relationships are determined, and a pre-trained language model and multi-layer graph convolutional network are used to process the initial heterogeneous graph, generating a target heterogeneous graph and extracting the location features of location entities to accurately identify traffic events.

Benefits of technology

Even if the target text does not contain traffic event trigger words, it can still accurately identify traffic events, thus improving the accuracy of traffic event identification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116450857B_ABST
    Figure CN116450857B_ABST
Patent Text Reader

Abstract

The application provides a traffic event determination method and device and electronic equipment. The method comprises: obtaining target text related to traffic event information; determining a plurality of objects in the target text, the objects comprising a location entity and a sentence in the target text; determining an object relationship between the plurality of objects; determining a location feature corresponding to the location entity according to the location entity, the sentence in the target text and the object relationship; and determining a traffic event corresponding to the target text according to the location feature. The accuracy of the electronic equipment in determining the traffic event is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of traffic information technology, and in particular to a method, apparatus and electronic device for determining traffic events. Background Technology

[0002] Road notices typically include traffic events such as road closures, road construction, and road control. Electronic map platforms can extract traffic events from road notices and update the electronic map data.

[0003] The relevant technology server can identify traffic event trigger words in road notices and determine the traffic events in the road notices based on these trigger words. However, some road notices do not include traffic event trigger words, making it impossible for the server to extract relevant traffic events from the road notices. This results in low accuracy in determining traffic events and causes valuable information to be incorrectly filtered out. Summary of the Invention

[0004] This application provides a method, apparatus, and electronic device for determining traffic incidents, which addresses the technical problem of low accuracy in determining traffic incidents in the prior art.

[0005] In a first aspect, this application provides a method for determining a traffic incident, the method comprising:

[0006] Obtain target text related to traffic incident information;

[0007] Multiple objects are identified in the target text, including location entities and sentences in the target text;

[0008] Determine the object relationships between the plurality of objects;

[0009] Based on the location entity, the sentence in the target text, and the object relationship, determine the location feature corresponding to the location entity;

[0010] Based on the location features, the traffic event corresponding to the target text is determined.

[0011] In one possible implementation, determining the location features corresponding to the location entity based on the location entity, the sentence in the target text, and the object relationship includes:

[0012] The location entities and sentences in the target text are processed according to the pre-trained language model to obtain the initial feature vector of each location entity and the initial feature vector of each sentence in the target text;

[0013] Based on the initial feature vector of each location entity, the initial feature vector of each sentence, and the object relationship, the location features corresponding to the location entity are determined.

[0014] In one possible implementation, determining the location features corresponding to each location entity based on the initial feature vector of each location entity, the initial feature vector of each sentence, and the object relationship includes:

[0015] An initial heterogeneous graph is determined based on the initial feature vector of each location entity, the initial feature vector of each sentence, and the object relationship. The initial heterogeneous graph includes location nodes corresponding to each location entity, sentence nodes corresponding to each sentence, and edges between nodes. The vector corresponding to each location node is represented as the initial feature vector of the location entity of the location node, and the vector corresponding to each sentence node is represented as the initial feature vector of the sentence of the sentence node.

[0016] The initial heterogeneous graph is processed using a multi-layer graph convolutional network to obtain the target heterogeneous graph;

[0017] The feature vector corresponding to the location node in the target heterogeneous graph is determined as the location feature of the location entity corresponding to the location node.

[0018] In one possible implementation, determining an initial heterogeneous graph based on the initial feature vector of each of the location entities, the initial feature vector of each of the sentences, and the object relationships includes:

[0019] Based on the initial feature vector of each location entity and the initial feature vector of each sentence, determine the location nodes and sentence nodes in the initial heterogeneous graph;

[0020] Based on the object relationships, determine the edges between the position nodes, the edges between the sentence nodes, and the edges between the position nodes and the sentence nodes;

[0021] The initial heterogeneous graph is obtained based on the position node, the sentence node, the edge between the position node, the edge between the sentence node, and the edge between the position node and the sentence node.

[0022] In one possible implementation, multiple objects are identified in the target text, including:

[0023] The target text is segmented to obtain the sentences within the target text;

[0024] The target text is subjected to location named entity recognition processing to obtain at least one location entity in the target text.

[0025] In one possible implementation, determining the object relationships between the plurality of objects includes:

[0026] Determine the positional relationships between multiple location entities, the sentence relationships between multiple sentences, and the membership relationships between the location entities and sentences;

[0027] The positional relationship, the sentence relationship, and the belonging relationship are determined as the object relationship.

[0028] In one possible implementation, determining the positional relationships between multiple location entities includes:

[0029] Obtain a geographic location relationship database, wherein the geographic location relationship database includes the location relationships between geographic locations associated with multiple location entities;

[0030] Determine a list of location entities, which includes location entities in the target text, and the location entities in the list are arranged in the order in which they appear in the target text.

[0031] The location relationships are determined based on the geographic location relationship database and the location entity list.

[0032] Secondly, this application provides a device for determining a traffic event, which includes an acquisition module, a first determining module, a second determining module, a third determining module, and a fourth determining module, wherein:

[0033] The acquisition module is used to acquire target text related to traffic incident information;

[0034] The first determining module is used to determine multiple objects in the target text, the objects including location entities and sentences in the target text;

[0035] The second determining module is used to determine the object relationships between the plurality of objects;

[0036] The third determining module is used to determine the location features corresponding to the location entity based on the location entity, the sentence in the target text, and the object relationship;

[0037] The fourth determining module is used to determine the traffic event corresponding to the target text based on the location features.

[0038] In one possible implementation, the third determining module is specifically used for:

[0039] The location entities and sentences in the target text are processed according to the pre-trained language model to obtain the initial feature vector of each location entity and the initial feature vector of each sentence in the target text;

[0040] Based on the initial feature vector of each location entity, the initial feature vector of each sentence, and the object relationship, the location features corresponding to the location entity are determined.

[0041] In one possible implementation, the third determining module is specifically used for:

[0042] An initial heterogeneous graph is determined based on the initial feature vector of each location entity, the initial feature vector of each sentence, and the object relationship. The initial heterogeneous graph includes location nodes corresponding to each location entity, sentence nodes corresponding to each sentence, and edges between nodes. The vector corresponding to each location node is represented as the initial feature vector of the location entity of the location node, and the vector corresponding to each sentence node is represented as the initial feature vector of the sentence of the sentence node.

[0043] The initial heterogeneous graph is processed using a multi-layer graph convolutional network to obtain the target heterogeneous graph;

[0044] The feature vector corresponding to the location node in the target heterogeneous graph is determined as the location feature of the location entity corresponding to the location node.

[0045] In one possible implementation, the third determining module is specifically used for:

[0046] Based on the initial feature vector of each location entity and the initial feature vector of each sentence, determine the location nodes and sentence nodes in the initial heterogeneous graph;

[0047] Based on the object relationships, determine the edges between the position nodes, the edges between the sentence nodes, and the edges between the position nodes and the sentence nodes;

[0048] The initial heterogeneous graph is obtained based on the position node, the sentence node, the edge between the position node, the edge between the sentence node, and the edge between the position node and the sentence node.

[0049] In one possible implementation, the first determining module is specifically used for:

[0050] The target text is segmented to obtain the sentences within the target text;

[0051] The target text is subjected to location named entity recognition processing to obtain at least one location entity in the target text.

[0052] In one possible implementation, the second determining module is specifically used for:

[0053] Determine the positional relationships between multiple location entities, the sentence relationships between multiple sentences, and the membership relationships between the location entities and sentences;

[0054] The positional relationship, the sentence relationship, and the belonging relationship are determined as the object relationship.

[0055] In one possible implementation, the second determining module is specifically used for:

[0056] Obtain a geographic location relationship database, wherein the geographic location relationship database includes the location relationships between geographic locations associated with multiple location entities;

[0057] Determine a list of location entities, which includes location entities in the target text, and the location entities in the list are arranged in the order in which they appear in the target text.

[0058] The location relationships are determined based on the geographic location relationship database and the location entity list.

[0059] Thirdly, this application provides a method for updating a map, including:

[0060] The traffic event determination method described in the first aspect is used to assign traffic events corresponding to target texts to operators;

[0061] The map update data obtained by the operator after processing the traffic event corresponding to the target text is acquired, and the map is updated using the map update data.

[0062] Fourthly, this application provides an electronic device, including: a processor and a memory;

[0063] The memory stores computer-executed instructions;

[0064] The processor executes computer execution instructions stored in the memory, causing the processor to perform, as in the first aspect, and the method for determining various possible traffic events involved in the first aspect.

[0065] Fifthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, include the first aspect and a method for determining various possible traffic events involved in the first aspect.

[0066] This application provides a method, apparatus, and electronic device for determining traffic events. The electronic device can acquire target text related to traffic event information and identify multiple objects within the target text. These multiple objects include location entities and sentences within the target text. The electronic device can determine the object relationships between the multiple objects and, based on the location entities, sentences in the target text, and object relationships, determine the location features corresponding to the location entities. Based on the location features, it determines the traffic event corresponding to the target text. In this method, because the electronic device can determine the traffic event in the target text based on the location features corresponding to the location entities, it can determine the traffic event even if the target text does not contain traffic event trigger words. Furthermore, since the location features integrate multiple objects and relationships within the target text, the electronic device can accurately determine the traffic event in the target text based on the location features, thereby improving the accuracy of traffic event determination. Attached Figure Description

[0067] Figure 1 A schematic diagram illustrating a prior art process for determining a traffic event, provided as an embodiment of this application;

[0068] Figure 2 This is a schematic diagram of an application scenario provided by an embodiment of this application;

[0069] Figure 3 A flowchart illustrating a method for determining a traffic incident provided in an embodiment of this application;

[0070] Figure 4 This application provides a schematic diagram illustrating a process for determining a location entity in an embodiment of the present application.

[0071] Figure 5 This application provides a schematic diagram of a process for determining a sentence.

[0072] Figure 6 A schematic diagram of a location entity list provided in an embodiment of this application;

[0073] Figure 7 This is a schematic diagram illustrating a process for determining positional relationships, provided in an embodiment of this application.

[0074] Figure 8 A schematic diagram of an initial heterogeneous diagram provided for an embodiment of this application;

[0075] Figure 9 A schematic diagram illustrating the process of a method for determining a traffic event provided in an embodiment of this application;

[0076] Figure 10 A schematic diagram illustrating a training method for a traffic event prediction model provided in an embodiment of this application;

[0077] Figure 11 A schematic diagram illustrating the training process of a traffic event prediction model provided in an embodiment of this application;

[0078] Figure 12 A schematic diagram of the structure of a traffic event determination device provided in an embodiment of this application;

[0079] Figure 13 A schematic diagram of the hardware structure of the electronic device provided in this application. Detailed Implementation

[0080] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0081] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0082] The user information (including but not limited to user device information such as location information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data shall comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation portals shall be provided for users to choose to authorize or refuse.

[0083] For ease of understanding, some concepts involved in the embodiments of this application will be explained below.

[0084] Traffic incident: A traffic incident can be a type of traffic incident described in the target text. For example, the traffic incident described in the target text may include road closure incidents, road construction incidents, and traffic control incidents. The target text may include one type of traffic incident, or it may include multiple types of traffic incidents; this application embodiment does not limit this. It should be noted that the traffic incidents shown in the embodiments of this application are macroscopic traffic incidents; for example, a traffic incident may be a road closure incident, a road construction incident, etc.

[0085] Location entities: Location entities can be location-related text within the target text. For example, location entities can be words or phrases describing locations within the target text. For instance, entities such as jurisdiction names, road names, section names, road segment names, toll station road segment names, toll station names, point-of-interest names (e.g., gas stations), and mileage marker names in the target text can all be location entities; this application does not limit this. For example, if the target text is: "Section 1 of Highway A is closed," then the location entities in the target text can include the name of Highway A and the name of section 1.

[0086] In related technologies, when a traffic incident has occurred or is about to occur on a road, the relevant platform can issue a road notice. This notice can describe the traffic incident that has already occurred or the upcoming incident. For example, a road notice could state: "Section 1 of Highway A has been closed due to a traffic accident," or "Section 1 of Highway A will be closed for construction starting from the construction date." The electronic map platform can extract the traffic incident from the road notice and then update the electronic map data accordingly.

[0087] Currently, the server can identify traffic event trigger words in road notices and determine the traffic events in the road notices based on these trigger words. For example, if a road notice includes the traffic event trigger word "closed," the server can determine that the traffic event in the road notice is a road closure event; if a road notice includes the traffic event trigger words "closed and construction," the server can determine that the traffic event in the road notice is both a road closure event and a road construction event.

[0088] Below, in conjunction with Figure 1 This paper describes the existing methods for determining traffic events using servers.

[0089] Figure 1 This is a schematic diagram illustrating a prior art process for determining a traffic event, provided as an embodiment of this application. Please refer to [link / reference]. Figure 1This includes: trigger words for road closure events, trigger words for road construction events, road announcements, and servers. Trigger words for road closure events include: closed, shut down, and restricted access; trigger words for road construction events include: construction, commencement, and commencement of work; the road announcement states: "Due to construction at toll station A on G1 Expressway, exits 1 and 2 of toll station A are closed."

[0090] Please see Figure 1 The server can recognize the text in road notices and determine that the traffic event trigger words in the road notices include "construction" and "closure". Since "construction" is the trigger word for road construction events and "closure" is the trigger word for road closure events, the server can determine that the road notices include road construction events and road closure events, and thus can quickly identify traffic events on the road.

[0091] However, defining and identifying traffic event trigger words is quite difficult. Some road notices do not include traffic event trigger words, and even some trigger words in road notices cannot uniquely identify traffic events. This makes it impossible for the server to extract relevant traffic events from road notices. For example, Figure 1 In the illustrated embodiment, if the road notice states that exits 1 and 2 of toll station A on the G1 expressway are closed due to construction, the server cannot identify the trigger word for the road closure event in the road notice. Therefore, the server can only determine that the road notice includes a road construction event, but not a road closure event. This results in low accuracy in the server's determination of traffic events.

[0092] This application provides a method, apparatus, and electronic device for determining traffic events. The electronic device can acquire target text related to traffic event information and identify multiple objects in the target text. These multiple objects include location entities and sentences in the target text. The electronic device can determine the object relationships between the multiple objects and generate an initial heterogeneous graph based on the location entities, sentences in the target text, and object relationships. The initial heterogeneous graph includes location nodes, sentence nodes, edges of each node, and a vector representation of each location node as the initial feature vector of the location entity. The vector representation of each sentence node is also represented as the initial feature vector of the sentence. The electronic device can perform convolution processing on the initial heterogeneous graph using a multi-layer graph convolutional network to obtain a target heterogeneous graph. The vector representations corresponding to the location nodes in the target heterogeneous graph are determined as the location features of the location entities corresponding to the location nodes. Based on the location features, the traffic event corresponding to the target text is determined. In the above method, since the electronic device can determine the traffic event in the target text based on the location features corresponding to the location entities in the target text, the electronic device can determine the traffic event in the target text even if the target text does not contain traffic event trigger words. Furthermore, since the multi-layer graph convolutional network can fuse the feature vectors of the location nodes in the target heterogeneous graph with the information of the adjacent nodes, the accuracy of the location features of the location entities corresponding to the location nodes is improved. Therefore, the electronic device can accurately determine the traffic event in the target text based on the location features, thereby improving the accuracy of determining the traffic event.

[0093] Below, in conjunction with Figure 2 The application scenarios of the embodiments of this application will be described.

[0094] Figure 2 This is a schematic diagram illustrating an application scenario provided by an embodiment of this application. Please refer to... Figure 2 This includes road notices and a traffic incident detection model. The road notice states: "Due to construction at toll station A on the G1 Expressway, toll station B on the G1 Expressway is closed." The traffic incident detection model is then fed the road notice. It identifies the location features corresponding to toll station A and toll station B in the notice, predicts a road construction event based on the location features of toll station A, and a road closure event based on the location features of toll station B. Therefore, the model outputs traffic incidents a and b, where traffic incident a is a new road construction event at toll station A, and traffic incident b is a new road closure event at toll station B. Because traffic incidents are associated with geographical location, electronic devices can accurately predict traffic incidents occurring at a location based on the location features corresponding to that location entity, without needing to rely on traffic incident trigger words, thus improving the accuracy of traffic incident detection.

[0095] It should be noted that, Figure 2 The examples provided are merely illustrations of application scenarios for the embodiments of this application and are not intended to limit the application scenarios of the embodiments of this application.

[0096] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.

[0097] Figure 3 This is a flowchart illustrating a method for determining a traffic event, as provided in an embodiment of this application. Please refer to [link / reference]. Figure 3 The method may include:

[0098] S301. Obtain target text related to traffic incident information.

[0099] The execution subject of this application embodiment can be an electronic device or a traffic event determination device installed in an electronic device. The traffic event determination device can be implemented based on software, or it can be implemented based on a combination of software and hardware; this application embodiment does not limit this. For example, the electronic device can be any device with on-device computing capabilities, such as a computer or a mobile phone; this application embodiment does not limit this either.

[0100] Optionally, the target text may be related to traffic incident information. For example, traffic incident information may include information related to road construction incidents, road closure incidents, and road restriction incidents. The target text may be a notice of road construction, a notice of road closure, or a notice of road restriction, etc. The target text may also be other texts related to traffic incident information, and this application embodiment does not limit this.

[0101] Optionally, the electronic device can acquire multiple target texts from the network. For example, the electronic device can acquire texts related to traffic incident information, such as public transportation news announcements, road control announcements, road construction announcements, and road accident announcements, and identify these texts as target texts. Alternatively, the electronic device can acquire multiple texts related to traffic incident information posted by users on an internet platform and identify those texts as target texts.

[0102] Optionally, the electronic device can retrieve multiple target texts from the database. For example, the database can pre-store multiple target texts related to traffic incident information, and the electronic device can retrieve these target texts when updating electronic map data.

[0103] Optionally, the electronic device can receive target text sent by other devices. For example, when a user uses mobile phone navigation, if the user discovers a road closure, road construction, or traffic accident on the navigation route, and the navigation application does not display these traffic events on that route, the user can send the traffic event information to the electronic device via their mobile phone, allowing the electronic device to obtain target text related to the traffic event. For example, if the user sends the text "A traffic accident has occurred in the left lane of road segment A, and the left lane is now closed to traffic" to the electronic device, the electronic device can identify this text as the target text.

[0104] Optionally, the electronic device can also determine the target text based on multiple acquired navigation data. For example, if the electronic device determines, based on navigation data, that the traffic flow on road segment A rapidly decreases to 0 within a preset time period, the target text determined by the electronic device may include the text "Vehicles suddenly cannot pass through road segment A"; if the electronic device determines, based on navigation data, that a large number of vehicles are making U-turns on road segment B, the target text may include the text "A large number of vehicles are making U-turns at the location of road segment B"; if the electronic device determines, based on navigation data, that there are no vehicles passing through road segment C, the target text may include the text "No vehicles are passing through road segment C".

[0105] It should be noted that electronic devices can also acquire target text related to traffic incident information in any other feasible way, and this application embodiment does not limit this.

[0106] S302. Identify multiple objects in the target text.

[0107] Specifically, the objects include location entities and sentences in the target text. Location entities can be the specific geographical location where the traffic incident occurred, and sentences in the target text can include the text between two adjacent punctuation marks. For example, if the target text is: "A traffic accident occurred on road segment A, and the left lane of road segment A is closed to traffic," then the location entities in the target text can be road segment A and the left lane, and the sentences in the target text can be "A traffic accident occurred on road segment A" and "The left lane of road segment A is closed to traffic."

[0108] The electronic device can determine multiple objects in the target text according to the following feasible implementation methods: performing sentence segmentation on the target text to obtain sentences in the target text, and performing location named entity recognition processing on the target text to obtain at least one location entity in the target text.

[0109] In this application, electronic devices can use a named entity recognition model to perform location named entity recognition processing on target text to obtain location entities within the target text. The named entity recognition model can be a combination of a Bidirectional Encoder Representations from Transformers (BERT) model and a Conditional Random Field (CRF) model. By combining BERT and CRF, the BERT+CRF model can be trained using sequence labeling. After the named entity recognition model converges, it can identify location entities in the target text. It should be noted that the training process of the BERT+CRF combination model is similar to existing technologies, and will not be described in detail here.

[0110] Optionally, the electronic device can identify punctuation marks in the target text and determine the positions of the punctuation marks as text cutting points. It then segments the target text according to these cutting points, thereby breaking it down into sentences. For example, if the target text contains one punctuation mark, the electronic device can determine that it contains one sentence; if the target text contains three punctuation marks, the electronic device can segment the target text into three sentences.

[0111] It should be noted that the target text in this application embodiment may include one location entity or multiple location entities, and the target text may include one sentence or multiple sentences. This application embodiment does not limit this.

[0112] Below, in conjunction with Figure 4 This section explains the process of determining the location entities in the target text.

[0113] Figure 4 This is a schematic diagram illustrating a process for determining the location of an entity, as provided in an embodiment of this application. Please refer to [link / reference]. Figure 4 This includes: road notices and named entity recognition models. The road notice states: Due to construction at toll station A on the G1 expressway, toll station B is closed. Electronic equipment ( Figure 4 (Not shown in the image) The road notice can be input into the Named Entity Recognition Model, which can output the location entities in the road notice, including G1 Expressway, Toll Station A, and Toll Station B.

[0114] Below, in conjunction with Figure 5 The process of identifying sentences in the target text is explained.

[0115] Figure 5This is a schematic diagram illustrating a process for determining a sentence, as provided in an embodiment of this application. Please refer to... Figure 5 This includes: road notices. The road notice states: Due to construction at toll station A on the G1 expressway, exit 1 of toll station A is closed. Electronic equipment ( Figure 5 (Not shown in the image) can identify the location of punctuation marks in road notices and cut them at the locations of the punctuation marks. Since the road notice includes 3 punctuation marks, it can include 3 sentences. Sentence a is "Due to construction at toll station A on G1 Expressway", sentence b is "Therefore", and sentence c is "Exit 1 of toll station A is closed".

[0116] S303. Determine the object relationships between multiple objects.

[0117] Specifically, electronic devices can determine the object relationships between multiple objects according to the following feasible implementation methods: determine the positional relationships between multiple location entities, the sentence relationships between multiple sentences, and the ownership relationships between location entities and sentences, and determine the positional relationships, sentence relationships, and ownership relationships as object relationships.

[0118] The location relationship can be a hierarchical relationship between location entities. This hierarchical relationship can include location inclusion and location parallel relationships. For example, a location inclusion relationship means that location A belongs to location B. For instance, if the target text is: "A traffic accident occurred on section A of G1 Expressway," then the location entities in this target text are G1 Expressway and section A. Since section A belongs to G1 Expressway, the hierarchical relationship between the two location entities in the target text is a location inclusion relationship, meaning G1 Expressway includes section A. Similarly, if the target text is: "A traffic accident occurred in the overtaking lane, and construction is underway in the driving lane," then the location entities in this target text are the overtaking lane and the driving lane. Since the overtaking lane and the driving lane are parallel geographical locations, the hierarchical relationship between the two location entities in the target text is a location parallel relationship.

[0119] Sentence relationships can indicate the connections between multiple sentences. For example, in practical applications, multiple sentences in the same target text are related. Therefore, any two sentences in the same target text have a sentence relationship, with a stronger connection between adjacent sentences and a weaker connection between non-adjacent sentences.

[0120] The membership relation indicates the sentence in which the location entity is located. For example, if the target text includes sentences 1 and 2, and if location entity A is located in sentence 1, and location entities B and C are located in sentence 2, then the first membership relation between the location entity and the sentence is: location entity A belongs to sentence 1; the second membership relation is: location entity B belongs to sentence 2; and the third membership relation is: location entity C belongs to sentence 2.

[0121] Electronic devices can determine the positional relationships between multiple location entities by the following feasible implementation: obtaining a geographic location relationship database, determining a list of location entities, and determining the positional relationships between multiple location entities based on the geographic location relationship database and the list of location entities.

[0122] The geographic location relationship database can include the location relationships between multiple location entities associated with each other. For example, the database can include an external geographic knowledge base and heuristic rules. The external geographic knowledge base is a queryable database, allowing the electronic device to obtain the location relationships between any two location entities. The heuristic rules can be pre-defined location relationships between location entities associated with each other. For instance, if the electronic device inputs the location entities "G1 Expressway" and "Road segment from city a to city b" into the geographic location relationship database, the database can output: "G1 Expressway includes the road segment from city a to city b." For example, the heuristic rule can include the road segment name within the expressway name; the road segment name can include toll station names, service area names, etc. For example, if the target text is: "The road segment from city a to city b in G1 Expressway is closed," the electronic device can determine that the first location entity in the target text is "G1 Expressway," and the second location entity is the road segment from city a to city b. If the electronic device determines that the heuristic rule can include the road segment name within the expressway name, then based on this heuristic rule, the electronic device can determine the location relationship between the two location entities as: "G1 Expressway includes the road segment from city a to city b."

[0123] It should be noted that the above heuristic rules are merely illustrative examples. This application embodiment does not limit the pre-set heuristic rules, and the electronic device of this application can also determine the positional relationship between the geographical locations associated with any two location entities based on other feasible implementation methods. This application embodiment does not limit this.

[0124] The location entity list can include location entities in the target text. For example, the location entity list can include all location entities in the target text. Optionally, the location entities in the location entity list are arranged in the order in which they appear in the target text. For example, an electronic device can obtain all location entities in the target text and the position of each location entity in the target text, and then determine the order in which all location entities appear in the target text based on the position of each location entity, thereby obtaining the location entity list.

[0125] Below, in conjunction with Figure 6 The list of location entities is described.

[0126] Figure 6 This is a schematic diagram of a location entity list provided in an embodiment of this application. Please refer to [link / reference]. Figure 6 This includes: a road notice. The road notice states: Due to construction at toll station A on the G1 Expressway, toll station B is closed. The location entities in this road notice include: G1 Expressway, toll station A, and toll station B. Furthermore, the order in which these three location entities appear in the target text is: G1 Expressway, toll station A, and toll station B. Therefore, the location entity list corresponding to this road notice includes G1 Expressway, toll station A, and toll station B, and the three location entities in the location entity list are arranged according to their order of appearance in the target text.

[0127] The electronic device determines the location relationship based on the geographic location relationship database and the location entity list. Specifically, for the i-th location entity in the location entity list, the location hierarchy relationship between the i-th location entity and the (i-1)-th location entity is determined based on the geographic location relationship database, until i is N, thus obtaining the location relationship. Here, i takes the values ​​2, 3, ..., N in sequence, and N is the number of location entities in the location entity list.

[0128] For example, if the location entity list contains three location entities, the electronic device can input the second and first location entities from the location entity list into the geographic location database. The geographic location database can output the location hierarchy relationship between the first and second location entities. If the first location entity includes the second location entity, the electronic device can input the second and third location entities from the location entity list into the geographic location database. If the second location entity includes the third location entity, the electronic device can obtain the location relationship between the three location entities: the first location entity includes the second location entity, and the second location entity includes the third location entity. If the second location entity does not include the third location entity, the electronic device... The device can input a first location entity (the parent entity of the second location entity) and a third location entity into the geolocation database. If the first location entity includes the third location entity, the electronic device can determine that the second and third location entities are in a parallel position. The electronic device can obtain the positional relationship between the three location entities, that is, the first location entity includes the second and third location entities. If the first location entity does not include the third location entity, the electronic device can determine that there is no positional hierarchy relationship between the third location entity and the first and second location entities. The electronic device can determine that the positional relationship is that the first location entity includes the second location entity, and the third location entity is an independent location entity.

[0129] Optionally, the electronic device can obtain location relationships based on a dictionary, a list of location entities, and a geographic location relationship database. For example, an electronic device can construct an empty dictionary where the keys are location entities and the values ​​are empty lists. The electronic device can pop the first location entity from the location entity list as the starting location entity and assign it to the list of keys in the dictionary. It then checks whether the starting location entity contains the second location entity (the location entity at the top of the current location entity list). If it does, it pops the second location entity from the location entity list and assigns it to the list of keys corresponding to the second location entity, recording the parent entity of the second location entity as the first location entity. If it does not contain the parent entity, it checks whether the second location entity is contained by the parent entity of the first location entity (this is just an illustrative example; in actual applications, the first location entity does not have a parent entity). If it does, it pops the second location entity and assigns it to the list of keys corresponding to the second location entity. If it does not contain the parent entity, it pops the value of the dictionary as a completed geographic location relationship tree. The above steps are repeated until the location entity list is empty.

[0130] The process of determining positional relationships will be explained below with reference to the diagram.

[0131] Figure 7 This is a schematic diagram illustrating a process for determining positional relationships, provided as an embodiment of this application. Please refer to... Figure 7 This includes a list of location entities and a dictionary. The list of location entities includes G1 Expressway, Road Segment A, Toll Station 1, and Toll Station 2. The dictionary includes key-value pairs such as road name-empty, road segment-empty, mileage marker-empty, and toll station-empty. It should be noted that the key-value pairs in the dictionary can also be other types of key-value pairs; this embodiment does not limit this.

[0132] Please see Figure 7 Electronic devices Figure 7 (Not shown) can pop G1 Expressway (the first location entity in the location entity list). If G1 Expressway is not included in the location entity list, the road name-empty in the dictionary is updated to road name-G1 Expressway. The electronic device can pop road segment A from the location entity list. Since G1 Expressway includes road segment A, the electronic device can add road segment A to the value of the dictionary, that is, road segment-empty is updated to road segment-road segment A.

[0133] Please see Figure 7 The electronic device can display tollbooth 1. Since road segment A contains tollbooth 1, the electronic device can add tollbooth 1 to the dictionary value; that is, tollbooth-empty is updated to tollbooth-tollbooth1. The electronic device can display tollbooth 2. Since tollbooth 1 does not contain tollbooth 2, but road segment A (the parent entity of tollbooth 1) contains tollbooth 2, the electronic device can add tollbooth 2 to the dictionary value; that is, tollbooth-tollbooth1 is updated to tollbooth-tollbooth1-tollbooth2.

[0134] Please see Figure 7 The electronic device can obtain a geographic location relationship tree based on a dictionary. This tree includes nodes for G1 Expressway, road segment A, toll station 1, and toll station 2. Nodes for G1 Expressway are connected to nodes for road segment A, and these nodes point to nodes for road segment A. Nodes for road segment A are also connected to nodes for toll station 1 and toll station 2, and these nodes point to nodes for both toll station 1 and toll station 2. Nodes for toll station 1 and toll station 2 are not connected.

[0135] It should be noted that if the location entity list includes only one location entity, the electronic device does not need to determine the location relationship. In practical applications, the electronic device can obtain one or more geographic location relationship trees based on multiple location entities in the target text. This application embodiment does not limit this.

[0136] It should be noted that the electronic device in this application embodiment can also determine the relationship between location entities according to any other feasible implementation method. For example, it can obtain any two location entities in the target text and determine the location relationship between the two location entities according to the geographic location relationship database. This application embodiment does not limit this.

[0137] Optionally, the electronic device can determine the sentence relationships between sentences based on the adjacency relationships between sentences in the target text. Optionally, the electronic device can determine the position of a location entity in the target text, and then determine the relationship between the location entity and the sentence based on that position.

[0138] It should be noted that, according to any other feasible implementation, the sentence relationships between multiple sentences in the target text and the belonging relationship between location entities and sentences can also be determined, and the embodiments of this application do not limit this.

[0139] S304. Determine the location features corresponding to the location entity based on the location entity, sentences in the target text, and object relationships.

[0140] Specifically, electronic devices can determine the location features corresponding to location entities according to the following feasible implementation: Processing the location entities and sentences in the target text using a pre-trained language model to obtain the initial feature vector of each location entity and the initial feature vector of each sentence in the target text; determining the location features corresponding to the location entity based on the initial feature vector of each location entity, the initial feature vector of each sentence, and the object relationship. For example, in the transportation field, there is a hierarchical relationship between the geographical locations associated with location entities, and traffic events occurring at these geographical locations depend on this hierarchical relationship. For example, when severe weather occurs on the G1 expressway, downstream toll stations 1 and 2 will implement traffic control measures. Therefore, this application can model the hierarchical relationship between geographical locations based on Graph Convolutional Networks (GCN) to obtain the location features corresponding to each location entity.

[0141] Specifically, the electronic device can obtain the initial feature vectors corresponding to each sentence and each location entity in the target text based on a pre-trained language model. For example, the input of the electronic device is a sentence with L tokens (a combination of the word embedding of a token and its location encoding). The language model processes this sentence to obtain the initial feature vectors of the sentence and the location entities. Optionally, after obtaining the initial feature vectors of the sentence and the location entities, the electronic device can also perform fixed-length processing (e.g., max-pooling) on ​​these vectors to obtain fixed-length initial feature vectors, facilitating feature vector concatenation.

[0142] The electronic device determines the location features corresponding to each location entity based on the initial feature vector of each location entity, the initial feature vector of each sentence, and the object relationship. Specifically, it can be done by: determining an initial heterogeneous graph based on the initial feature vector of each location entity, the initial feature vector of each sentence, and the object relationship; processing the initial heterogeneous graph using a multi-layer graph convolutional network to obtain a target heterogeneous graph; and determining the feature vectors corresponding to the location nodes in the target heterogeneous graph as the location features of the location entities corresponding to the location nodes.

[0143] The initial heterogeneous graph includes location nodes corresponding to each location entity, sentence nodes corresponding to each sentence, and edges between nodes. The vector representation of each location node is the initial feature vector of the location entity associated with that node, and the vector representation of each sentence node is the initial feature vector of the sentence associated with that node. For example, the initial heterogeneous graph may include multiple location nodes and multiple sentence nodes. Since the input to a neural network is typically matrix, grid, or similar data, the vector representation of each node in the initial heterogeneous graph can be the initial feature vector associated with the location entity or sentence corresponding to that node. For instance, if the initial heterogeneous graph includes location nodes A and B, where location node A corresponds to location entity 1 and location node B corresponds to location entity 2, then the vector representation of location node A can be the initial feature vector of location entity 1, and the vector representation of location node B can be the initial feature vector of location entity 2.

[0144] Optionally, the electronic device may determine the initial heterogeneous graph based on the following feasible implementation: determining the position nodes and sentence nodes in the initial heterogeneous graph according to the initial feature vector of each position entity and the initial feature vector of each sentence; determining the edges between position nodes, between sentence nodes, and between position nodes according to object relationships; and obtaining the initial heterogeneous graph based on the position nodes, sentence nodes, edges between position nodes, edges between sentence nodes, and edges between position nodes.

[0145] The edges between location nodes can include containment edges and parallel edges. For example, when two location entities in the target text have a containment relationship, their location nodes are connected by a containment edge; when two location entities in the target text have the same parent entity, their location nodes are connected by a parallel edge.

[0146] In this context, edges connect all sentence nodes. For example, because sentences in the target text are related, all sentence nodes in the target text are connected via edges to enable global semantic interaction between sentences. For instance, the sentence nodes corresponding to any two sentences in the target text can be connected via edges.

[0147] The edges between location nodes and sentence nodes indicate the relationship between location entities and sentences. For example, the location node corresponding to a location entity in the target text can include the edge between the location node and the sentence node, so that the location features of the location entity can obtain the local semantics of the sentence in which it is located. For example, if the location entity is located in a sentence, the location node corresponding to the location entity is connected to the sentence node corresponding to the sentence based on the edge between the location node and the sentence node.

[0148] For example, if the target text includes two location entities and two sentences, the electronic device can determine that the initial heterogeneous graph includes two location nodes and two sentence nodes. The vector representation corresponding to each location node can be the initial feature vector of the location entity related to the location node, and the vector representation corresponding to each sentence node can be the initial feature vector of the sentence related to the sentence node. After the electronic device determines the location nodes and sentence nodes, it can determine the edges between the two location nodes, the edges between the two sentence nodes, and the edges between the two location nodes and the two sentence nodes based on object relationships, thereby obtaining the initial heterogeneous graph.

[0149] It should be noted that the initial heterogeneous graph mentioned above may include four types of edges (two types of edges between position nodes, one type of edge between position nodes and sentence nodes, and one type of edge between sentence nodes). Therefore, the vector representation corresponding to each type of edge can be a preset feature vector or a feature vector determined by any feasible implementation method. This application embodiment does not limit this.

[0150] Below, in conjunction with Figure 8 The initial heterogeneity diagram is explained.

[0151] Figure 8This is a schematic diagram of an initial heterogeneous diagram provided for an embodiment of this application. Please refer to... Figure 8 This includes: the initial heterogeneous graph.

[0152] The initial heterogeneous graph includes location node 1 associated with location entity A, location node 2 associated with location entity B, location node 3 associated with location entity C, sentence node 4 associated with sentence a, sentence node 5 associated with sentence b, and sentence node 6 associated with sentence c. Sentence nodes 4, 5, and 6 are connected by edges between sentence nodes. Location node 1 is connected to location nodes 2 and 3 by containment edges. Location nodes 2 and 3 are also connected by parallel edges. Location node 1 is also connected to sentence node 4 by an edge between a location node and a sentence node. Location nodes 3 and 2 are connected to sentence node 5 by an edge between a location node and a sentence node.

[0153] Please see Figure 8 Each node in the initial heterogeneous graph has a corresponding vector representation. Specifically, the vector representation of position node 1 is the initial feature vector of position entity A, the vector representation of position node 2 is the initial feature vector of position entity B, the vector representation of position node 3 is the initial feature vector of position entity C, the vector representation of sentence node 4 is the initial feature vector of sentence a, the vector representation of sentence node 5 is the initial feature vector of sentence b, and the vector representation of sentence node 6 is the initial feature vector of sentence c.

[0154] Specifically, each node in the initial heterogeneous graph obtained by the electronic device includes a corresponding vector representation, and the connection relationships between each node also include corresponding vector representations. Therefore, the electronic device can perform convolution processing on the initial heterogeneous graph using a multi-layer graph convolutional network to obtain the target heterogeneous graph. The number of nodes in the target heterogeneous graph is the same as the number of nodes in the initial heterogeneous graph. The electronic device can determine the feature vectors corresponding to the location nodes in the target heterogeneous graph as the location features of the location entities corresponding to those location nodes. For example, the target heterogeneous graph includes location nodes A and B, where location node A is associated with location entity 1 and location node B is associated with location entity 2. Therefore, the location feature of location entity 1 can be the vector representation corresponding to location node A in the target heterogeneous graph, and the location feature of location entity 2 can be the vector representation corresponding to location node B in the target heterogeneous graph. Since the vector representations corresponding to location nodes A and B can fuse information from adjacent nodes during graph convolution, the accuracy of the vector representations is high, thereby improving the accuracy of the location features of the location entities.

[0155] S305. Based on location features, determine the traffic event corresponding to the target text.

[0156] Optionally, the electronic device can process location features using a classifier to obtain traffic events occurring at location entities related to those features. The classifier can classify various traffic event categories. For example, the classifier can identify 10 types of traffic events. When processing location features, the classifier can output the correlation between the location features and each type of traffic event. The electronic device can then determine the traffic events occurring at location entities related to the location features based on the correlation. For instance, the classifier can classify road closure events and road construction events. If, after processing the location features corresponding to a location entity, the classifier obtains a correlation of 150 between the location feature and a road closure event, and a correlation of 5 between the location feature and a road construction event, then the electronic device can determine that a road closure event occurred at that location entity in the target text.

[0157] Optionally, after obtaining the correlation between the location features output by the classifier and each type of traffic event, the electronic device can normalize multiple correlations. For example, a softmax layer can be connected after the classifier. The softmax layer can output multiple probabilities, which are summed to 1. For instance, after processing the location features, the softmax layer outputs (0.9, 0.1, 0). If the first probability corresponds to a road closure event, the second probability corresponds to a road construction event, and the third probability corresponds to a road vehicle restriction event, then the traffic event occurring at the location entity related to this location feature is a road closure event.

[0158] It should be noted that the classifier can also classify traffic events without traffic event types, and this application embodiment does not limit this. For example, if no traffic event has occurred at a location entity, the location feature corresponding to the location entity, after being processed by the classifier, will have the highest correlation with the no-traffic-event type.

[0159] Optionally, after acquiring location features related to multiple location entities in the target text, the electronic device can determine a target location feature from these features and, based on the target location feature, determine the traffic event in the target text. The target location feature can be the location feature corresponding to the smallest granularity location entity in the target text. For example, in practical applications, location entities can include specific point-like locations, specific line-like locations, specific generic locations, and large-granularity locations. Traffic events typically occur at specific point-like locations. Therefore, the electronic device can acquire the target location features related to the location entities at specific point-like locations in the target heterogeneous map and predict the traffic event occurring at that location based on the target location features, thus improving the efficiency of traffic event determination. For example, with... Figure 8Taking the illustrated embodiment as an example, the geographic location tree in the initial heterogeneous graph includes location node 1 of location entity A, location node 2 of location entity B, and location node 3 of location entity C. Among them, location node 2 and location node 3 are leaf nodes. Therefore, location entities B and C in the target text are the smallest granularity location entities. After the electronic device performs multi-layer graph convolution processing on the initial heterogeneous graph, the electronic device can determine the location features of location entities B and C based on the vector representations corresponding to location nodes 2 and 3. Based on the location features of location entity B, the electronic device can predict the traffic events that occur in location entity B, and based on the location features of location entity C, the electronic device can predict the traffic events that occur in location entity C.

[0160] This application provides a method for determining traffic events. An electronic device can acquire target text related to traffic event information and identify multiple objects in the target text. The multiple objects include location entities and sentences in the target text. The electronic device can determine the positional relationships between multiple location entities, the sentence relationships between multiple sentences, and the belonging relationships between the location entities and sentences. The positional relationships, sentence relationships, and belonging relationships are determined as object relationships. The electronic device can generate an initial heterogeneous graph based on the location entities, sentences, and object relationships, and perform convolution processing on the initial heterogeneous graph based on multi-layer graph convolution to obtain a target heterogeneous graph. The electronic device can determine the positional features of the location entities corresponding to the location nodes based on the vector representations corresponding to the location nodes in the target heterogeneous graph, and predict the traffic events occurring at the location entities based on the positional features. In the above method, since the electronic device can determine the traffic event in the target text based on the location features corresponding to the location entities in the target text, the electronic device can determine the traffic event in the target text even if the target text does not contain traffic event trigger words. Furthermore, since the vector representation corresponding to the location node in the target heterogeneous graph can integrate the semantic information and location entity information of the adjacent nodes, the accuracy of the vector representation corresponding to the location node in the target heterogeneous graph is high, and the accuracy of the location features corresponding to the location entities is also high. The electronic device can accurately predict the traffic event corresponding to the target text based on the location features, thereby improving the accuracy of determining the traffic event.

[0161] exist Figure 2 Based on the embodiments shown, the following, in conjunction with Figure 9 The process of determining the aforementioned traffic incidents will be explained.

[0162] Figure 9 This is a schematic diagram illustrating a method for determining a traffic event as provided in an embodiment of this application. Please refer to [link / reference]. Figure 9 This includes: road notices. The road notice states: Due to construction at toll station A on the G1 expressway, exit 1 of toll station A is closed. Electronic equipment ( Figure 9 (Not shown) The location entities in the road notice can be identified as: G1 Expressway, Toll Station A, and Exit 1. The electronic device can identify the sentences in the road notice as including sentence a, sentence b, and sentence c. Among them, sentence a is "Due to construction at Toll Station A of G1 Expressway", sentence b is "Therefore", and sentence c is "Exit 1 of Toll Station A is impassable".

[0163] Please see Figure 9 The electronic device can determine object relationships, where the location entity relationship can be: G1 Expressway includes toll station A, and toll station A includes exit 1; the location entity and sentence relationship can be: G1 Expressway and toll station A are located in sentence a, toll station A is also located in sentence c, and exit 1 is located in sentence c. The electronic device can generate an initial heterogeneous graph based on the location entities, sentences, and object relationships.

[0164] Please see Figure 9 The initial heterogeneous graph includes nodes for G1 Expressway, toll station A, exit 1, sentence a, sentence b, and sentence c. Nodes for G1 Expressway are connected to nodes for toll station A via containment edges; nodes for toll station A are connected to exit 1 via containment edges; nodes for G1 Expressway and toll station A are connected to sentence a via edges between position nodes and sentence nodes; nodes for toll station A and exit 1 are connected to sentence c via edges between position nodes and sentence nodes; and nodes for sentence a, sentence b, and sentence c are connected via edges between sentence nodes. Each node and edge includes a corresponding initial feature vector.

[0165] Please see Figure 9 The electronic device performs convolution processing on the initial heterogeneous graph based on multi-layer graph convolution to obtain the target heterogeneous graph. The initial feature vector corresponding to each node in the initial heterogeneous graph can be fused with the semantic information of adjacent nodes after being processed by multi-layer graph convolution. Therefore, the electronic device can obtain the location features of G1 Expressway based on the vector representation corresponding to the node of G1 Expressway in the target heterogeneous graph, obtain the location features of toll station A based on the vector representation corresponding to the node of toll station A, and obtain the location features of exit 1 based on the vector representation corresponding to the node of exit 1.

[0166] Please see Figure 9 The electronic device can input the location features of G1 Expressway into the classifier. The classifier outputs that G1 Expressway has the highest correlation with the no traffic event type. The electronic device can input the location features of toll station A into the classifier. The classifier outputs that toll station A has the highest correlation with the road construction event. The electronic device can input the location features of exit 1 into the classifier. The classifier outputs that exit 1 has the highest correlation with the road closure event.

[0167] In this way, electronic devices can determine the traffic event corresponding to the target text based on the location features of each location entity. Electronic devices do not need to determine traffic events through the trigger words of traffic events. Furthermore, since the vector representation of the location node of the location entity in the target heterogeneous graph is obtained based on the semantic information and location entity information of the adjacent nodes, electronic devices can accurately predict traffic events based on location features, thereby improving the accuracy of traffic event determination.

[0168] Optionally, embodiments of this application also include a map updating method, wherein the electronic device can assign traffic events corresponding to target text to the operator based on the traffic event determination method in any of the above embodiments, the electronic device can obtain map update data obtained by the operator after processing the traffic events corresponding to the target text, and update the map using the map update data. In this way, the electronic device can update the map data in a timely manner, improving the efficiency of map data updating.

[0169] Based on any of the above embodiments, the method for determining traffic events further includes a method for training a traffic event prediction model, wherein the traffic event prediction model may include a multi-layer graph convolutional network. The following section will discuss this further. Figure 10 The training method of the above traffic incident prediction model is explained.

[0170] Figure 10 This diagram illustrates a training method for a traffic event prediction model provided in an embodiment of this application. Please refer to [link / reference]. Figure 10 The method process includes:

[0171] S1001. Obtain multiple sets of samples, including sample texts related to traffic events, sample texts of positive and negative examples corresponding to the sample texts, and sample traffic events corresponding to each sample text.

[0172] Specifically, since adjacent geographical locations influence each other during traffic event prediction (e.g., road construction events and road closure events co-occur in the target text), the accuracy of the traffic event prediction model can be improved by using contrastive learning constraints between positive and negative sample texts. For example, the target text includes adjacent location entities A and B. Location entity A corresponds to a road construction event, and location entity B corresponds to a road closure event. Traditional attention mechanisms calculate attention weights without explicit constraints on all text, and the long-distance dependencies of location entities in the training data exacerbate this influence (making location entities focus more on distant semantics). Therefore, the location features of location entity A will be affected by the location features of location entity B, leading to misclassification of location entity A as a road closure event. Therefore, this application uses a contrastive learning method to constrain the location features of location entities, allowing the traffic event prediction model to adaptively control the semantics that location entities need to focus on, thereby obtaining the correct traffic event.

[0173] Specifically, electronic devices can input multiple objects and object relationships from the target text into the traffic event prediction model. The traffic event prediction model can determine an initial heterogeneous graph. The vector representation of each node in the initial heterogeneous graph can be the initial feature vector of the location entity or sentence corresponding to that node. The electronic devices can process the initial heterogeneous graph through a multi-layer graph convolutional network in the traffic event prediction model to obtain a target heterogeneous graph. In the target heterogeneous graph, the vector representation of each node is a feature vector updated based on the information of neighboring nodes.

[0174] In the process of performing multi-layer graph convolution on the initial heterogeneous graph, the graph convolution formula for node u in the nth layer is as follows:

[0175]

[0176] Where K represents the set of different types of edges, Let N be a trainable parameter matrix. k (u) represents the set of neighboring nodes of node u, c u,k It is a constant related to the number of neighbors of node u. Let v be the representation of node v in the l-th layer GCN.

[0177] It should be noted that the method by which electronic devices acquire multiple sample texts related to traffic incident information is similar to... Figure 2 The embodiments shown are the same, and the embodiments in this application are not limited thereto.

[0178] Among them, the sample text corresponding to the positive example of the sample text can be a sample of the same type as the sample text, the sample text corresponding to the negative example of the sample text can be a sample of a different type than the sample text, and the sample traffic event can be the label corresponding to the sample text.

[0179] Below, specific examples illustrate the positive and negative sample texts.

[0180] Sample text: Road construction is underway at 353KM and 330KM on G1 Expressway towards city a. Only one lane is open to traffic at the site. The entrance from city b to city c is closed and traffic is controlled.

[0181] The sample traffic events corresponding to this sample text are: 353KM and 330KM, road construction events; and the entrance from city b to city c, road closure event.

[0182] The sample text corresponding to the positive example is: G1 Expressway at 353KM and 330KM in the direction of city a is under construction, and only one lane is open to traffic.

[0183] The sample text for this positive example corresponds to the following sample traffic events: 353KM and 330KM, which are road construction events.

[0184] The negative example text corresponding to this sample text is: Road construction is underway at 353KM and 330KM on G1 Expressway towards city a, with single-lane traffic on site, and vehicles with more than 6 seats are restricted from passing through the entrance from city b to city c.

[0185] The sample traffic events corresponding to the negative example sample text are: 353KM, 330KM, road construction events; city b to city c entrance, vehicle type restriction event.

[0186] Based on the above method, we can obtain positive and negative sample texts corresponding to a sample text. Negative sample texts can be obtained by replacing traffic events in the sample text (e.g., replacing traffic events far from the location entities), while positive sample texts can be obtained directly from the sample text. For example, for all adjacent location entities in a sample text that are not in the same sentence, the starting position of each location entity is used as a candidate cutting point. If the location entities before and after the cutting point are in a parallel relationship, and there is a verb before the candidate cutting point (e.g., construction, traffic restrictions, and traffic accidents), the candidate cutting point is retained; otherwise, it is deleted. The sample text is then segmented based on the retained candidate cutting points, and the first part is used as the positive sample text corresponding to the sample text. For example, the sample text is: "G1 Expressway towards city a: road construction at 353KM and 330KM, entrance from city b to city c closed and traffic controlled." Here, 353KM and 330KM are adjacent to the entrance from city b to city c, and the verb "construction" is included before the entrance from city b to city c. Therefore, by cutting at the comma position before the entrance from city b to city c, we can obtain the positive sample text: "G1 Expressway towards city a: road construction at 353KM and 330KM."

[0187] S1002. Train the traffic event prediction model based on multiple sets of samples.

[0188] Specifically, after GCN encoding, the electronic device can obtain a vector representation (e.g., 1*N*H) corresponding to the location node of each location entity, where N is the number of location entities and H is the hidden layer dimension of the feature extraction layer. The electronic device can perform supervised contrastive learning on the vector representation based on the following formula (positive sample texts are samples of the same type), and the loss is used as a regularization term to constrain the feature vector of the location entity:

[0189]

[0190] Where I is the sample set in a batch, P(i) is the set of positive examples excluding sample i, A(i) is the set of negative examples relative to sample i, and z i Let be the feature vector of sample i after encoding in the deep learning network, · represents the inner product between vectors, and τ is an adjustable coefficient.

[0191] In this way, electronic devices can train traffic event prediction models based on multiple sets of samples, enabling the traffic event prediction models to reasonably focus on the semantics related to location entities and improve the accuracy of traffic event determination.

[0192] Below, in conjunction with Figure 11 The training process of the traffic incident prediction model is explained.

[0193] Figure 11 This is a schematic diagram illustrating the training process of a traffic event prediction model provided in an embodiment of this application. Please refer to [link / reference]. Figure 11 This includes a set of sample texts. The BERT encoder is used to process this set of sample texts, and the output features of the BERT encoder are processed to a fixed length. This yields the initial feature vectors for each entity at each location in the sample text and the initial feature vectors for each sentence.

[0194] Please see Figure 11 A geographic location tree is constructed corresponding to the sample text. This tree includes location nodes corresponding to three location entities: E1, E2, and E3. E1 contains both E2 and E3, and E2 and E3 are parallel entities. (Traffic event prediction model) Figure 11 (Not shown) Based on the geographic location tree and the object relationships in the sample text, an initial heterogeneous graph corresponding to the sample text can be obtained. This initial heterogeneous graph includes nodes E1, E2, E3, S1 (node ​​of sentence a), S2 (node ​​of sentence b), and S3 (node ​​of sentence c).

[0195] Please see Figure 11 In the initial heterogeneous graph, E1 is connected to E2 and E3 based on containment edges, E2 is connected to E3 based on parallel edges, E1 is connected to S1 based on the edges between position nodes and sentence nodes, E2 and E3 are connected to S2 based on the edges between position nodes and sentence nodes, and S1, S2, and S3 are connected based on the edges between sentence nodes. The vector corresponding to each node represents the initial feature vector of the position entity or sentence corresponding to that node.

[0196] Please see Figure 11 Since the feature vectors of E1 and E2 are positive examples, and the feature vector of E3 is a negative example, the traffic incident detection model can determine the loss based on the positive and negative examples, and update the model parameters accordingly. In this way, through comparative training, the output of the traffic incident detection model can move closer to positive samples and further away from negative samples, thus avoiding interference from text about traffic incidents far from the location entity, thereby improving the model accuracy.

[0197] Figure 12 This is a schematic diagram of a traffic event determination device provided in an embodiment of this application. Please refer to [link / reference]. Figure 12 The traffic incident determination device 120 includes an acquisition module 121, a first determination module 122, a second determination module 123, a third determination module 124, and a fourth determination module 125, wherein:

[0198] The acquisition module 121 is used to acquire target text related to traffic incident information;

[0199] The first determining module 122 is used to determine multiple objects in the target text, the objects including location entities and sentences in the target text;

[0200] The second determining module 123 is used to determine the object relationships between the plurality of objects;

[0201] The third determining module 124 is used to determine the location features corresponding to the location entity based on the location entity, the sentence in the target text, and the object relationship;

[0202] The fourth determining module 125 is used to determine the traffic event corresponding to the target text based on the location features.

[0203] In one possible implementation, the third determining module 124 is specifically used for:

[0204] The location entities and sentences in the target text are processed according to the pre-trained language model to obtain the initial feature vector of each location entity and the initial feature vector of each sentence in the target text;

[0205] Based on the initial feature vector of each location entity, the initial feature vector of each sentence, and the object relationship, the location features corresponding to the location entity are determined.

[0206] In one possible implementation, the third determining module 124 is specifically used for:

[0207] An initial heterogeneous graph is determined based on the initial feature vector of each location entity, the initial feature vector of each sentence, and the object relationship. The initial heterogeneous graph includes location nodes corresponding to each location entity, sentence nodes corresponding to each sentence, and edges between nodes. The vector corresponding to each location node is represented as the initial feature vector of the location entity of the location node, and the vector corresponding to each sentence node is represented as the initial feature vector of the sentence of the sentence node.

[0208] The initial heterogeneous graph is processed using a multi-layer graph convolutional network to obtain the target heterogeneous graph;

[0209] The feature vector corresponding to the location node in the target heterogeneous graph is determined as the location feature of the location entity corresponding to the location node.

[0210] In one possible implementation, the third determining module 124 is specifically used for:

[0211] Based on the initial feature vector of each location entity and the initial feature vector of each sentence, determine the location nodes and sentence nodes in the initial heterogeneous graph;

[0212] Based on the object relationships, determine the edges between the position nodes, the edges between the sentence nodes, and the edges between the position nodes and the sentence nodes;

[0213] The initial heterogeneous graph is obtained based on the position node, the sentence node, the edge between the position node, the edge between the sentence node, and the edge between the position node and the sentence node.

[0214] In one possible implementation, the first determining module 122 is specifically used for:

[0215] The target text is segmented to obtain the sentences within the target text;

[0216] The target text is subjected to location named entity recognition processing to obtain at least one location entity in the target text.

[0217] In one possible implementation, the second determining module 123 is specifically used for:

[0218] Determine the positional relationships between multiple location entities, the sentence relationships between multiple sentences, and the membership relationships between the location entities and sentences;

[0219] The positional relationship, the sentence relationship, and the belonging relationship are determined as the object relationship.

[0220] In one possible implementation, the second determining module 123 is specifically used for:

[0221] Obtain a geographic location relationship database, wherein the geographic location relationship database includes the location relationships between geographic locations associated with multiple location entities;

[0222] Determine a list of location entities, which includes location entities in the target text, and the location entities in the list are arranged in the order in which they appear in the target text.

[0223] The location relationships are determined based on the geographic location relationship database and the location entity list.

[0224] The traffic event determination device provided in this application embodiment can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be described again here.

[0225] The traffic event determination device shown in this application embodiment can be a chip, hardware module, processor, etc. Of course, the traffic event determination device can be in other forms, and this application embodiment does not specifically limit it.

[0226] Figure 13 A schematic diagram of the hardware structure of the electronic device provided in this application. Please refer to [link / reference]. Figure 13 The electronic device 130 may include a processor 131 and a memory 132, wherein the processor 131 and the memory 132 can communicate; for example, the processor 131 and the memory 132 communicate via a communication bus 133, the memory 132 is used to store program instructions, and the processor 131 is used to call the program instructions in the memory to execute the traffic event determination method shown in any of the above method embodiments.

[0227] Optionally, the electronic device 130 may also include a communication interface, which may include a transmitter and / or a receiver.

[0228] Optionally, the aforementioned processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this application can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.

[0229] This application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, include, as in the first aspect, and a method for determining various possible traffic events involved in the first aspect.

[0230] This application embodiment may also provide a computer program product, the computer program product including a computer program, which, when executed by a processor, performs the first aspect and the method for determining various possible traffic events involved in the first aspect.

[0231] All or part of the steps in the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a readable memory. When the program is executed, it performs the steps of the above method embodiments; and the aforementioned memory (storage medium) includes: read-only memory (ROM), RAM, flash memory, hard disk, solid-state drive, magnetic tape, floppy disk, optical disk, and any combination thereof.

[0232] This application describes embodiments of methods, apparatus (systems), and computer program products according to embodiments of this application with reference to flowchart illustrations and / or block diagrams. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processing unit of a general-purpose computer, special-purpose computer, embedded processor, or other programmable electronic device to produce a machine, such that the instructions, which execute via the processing unit of the computer or other programmable electronic device, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0233] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable electronic device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0234] These computer program instructions may also be loaded onto a computer or other programmable electronic device, causing a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable device for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0235] Obviously, those skilled in the art can make various modifications and variations to the embodiments of this application without departing from the spirit and scope of this application. Therefore, if these modifications and variations to the embodiments of this application fall within the scope of the claims of this application and their equivalents, this application also intends to include these modifications and variations.

[0236] In this application, the term "comprising" and its variations can refer to non-limiting inclusion; the term "or" and its variations can refer to "and / or". The terms "first", "second", etc., in this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. In this application, "multiple" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.

Claims

1. A method for determining a traffic incident, characterized in that, include: Obtain target text related to traffic incident information; Multiple objects are identified in the target text, including location entities and sentences in the target text; Determine the object relationships between the plurality of objects; The location entities and sentences in the target text are processed according to the pre-trained language model to obtain the initial feature vector of each location entity and the initial feature vector of each sentence in the target text; An initial heterogeneous graph is determined based on the initial feature vector of each location entity, the initial feature vector of each sentence, and the object relationship. The initial heterogeneous graph includes location nodes corresponding to each location entity, sentence nodes corresponding to each sentence, and edges between nodes. The vector corresponding to each location node is represented as the initial feature vector of the location entity related to the location node, and the vector corresponding to each sentence node is represented as the initial feature vector of the sentence related to the sentence node. The initial heterogeneous graph is processed using a multi-layer graph convolutional network to obtain the target heterogeneous graph; The vector representation corresponding to the location node in the target heterogeneous graph is determined as the location feature of the location entity related to the location node; Based on the location features, the traffic event corresponding to the target text is determined.

2. The method according to claim 1, characterized in that, Based on the initial feature vector of each location entity, the initial feature vector of each sentence, and the object relationship, an initial heterogeneous graph is determined, including: Based on the initial feature vector of each location entity and the initial feature vector of each sentence, determine the location nodes and sentence nodes in the initial heterogeneous graph; Based on the object relationships, determine the edges between the position nodes, the edges between the sentence nodes, and the edges between the position nodes and the sentence nodes; The initial heterogeneous graph is obtained based on the position node, the sentence node, the edge between the position node, the edge between the sentence node, and the edge between the position node and the sentence node.

3. The method according to claim 1 or 2, characterized in that, Multiple objects are identified in the target text, including: The target text is segmented to obtain the sentences within the target text; The target text is subjected to location named entity recognition processing to obtain at least one location entity in the target text.

4. The method according to claim 1 or 2, characterized in that, Determining the object relationships between the plurality of objects includes: Determine the positional relationships between multiple location entities, the sentence relationships between multiple sentences, and the membership relationships between the location entities and sentences; The positional relationship, the sentence relationship, and the belonging relationship are determined as the object relationship.

5. The method according to claim 4, characterized in that, Determine the positional relationships between multiple location entities, including: Obtain a geographic location relationship database, wherein the geographic location relationship database includes the location relationships between geographic locations associated with multiple location entities; Determine a list of location entities, which includes location entities in the target text, and the location entities in the list are arranged in the order in which they appear in the target text. Based on the geographic location relationship database and the location entity list, the location relationships between the multiple location entities are determined.

6. A method for updating a map, characterized in that, include: The traffic event determination method as described in any one of claims 1-5 is used to assign traffic events corresponding to target texts to operators; The map update data obtained by the operator after processing the traffic event corresponding to the target text is acquired, and the map is updated using the map update data.

7. A device for determining a traffic incident, characterized in that, It includes an acquisition module, a first determination module, a second determination module, a third determination module, and a fourth determination module, wherein: The acquisition module is used to acquire target text related to traffic incident information; The first determining module is used to determine multiple objects in the target text, the objects including location entities and sentences in the target text; The second determining module is used to determine the object relationships between the plurality of objects; The third determining module is used to process the location entities and sentences in the target text according to the pre-trained language model to obtain the initial feature vector of each location entity and the initial feature vector of each sentence in the target text; An initial heterogeneous graph is determined based on the initial feature vector of each location entity, the initial feature vector of each sentence, and the object relationship. The initial heterogeneous graph includes location nodes corresponding to each location entity, sentence nodes corresponding to each sentence, and edges between nodes. The vector corresponding to each location node is represented as the initial feature vector of the location entity related to the location node, and the vector corresponding to each sentence node is represented as the initial feature vector of the sentence related to the sentence node. The initial heterogeneous graph is processed using a multi-layer graph convolutional network to obtain the target heterogeneous graph; The vector representation corresponding to the location node in the target heterogeneous graph is determined as the location feature of the location entity related to the location node; The fourth determining module is used to determine the traffic event corresponding to the target text based on the location features.

8. An electronic device, characterized in that, include: Processor, memory; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the method for determining a traffic event as described in any one of claims 1-5.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method for determining traffic events as described in any one of claims 1-5.