Data processing method, device and equipment for extracting public transportation information

By extracting semantic elements from public transportation data objects and automatically matching them with the database, the problem of low efficiency in extracting public transportation information has been solved, achieving efficient, accurate, and real-time information updates.

CN116010544BActive Publication Date: 2026-06-02ALIBABA (CHINA) CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ALIBABA (CHINA) CO LTD
Filing Date
2023-01-19
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

Existing technologies suffer from high labor costs and low processing efficiency when extracting public transportation information, especially when public transportation routes change or are adjusted, making it difficult to achieve automatic updates and real-time performance.

Method used

By extracting target semantic elements from data objects related to public transportation, and using a pre-trained text processing model, the system automatically matches target route information in the public transportation information database, including name and direction information, to achieve automatic extraction and updating.

Benefits of technology

It saves labor costs, improves information retrieval efficiency, enhances recall and accuracy, and ensures the real-time performance and accuracy of the public transportation information database.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116010544B_ABST
    Figure CN116010544B_ABST
Patent Text Reader

Abstract

The application provides a data processing method, device and equipment for extracting public transport information, and relates to the technical field of natural language processing. The data processing method comprises the following steps: extracting a target semantic element from a data object related to public transport, the target semantic element being used for representing semantic information related to public transport; and determining target line information matched with the target semantic element from a public transport information database according to the target semantic element, the target line information comprising at least one of name information and direction information corresponding to a target line. According to the technical scheme of the application, the public transport information included in the data object can be automatically extracted, the labor cost is saved, and the extraction efficiency of the public transport information is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of natural language processing technology, and in particular to a data processing method, apparatus, and device for extracting public transportation information. Background Technology

[0002] For a particular public transportation route, in special circumstances such as station maintenance or vehicle upkeep, it is necessary to change or adjust specific information such as station operation status, number of services, arrival times, first bus times, and last bus times. Operators typically issue notices or announcements to remind passengers of these changes. For transportation information display platforms such as maps, it is necessary to extract relevant information about public transportation routes from news articles involving these routes to update the database in real time. Currently, related technologies often employ manual extraction of this information, which suffers from high labor costs and low processing efficiency. Summary of the Invention

[0003] This application provides a data processing method, apparatus, and device for extracting public transportation information, so as to automatically extract target route information from data objects related to public transportation.

[0004] In a first aspect, embodiments of this application provide a data processing method for extracting public transportation information, including:

[0005] Extract target semantic elements from data objects related to public transportation; these target semantic elements are used to represent semantic information related to public transportation.

[0006] Based on the target semantic elements, target route information that matches the target semantic elements is determined from the public transportation information database. The target route information includes at least one of the name information and direction information corresponding to the target route.

[0007] Secondly, embodiments of this application provide a data processing apparatus for extracting public transportation information, comprising:

[0008] The target semantic element extraction module is used to extract target semantic elements from data objects related to public transportation; the target semantic elements are used to represent semantic information related to public transportation.

[0009] The target route information determination module is used to determine the target route information that matches the target semantic elements from the public transportation information database based on the target semantic elements. The target route information includes at least one of the name information and direction information corresponding to the target route.

[0010] Thirdly, embodiments of this application provide an electronic device, including a memory, a processor, and a computer program stored in the memory, wherein the processor, when executing the computer program, implements the method described in any of the above-mentioned embodiments.

[0011] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the method described in any of the above-mentioned embodiments.

[0012] Compared with the prior art, this application has the following advantages:

[0013] According to the technical solution of this application, based on data objects related to public transportation, target semantic elements representing public transportation are extracted from the data objects. Then, target route information matching the target semantic elements is determined from the public transportation information database. The target route information includes at least one of the name information and direction information corresponding to the target route. This achieves automatic extraction of public transportation information from data objects. Compared to the manual extraction of public transportation information from data objects in related technologies, the technical solution of this application saves labor costs and improves the efficiency of information extraction. Secondly, matching the target semantic elements in the public transportation information database helps improve the recall and accuracy of target route matching. Furthermore, based on at least one of the obtained name and direction information, when the data object is news data involving changes or adjustments to public transportation route information, the extracted target route information can be used to quickly locate the corresponding route information stored in the public transportation information database. This allows for real-time automatic updates of information related to the target route based on the content of the data object, thereby improving the real-time performance and accuracy of the data stored in the public transportation information database.

[0014] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application, it can be implemented according to the contents of the specification. In order to make the above and other objects, features and advantages of this application more obvious and understandable, specific embodiments of this application are given below. Attached Figure Description

[0015] In the accompanying drawings, unless otherwise specified, the same reference numerals throughout the various drawings denote the same or similar parts or elements. These drawings are not necessarily drawn to scale. It should be understood that these drawings depict only some embodiments disclosed in this application and should not be construed as limiting the scope of this application.

[0016] Figure 1A flowchart illustrating a data processing method for extracting public transportation information according to an embodiment of this application is shown.

[0017] Figure 2 This diagram illustrates an example of determining the direction information corresponding to a target route in a data processing method for extracting public transportation information according to an embodiment of this application.

[0018] Figure 3 A structural block diagram of a data processing apparatus for extracting public transportation information according to an embodiment of the application is shown.

[0019] Figure 4 A block diagram is shown for implementing an electronic device according to an embodiment of this application. Detailed Implementation

[0020] In the following description, only certain exemplary embodiments are briefly described. As those skilled in the art will recognize, the described embodiments can be modified in various ways without departing from the spirit or scope of this application. Therefore, the drawings and description are considered to be exemplary in nature and not restrictive.

[0021] This application provides a data processing method for extracting public transportation information. The execution entity of this data processing method can be an application server. In this application embodiment, the types of public transportation can include buses, subways, ferries, trolleybuses, trams, etc. Public transportation information can be any information related to public transportation. In the following description of this application specification, the public transportation information is described in detail as information related to public transportation routes, such as information related to bus routes, subway lines, and other types of public transportation routes.

[0022] Figure 1 This is a flowchart illustrating a data processing method for extracting public transportation information according to an embodiment of this application. Figure 1 As shown, the data processing method for extracting public transportation information may include the following steps:

[0023] Step S101: Extract target semantic elements from data objects related to public transportation; target semantic elements are used to represent semantic information related to public transportation.

[0024] In this embodiment, the data format of the data object can be any format. For example, the data format of the data object can specifically be text, image, audio, or video, etc., and this embodiment does not specifically limit this. For data processing objects whose data format is text data, a pre-trained text processing model can be used to extract target semantic elements from the text data. For data objects whose data format is other than text data, such as image data, audio data, or video data, the data format of the data object can be converted first to obtain the corresponding text data, and then the text data can be input into a pre-trained text processing model to extract target semantic elements from the text data.

[0025] The method for converting the data format of a data object can be any method known or known in the future to those skilled in the art, and this application does not impose specific limitations on this method. For example, for a data object in the form of an image, image recognition technology can be used to extract the text information contained in the image to obtain the corresponding text data.

[0026] For example, the data object can be news data related to public transportation, such as notices or announcements related to public transportation routes. For instance, when special circumstances arise for a particular public transportation route, such as station maintenance or vehicle upkeep, it may be necessary to change or adjust specific information such as station operation status, number of services, arrival times, first departure times, and last departure times. Operators typically issue notices or announcements to remind passengers of these changes. The description of the public transportation route in these notices or announcements usually includes the route's name and direction information. It is understandable that for other public transportation routes, such as bus routes or subway lines, the direction of travel for public transportation routes usually involves two directions. For example, for a linear public transport line, at stations A and B located at both ends of the line, the direction of travel for a bus can be either a first direction from station A to station B or a second direction from station B to station A. Buses traveling in the first direction originate at station A and terminate at station B, while buses traveling in the second direction originate at station B and terminate at station A. As another example, for a circular public transport line, the direction of travel for a bus can be either clockwise or counterclockwise along the circular route. The direction information of the public transport line involved in the data object can specifically involve at least one of the two directions of travel. In other words, it can involve only one of the two directions of travel, or it can involve both directions of travel.

[0027] Target semantic elements are used to represent semantic information related to public transportation, specifically semantic information related to the name of a public transportation route and its direction of travel. For example, target semantic elements may include name semantic elements and direction semantic elements. Name semantic elements are used to represent semantic information related to the name of a public transportation route, and direction semantic elements are used to represent semantic information related to the direction of travel of a public transportation route.

[0028] More specifically, the name semantic element can be "Metro Lines 1, 2, and 3", "Routes 5 and 7 (2 lines in total)", or "Route 3 and Metro Lines 7 and 10". The direction semantic element can be categorized into one-way and two-way directions based on the number of travel directions involved. A one-way direction refers to a direction semantic element involving only one of the two travel directions of the public transportation line, while a two-way direction refers to a direction semantic element involving both travel directions of the public transportation line. For example, for a direction semantic element of two-way direction, the element could be "round trip", "both directions", or "up and down", indicating the two travel directions of the public transportation line specifically involved in the data object's related public transportation information. Conversely, for a direction semantic element of one-way direction, the element could be "from station xx (originating station) to station xx (terminal station)" or "towards station xx (terminal station)", indicating one of the two travel directions of the public transportation line specifically involved in the data object's related public transportation information.

[0029] It should be noted that the extracted target semantic elements may be expressed in various ways. For example, for a bus route named "Route 5," the name semantic elements included in the data object could be expressed as "Route 5," "Fifth Route Bus," or "Line 5 Bus." However, in the public transportation information database, the name information for each public transportation route usually has a corresponding standardized expression. If the target semantic elements are not processed accordingly, it is difficult to directly determine the standardized expression corresponding to the public transportation route involved in the target semantic elements from the public transportation information database. Based on this, the subsequent step S102 needs to be performed.

[0030] Step S102: Based on the target semantic elements, determine the target route information that matches the target semantic elements from the public transportation information database. The target route information includes at least one of the name information and direction information corresponding to the target route.

[0031] In this embodiment of the application, the public transportation information database is used to pre-store relevant information of all public transportation routes within a preset area. In addition, it can also be used to store relevant information of all stations involved in each public transportation route.

[0032] In one example, the public transportation information database may pre-store at least one of the following: preset station names, preset area information, and preset station coordinates for the origin and destination stations in different travel directions for each public transportation route. The preset station names refer to the names of each station included in the public transportation route. The preset area information refers to the information related to the preset area where at least one station of the public transportation route is located. The preset station coordinates refer to the coordinates of each station included in the public transportation route.

[0033] For example, in step S102, based on the obtained name semantic elements, the name information corresponding to the target route matching the name semantic elements is determined from the public transportation information database, thereby determining which one or more target routes the name semantic elements refer to. It can be understood that the name information corresponding to the target route refers to the text information used to name the target route in the public transportation information database. For example, if the target route is a subway line, its corresponding name information could be "Subway Line 1". Another example is if the target route is a bus route, its corresponding name information could be "Route 241". After determining the target route referred to by the name semantic elements, other pre-stored relevant information about the target route can be obtained from the public transportation information database. This other relevant information can include station information corresponding to all stations of the target route, such as the station name, coordinates, and area information of each station. Further, based on the obtained direction semantic elements, and using the other relevant information corresponding to the determined target route, the direction information of the target route corresponding to the direction semantic elements is determined. Specifically, the direction information of the target route can include the direction type and the specific route direction of the target route.

[0034] In a specific example, the extracted target semantic element could be "Railway Line 1 heading towards the city center," where the name semantic element is "Railway Line 1" and the direction semantic element is "heading towards the city center." For the name semantic element, the name information of all public transportation routes stored in the public transportation information database is matched to obtain the target route "Railway Line 1" corresponding to the name semantic element. Relevant information corresponding to the target route is then retrieved from the public transportation information database. This relevant information can include preset area information corresponding to each station of "Railway Line 1." The preset area information for each station can be the name or location information of the area where the station is located. The specific area can be set according to the preset area type, such as "city center," "urban area," "suburbs," or "development zone." The target route "Express Line 1" has two stations, A and B. Station A corresponds to the suburban area, and station B corresponds to the urban area. By matching the keyword "urban area" in the directional semantic element "heading towards the urban area" with the directional semantic element "urban area" and the directional semantic element "heading towards the urban area", the station corresponding to the keyword "urban area" is determined to be station B. Therefore, the directional information of the target route can be determined to be a one-way route, and the specific route direction is either "from station A to station B" or "heading towards station B".

[0035] According to the data processing method for extracting public transportation information according to embodiments of this application, based on data objects related to public transportation, target semantic elements representing public transportation are extracted from the data objects. Then, target route information matching the target semantic elements is determined from the public transportation information database. The target route information includes at least one of the name information and direction information corresponding to the target route. This achieves automatic extraction of public transportation information from data objects. Compared to the manual extraction of public transportation information from data objects in related technologies, the technical solution of this application saves labor costs and improves the efficiency of information extraction. Secondly, matching the target semantic elements in the public transportation information database helps improve the recall and accuracy of target route matching. Furthermore, based on at least one of the obtained name and direction information, when the data object is news data involving changes or adjustments to public transportation route information, the extracted target route information can be used to quickly locate the corresponding route information stored in the public transportation information database. This allows for real-time automatic updates of information related to the target route based on the content of the data object, thereby improving the real-time performance and accuracy of the data stored in the public transportation information database.

[0036] In one possible implementation, the target semantic elements include name semantic elements and direction semantic elements, and step S102 may include the following steps:

[0037] Step S1021: Based on the semantic elements of the name, determine the name information corresponding to the target route that matches the semantic elements of the name from the public transportation information database;

[0038] Step S1022: Determine the direction information corresponding to the target route based on the direction semantic elements.

[0039] In this embodiment of the application, the name semantic element is used to characterize semantic information related to the name of the public transportation line, and the direction semantic element is used to characterize semantic information related to the direction of travel of the public transportation line.

[0040] For example, a pre-trained text processing model can be used to input the text data corresponding to the data object into the text processing model for text processing, thereby obtaining the name semantic elements and target semantic elements included in the data object.

[0041] In step S1021, the public transportation information database includes a route information sub-database and a station information sub-database. The route information sub-database pre-stores the name information for all public transportation routes, and the station information sub-database pre-stores the relevant information for all stations along each public transportation route. Based on the text information corresponding to the semantic elements of the names, the name information for all public transportation routes stored in the route information sub-database is matched, and the public transportation route corresponding to the name information that matches the text information is determined as the target route. Based on the determined target route, the relevant information for the target route is read from the route information sub-database.

[0042] It is understood that, in this embodiment of the application, after determining the name information corresponding to the target route that matches the name semantic element, it is possible to determine which one or more public transportation routes the name semantic element refers to, and thus determine the target route corresponding to the name semantic element. After determining the target route, relevant information corresponding to the target route can also be obtained from the public transportation information database. This relevant information includes not only the name information corresponding to the target route but also other relevant information. For example, other relevant information of the target route may include at least one of the following: preset station name information, preset area information, and preset station coordinates corresponding to the origin and destination stations in different travel directions. Here, preset station name information refers to the name information corresponding to each station included in the target route. Preset area information refers to the relevant information of the preset area where at least one station included in the target route is located. Preset station coordinates refer to the coordinate information corresponding to each station included in the target route.

[0043] In step S1022, based on directional semantic elements, keywords can be extracted from the directional semantic elements first, and then the keywords are matched with relevant information of the target route. Based on the matching results, the directional information corresponding to the target route involved in the directional semantic elements is determined. The directional information corresponding to the target route can include the direction type and route direction of the target route. The direction type refers to whether the target route involved in the directional semantic elements is a one-way or two-way route. The route direction refers to which of the two driving directions the target route corresponds to if the direction type is one-way.

[0044] Optionally, step S1021 may include:

[0045] Based on the route number included in the name semantic elements, determine the name information corresponding to at least one candidate route that matches the route number from the public transportation information database; determine the semantic similarity between the name semantic elements and the name information corresponding to each candidate route; and determine the name information corresponding to the target route from the name information corresponding to at least one candidate route based on the semantic similarity.

[0046] It is understandable that some public transportation routes are typically named using numerical designations. Examples include "Metro Line 1," "Metro Line 3," "Route 5," and "Route 241." Therefore, when the semantic elements of the name include the route number, the public transportation route it refers to can be quickly identified based on the route number.

[0047] It should be noted that different public transportation routes may contain the same route number in their corresponding names. For example, both the bus route "Route 2" and the subway line "Subway Line 2" contain the same route number "2". If the semantic element "Route 2 Bus" contains the route number "2", both "Route 2" and "Subway Line 2" may be matched simultaneously. Therefore, after obtaining at least one candidate route's name information based on the route number, the matched candidate route's name information needs further filtering to determine the candidate route's name information with the highest match degree with the semantic element, and this name information is then designated as the target route's name information.

[0048] For example, determining the semantic similarity between the semantic elements of the name and the name information corresponding to each candidate line can be achieved by any semantic similarity calculation method, such as cosine similarity, Euclidean distance, Manhattan distance, Minkowski distance, Pearson correlation coefficient, etc. This application embodiment will not describe it in detail.

[0049] In a specific example, the semantic similarity between name semantic elements and the name information corresponding to each candidate line can be determined using the Jaccard Coefficient algorithm. Specifically, let A be the semantic set corresponding to the name semantic elements, and B be the semantic set corresponding to the name information of any candidate line. Then, the Jaccard coefficient J(A,B) between the name semantic elements and the name information of the candidate lines is:

[0050]

[0051] Understandably, the Jaccard coefficient is used to represent the difference and similarity between two sets; the higher the Jaccard coefficient, the higher the similarity between the two sets. Based on this, by calculating the Jaccard coefficient between the semantic elements of the names and the name information corresponding to each candidate route, the candidate route with the highest Jaccard coefficient can be identified as the target route corresponding to the semantic elements of the names.

[0052] Furthermore, since the Jaccard similarity coefficient algorithm does not require comparing the differences between two objects, but only focuses on whether the two objects are the same, using the Jaccard similarity coefficient algorithm to determine the semantic phase velocity between the semantic elements of the name and the name information corresponding to each candidate route helps to save computational resources and improve the efficiency of determining the target route.

[0053] According to the above implementation method, by utilizing the route number included in the name semantic element, public transportation routes unrelated to the route number are filtered out in the public transportation information database, and public transportation routes matching the route number are selected as candidate routes. Then, based on the semantic similarity between the name semantic element and the name information corresponding to each candidate route, the target route is determined from at least one candidate route. Thus, it is not necessary to calculate the semantic similarity between the name semantic element and the name information corresponding to each public transportation route in the public transportation information database, thereby saving the data processing volume of calculating semantic similarity and improving the efficiency of determining the target route.

[0054] Optionally, determining the semantic similarity between the name semantic elements and the name information corresponding to each candidate line includes:

[0055] The semantic elements of the name are processed according to preset rules to obtain the formatted text corresponding to the semantic elements of the name; the semantic similarity between the formatted text and the name information corresponding to each candidate line is determined.

[0056] It should be noted that, given that the expression of name semantic elements in data objects may vary, before calculating the semantic similarity between name semantic elements and the name information corresponding to candidate routes, the name semantic elements can be processed accordingly, such as converting them into formatted text, so that the expression of name semantic elements is close to the standard expression of public transportation routes in the public transportation information database, thereby improving the accuracy of the calculated semantic similarity.

[0057] In this embodiment of the application, the preset rules can be set according to the standardized expression of public transportation routes and the expression habits of semantic elements of names in data objects.

[0058] In one possible implementation, the semantic elements of the name are processed according to preset rules, including at least one of the following:

[0059] Insert a preset character at the target character position in the name semantic element; delete irrelevant characters in the name semantic element; differentiate the line type corresponding to the name semantic element; convert the line number in the name semantic element into a preset format; convert special symbols in the name semantic element into separator symbols.

[0060] For example, taking the semantic elements of the name as "Metro Line 1, 2, 3", preset characters can be inserted into the target character positions in the semantic elements of the name to obtain the corresponding formatted text "Metro Line 1", "Metro Line 2", and "Metro Line 3". This achieves information completion for the semantic elements of the name.

[0061] Taking the name semantic element as "2 routes including Route 5 and Route 7" as an example, the irrelevant characters "including 2 routes" in the name semantic element can be deleted to obtain the text information "Route 5 and Route 7". Then, using the aforementioned information completion method, the corresponding formatted texts "Route 5" and "Route 7" can be obtained. Thus, the exclusion of irrelevant characters in the name semantic element is achieved.

[0062] Taking the name semantic element as "Route 3 and Subway Lines 7 and 10" as an example, the expressions corresponding to the two types of lines, namely bus lines and subway lines, included therein can be distinguished to obtain the corresponding formatted texts "Route 3", "Subway Line 7", and "Subway Line 10". Among them, the line type corresponding to "Route 3" is a bus line, and the line types corresponding to "Subway Line 7" and "Subway Line 10" are both subway lines. Thus, the distinction of different line types included in the name semantic element and the corresponding expressions are achieved.

[0063] Taking the name semantic element as "Express Route 1" as an example, the line number "1" in the name semantic element can be converted from the Chinese format to a preset format, such as the Arabic numeral format, to obtain the formatted text "Express Route 1". Thus, the mapping of the digital line number included in the name semantic element to the line number in the preset format is achieved.

[0064] Taking the name semantic element as "(Subway Line 1)" as an example, the special characters "(" and ")" included in the name semantic element can be converted into interval symbols to obtain the formatted text including interval symbols. Among them, there can be multiple preset special characters, such as "", ", / , \, @, %, etc.

[0065] In one possible implementation manner, step S1022 may include:

[0066] Extract keywords from the direction semantic element; determine the direction type corresponding to the target line according to the keywords, where the direction type includes one-way direction or two-way direction; determine the direction information corresponding to the target line according to the direction type corresponding to the target line.

[0067] In the embodiment of the present application, preset keywords can be used to extract the words matching the preset keywords from the direction semantic element to obtain the keywords.

[0068] For example, the direction type of the target route is determined based on keywords. Specifically, keyword matching can be used to determine whether the direction type is two-way. For instance, preset keywords can be words indicating a two-way direction, such as "two-way," "round trip," or "up and down." If a keyword matches any preset keyword, the direction type of the target route is determined to be two-way. If the keyword does not match any preset keywords, the direction type of the target route is determined to be one-way.

[0069] It is understandable that when the direction type corresponding to the target route is two-way, that is, when the direction of the target route is the two directions of travel of the public transportation route corresponding to the target route stored in the public transportation information database, it is not necessary to further determine which of the two directions of travel of the corresponding public transportation route the target route corresponds to.

[0070] In one possible implementation, determining the direction information corresponding to the target route based on the direction type of the target route includes:

[0071] When the direction type corresponding to the direction semantic element is a two-way direction, the two preset route directions corresponding to the target route stored in the public transportation information database are determined as the route directions corresponding to the target route.

[0072] For example, the public transportation information database stores two preset route directions corresponding to a target route, namely a first preset route direction and a second preset route direction. The first preset route direction is specifically "from station A to station B," and the second preset route direction is specifically "from station B to station A." If the direction semantic element is determined to be a two-way direction, it indicates that the direction semantic element involves both the first and second preset route directions of the target route. Therefore, the route directions corresponding to the target route can be determined to be both "from station A to station B" and "from station B to station A."

[0073] In one possible implementation, determining the direction information corresponding to the target route based on the direction type of the target route includes:

[0074] When the direction type corresponding to the directional semantic element is a single-line direction, the direction of the target route is determined based on the semantic attributes of the keyword and the relevant information of the target route.

[0075] Understandably, if the direction type corresponding to the target route is one-way, it is necessary to determine which of the two preset route directions of the public transportation routes corresponding to the target route is the target route from the two preset route directions stored in the public transportation information database.

[0076] For example, the semantic attributes corresponding to the keywords are used to indicate the preset type corresponding to the semantics represented by the keywords. The semantic attributes of the keywords can be determined by matching the keywords with preset keywords based on different preset semantic attributes. The semantic attributes corresponding to the keywords may include at least one of station information, area information, location information, and point of interest information. The relevant information corresponding to the target route may include at least one of the preset station name information corresponding to the target route, the preset area information corresponding to the target route, and the preset station coordinates corresponding to the origin and destination stations of the target route in different driving directions.

[0077] In one possible implementation, the semantic attributes include station information. Determining the route direction corresponding to the target route based on the semantic attributes corresponding to the keywords may specifically include the following steps:

[0078] If the semantic attributes of the keyword include station information, retrieve the preset station name information corresponding to the target route from the public transportation information database; match the station names included in the station information with the preset station name information corresponding to the target route; if the match is successful, determine the route direction corresponding to the target route based on the matched preset station name information.

[0079] Understandably, any matching method can be used to match the station name included in the station information with the preset station name information corresponding to the target line. For example, the matching result can be determined by calculating semantic similarity. Specifically, if the semantic similarity between the station name and the preset station name information meets a threshold condition, the match is successful; otherwise, if the semantic similarity does not meet the threshold condition, the match fails.

[0080] For example, the preset station name information corresponding to the target route specifically includes the names of the preset originating stations and the preset destination stations for different travel directions of the target route. For instance, in the first travel direction, the preset originating station is named "Station A" and the preset destination station is named "Station B," meaning the first travel direction is "from Station A to Station B." Similarly, in the second travel direction, the preset originating station is named "Station B" and the preset destination station is named "Station A," meaning the second travel direction is "from Station B to Station A." The station information may specifically include the preset destination station name of the public transportation line involved in the keyword, or it may include both the preset originating station name and the preset destination station name of the public transportation line involved in the keyword.

[0081] In one example, the directional semantic element is "towards station xx (i.e., the final station)," where the keyword corresponds to the station information "station xx." If the matching result shows that "station xx" matches "station A," then the direction of the target route can be determined as "from station B to station A." If the matching result shows that "station xx" matches "station B," then the direction of the target route can be determined as "from station A to station B."

[0082] In another example, the directional semantic element is "from station xx (originating station) to station yy (terminal station)," where the keywords correspond to the station information "station xx" and "station yy." If the matching result is "station xx" matching "station A" and / or "station yy" matching "station B," then the direction of the target route can be determined as "from station A to station B." If the matching result is "station xx" matching "station B" and / or "station yy" matching "station A," then the direction of the target route can be determined as "from station B to station A."

[0083] Therefore, if the direction type of the target route's direction information is one-way, the specific driving direction of the target route can be determined based on the keywords used to characterize station name information contained in the direction semantic elements.

[0084] In one possible implementation, semantic attributes include regional information. Determining the route direction corresponding to the target route based on the semantic attributes corresponding to the keywords can specifically include the following steps:

[0085] If the semantic attributes of the keyword include regional information, the preset regional information corresponding to the target route is obtained from the public transportation information database; the regional information is matched with the preset regional information corresponding to the target route; if the match is successful, the route direction corresponding to the target route is determined based on the matched preset regional information.

[0086] It is understandable that any matching method can be used for matching between regional information and the preset regional information corresponding to the target line. For example, the matching success can be determined by calculating the semantic similarity between the two, and the matching result is considered successful if the semantic phase velocity meets the threshold condition.

[0087] For example, the regional information specifically includes information about the area where the terminal station and / or originating station of the public transportation line involved in the keyword is located. The preset regional information corresponding to the target line specifically includes information about the preset regions where the preset terminal station and / or preset originating station of the target line is located in different directions of travel. The preset regional information can be the name or location information of the region where the preset terminal station and / or preset originating station are located. The specific regions where the preset terminal station and preset originating station are located can be set according to the classification method of the preset regional type, such as including "urban area", "city area", "suburbs", "development zone", etc.

[0088] In one example, the directional semantic element is "heading towards xx district," containing the keyword "xx district," which represents the area where the destination of the target route is located. The preset area information corresponding to the target route specifically includes "urban area" for the destination in the first driving direction and "suburban area" for the destination in the second driving direction. If the matching result shows "xx district" matching "urban area," then the route direction corresponding to the target route can be determined to be the first driving direction. If the matching result shows "xx district" matching "suburban area," then the route direction corresponding to the target route can be determined to be the second driving direction.

[0089] Therefore, if the direction type of the target route's direction information is one-way, the specific driving direction of the target route can be determined based on the keywords contained in the direction semantic elements that represent the area information where the station is located.

[0090] In one possible implementation, the semantic attributes include location information. Determining the route direction corresponding to the target route based on the semantic attributes corresponding to the keywords can specifically include the following steps:

[0091] When the semantic attributes corresponding to the keywords include directional information, the preset station coordinates corresponding to the starting and ending stations of the target route in different driving directions are obtained from the public transportation information database; based on the preset station coordinates corresponding to the starting and ending stations of the target route in different driving directions, the preset azimuth angles corresponding to the target route in different driving directions are determined; the azimuth angles corresponding to the directional information are matched with the preset azimuth angles corresponding to the target route in different driving directions, and if the match is successful, the route direction corresponding to the target route is determined based on the matched preset azimuth angles.

[0092] In this embodiment, the location information may specifically include directional words corresponding to the travel direction of the public transportation line involved in the keyword, such as "east," "west," "south," "north," "southeast," "northeast," "southwest," and "northwest." The preset station coordinates corresponding to the starting and ending stations of the target line in different travel directions may specifically be the preset station coordinates of the starting and ending stations of the target line in the first travel direction, and the preset station coordinates of the starting and ending stations of the target line in the second travel direction.

[0093] For example, when matching the azimuth angle corresponding to the azimuth information with the preset azimuth angle corresponding to the target route in different driving directions, the matching success can be determined based on the ratio of the intersection and union of the azimuth angle and the preset azimuth angle. If the ratio meets the threshold condition, the matching result is determined to be a successful match.

[0094] For example, based on the preset station coordinates corresponding to the starting station and the ending station of the target route in the first travel direction, the azimuth angle from the starting station to the ending station can be determined, thus obtaining the first preset azimuth angle of the target route in the first travel direction. Similarly, based on the preset station coordinates corresponding to the starting station and the ending station of the target route in the second travel direction, the azimuth angle from the starting station to the ending station can be determined, thus obtaining the second preset azimuth angle of the target route in the second travel direction. It should be noted that the first and second preset azimuth angles can be specific values ​​or ranges, and this embodiment does not impose specific limitations on them. The first and second preset azimuth angles can be determined using a geodetic coordinate system (two-dimensional coordinate system).

[0095] For example, the azimuth angle corresponding to the keyword can be determined based on the directional word. The azimuth angle can also be determined using the Earth coordinate system (a two-dimensional coordinate system).

[0096] For example, when the direction word is "East", the azimuth is "0-90" and "270-360" degrees; when the direction word is "West", the azimuth is "90-270" degrees; when the direction word is "South", the azimuth is "180-360" degrees; and when the direction word is "North", the azimuth is "0-180" degrees.

[0097] It is understandable that if the matching result shows that the azimuth angle corresponding to the azimuth information matches the preset azimuth angle corresponding to the target route in a certain driving direction, then the driving direction corresponding to the matching preset azimuth angle can be determined as the route direction corresponding to the target route.

[0098] Therefore, when the direction type of the target route's direction information is one-way, the specific driving direction of the target route can be determined based on the keywords used to characterize the orientation information contained in the direction semantic elements.

[0099] In one possible implementation, the semantic attributes include point-of-interest (POI) information. Determining the route direction corresponding to the target route based on the semantic attributes corresponding to the keywords includes:

[0100] When the semantic attributes corresponding to the keywords include point-of-interest (POI) information, the preset station coordinates corresponding to the starting and ending stations of the target route in different driving directions are obtained from the public transportation information database; the coordinates of the POIs corresponding to the keywords are determined; based on the coordinates of the POIs and the preset station coordinates, the first distance between the POIs and the starting station and the second distance between the POIs and the ending station are determined; based on the comparison results of the first and second distances, the route direction corresponding to the target route is determined.

[0101] In the embodiments of this application, the directional semantic elements may involve information related to points of interest. For example, in the directional semantic element "heading towards xx airport", the keyword is "xx airport", and this keyword is used to represent a point of interest. As another example, in the directional semantic element "heading towards xx middle school", the keyword is "xx middle school", and this keyword is also used to represent a point of interest.

[0102] The preset station coordinates corresponding to the starting station and the ending station of the target route under different driving directions can be, specifically, the preset station coordinates corresponding to the starting station and the ending station of the target route under the first driving direction, and the preset station coordinates corresponding to the starting station and the ending station of the target route under the second driving direction.

[0103] For example, to determine the coordinates of the points of interest corresponding to the keyword, a pre-established database of points of interest can be used to identify preset points of interest that match the points of interest referred to by the keyword, and the coordinate information of the preset points of interest can be obtained from the database of points of interest, thereby obtaining the coordinates of the points of interest corresponding to the keyword.

[0104] For example, the directional semantic element is "direction to xx airport". Based on the coordinates of a first preset station corresponding to the destination of the target route in the first driving direction and the coordinates of a second preset station corresponding to the destination of the target route in the second driving direction, a first distance between the point of interest (PO) and the destination of the target route in the first driving direction can be calculated using the coordinates of the PO and the first preset station. Similarly, a second distance between the PO and the destination of the target route in the second driving direction can be calculated using the coordinates of the PO and the second preset station. If the first distance is less than the second distance, it indicates that the PO is closer to the destination of the target route in the first driving direction, thus determining the route direction of the target route as the first driving direction. If the second distance is less than the first distance, it indicates that the PO is closer to the destination of the target route in the second driving direction, thus determining the route direction of the target route as the second driving direction.

[0105] Therefore, when the direction type of the target route's direction information is one-way, the specific driving direction of the target route can be determined based on the keywords used to represent the point of interest information contained in the direction semantic elements.

[0106] In one possible implementation, step S101 may include the following steps:

[0107] Step S1011: Input the text data corresponding to the data object into the pre-trained text processing model;

[0108] Step S1012: Obtain the target semantic elements output by the text processing model.

[0109] In this embodiment, the text processing model can be trained using a pre-established language sample library for representing public transportation information. The trained text processing model can extract the semantic elements representing public transportation information contained in the input text data, thereby obtaining the target semantic elements.

[0110] It should be noted that in the embodiments of the present application, the text processing model can adopt any form of natural language processing model. Those skilled in the art can select any form of natural language processing model according to actual situations, as long as it can extract the target semantic elements for characterizing public transportation information from the text data corresponding to the data object. The embodiments of the present application do not make specific limitations on this.

[0111] The following refers to Figure 2 A specific example is used to describe the specific process of determining the line direction corresponding to the target line in the data processing method according to the embodiments of the present application.

[0112] As Figure 2 shown, the specific process of determining the line direction corresponding to the target line may include the following steps:

[0113] Step 1: Determine whether the direction type corresponding to the direction information of the target line is a two-way direction. Specifically, keywords can be extracted from the direction semantic elements, and by matching with the preset keywords used to indicate that the direction type is a two-way direction, when the keyword matches any of the preset keywords, it is determined that the direction type corresponding to the direction information of the target line is a two-way direction. On the contrary, when the keyword does not match any of the preset keywords, it is determined that the direction type corresponding to the direction information of the target line is a one-way direction, and the subsequent steps (2) to (5) are executed.

[0114] Step 2: Perform element processing on the direction semantic elements. Specifically, the elements can be segmented according to preset symbols to obtain sub-elements for characterizing direction information. For example, for "-" or "--", as well as Chinese characters such as "towards" and "to", the direction semantic elements can be segmented into multiple sub-elements.

[0115] Step 3: When the direction semantic elements include sub-elements for characterizing azimuth words, the preset azimuth angles corresponding to the target line in different driving directions are determined according to the starting and ending station coordinates included in the relevant information corresponding to the target line, and then they are matched with the azimuth angles corresponding to the azimuth words represented by the sub-elements. Finally, according to the matching result, the driving direction corresponding to the matched preset azimuth angle is determined as the line direction corresponding to the target line.

[0116] Step 4: When the direction semantic elements include sub-elements for characterizing the starting and ending station names, the preset name information that matches the sub-elements for characterizing the starting and ending station names is determined according to the preset name information corresponding to the starting and ending stations included in the relevant information corresponding to the target line, and the line direction of the target line is determined according to the matched preset name information.

[0117] Step 5: If the directional semantic elements include sub-elements representing regional information (e.g., urban or suburban areas), then based on the preset regional information corresponding to the stations contained in the relevant information of the target route, determine the preset regional information that matches the sub-elements representing the regional information. Based on the stations corresponding to the preset regional information, determine the route direction corresponding to the target route. Specifically, the preset regional information corresponding to the originating station and the terminal station can be determined based on the coordinates of the city center, district or county, and the distance between them and the first and last stations.

[0118] Step 6: If the directional semantic elements include sub-elements representing POIs (Points of Interest), then based on the preset station coordinates of the origin and destination stations of the target route in different driving directions, which are included in the relevant information corresponding to the target route, calculate the distance between the coordinates of the POI and the origin and destination stations in different driving directions. Select the nearest origin or destination station as the station corresponding to the sub-element, and determine the route direction corresponding to the target route accordingly. The coordinates of the points of interest can be obtained from a pre-established point of interest database by matching the sub-elements with preset point of interest names, thus obtaining the coordinates of the point of interest represented by the sub-elements.

[0119] Corresponding to the data processing method for extracting public transportation information provided in the embodiments of this application, the embodiments of this application also provide a data processing apparatus for extracting public transportation information. For example... Figure 3 The diagram shown is a structural block diagram of a data processing device for extracting public transportation information according to an embodiment of this application. The device may include:

[0120] The target semantic element extraction module 301 is used to extract target semantic elements from data objects related to public transportation; the target semantic elements are used to represent semantic information related to public transportation.

[0121] The target route information determination module 302 is used to determine the target route information that matches the target semantic elements from the public transportation information database based on the target semantic elements. The target route information includes at least one of the name information and direction information corresponding to the target route.

[0122] In one possible implementation, the target semantic elements include name semantic elements and direction semantic elements; the target route information determination module 302 includes:

[0123] The Name Information Determination Submodule is used to determine the name information corresponding to the target route that matches the name semantic elements from the public transportation information database.

[0124] The direction information determination submodule is used to determine the direction information corresponding to the target route based on the direction semantic elements and relevant information of the target route.

[0125] In one possible implementation, the name information determination submodule includes:

[0126] The candidate route determination unit is used to determine the name information corresponding to at least one candidate route that matches the route number from the public transportation information database based on the route number included in the name semantic elements.

[0127] The semantic similarity determination unit is used to determine the semantic similarity between the semantic elements of the name and the name information corresponding to each candidate line;

[0128] The target route determination unit is used to determine the name information corresponding to the target route from the name information corresponding to at least one candidate route based on semantic similarity.

[0129] In one possible implementation, the semantic similarity determination unit includes:

[0130] The text processing subunit is used to process the name semantic elements according to preset rules to obtain the formatted text corresponding to the name semantic elements.

[0131] The semantic similarity determination subunit is used to determine the semantic similarity between the formatted text and the name information corresponding to each candidate line.

[0132] In one possible implementation, the text processing subunit is used to implement at least one of the following:

[0133] Insert a preset character at the target character position in the name semantic element;

[0134] Remove irrelevant characters from the semantic elements of the name;

[0135] Differentiate and express the line types corresponding to the semantic elements of the name;

[0136] Convert the line number in the semantic elements of the name into a preset format;

[0137] Convert special symbols in the semantic elements of the name into separators.

[0138] In one possible implementation, the direction information determination submodule includes:

[0139] The keyword extraction unit is used to extract keywords from directional semantic elements;

[0140] The direction type determination unit is used to determine the direction type of the target route based on the keywords. The direction type includes single-line direction or double-line direction.

[0141] The route direction determination unit is used to determine the route direction corresponding to the target route based on the direction type of the target route.

[0142] In one possible implementation, the line direction determination unit is further configured to:

[0143] When the direction type corresponding to the directional semantic element is a single-line direction, the direction of the target route is determined based on the semantic attributes corresponding to the keywords.

[0144] In one possible implementation, the line direction determination unit is further configured to perform at least one of the following:

[0145] If the semantic attributes of the keyword include station information, retrieve the preset station name information corresponding to the target route from the public transportation information database; match the station names included in the station information with the preset station name information corresponding to the target route; if the match is successful, determine the route direction corresponding to the target route based on the matched preset station name information.

[0146] When the semantic attributes corresponding to the keywords include regional information, the preset regional information corresponding to the target route is obtained from the public transportation information database; the regional information is matched with the preset regional information corresponding to the target route; if the match is successful, the route direction corresponding to the target route is determined based on the matched preset regional information.

[0147] When the semantic attributes corresponding to the keywords include directional information, the preset station coordinates corresponding to the starting and ending stations of the target route in different driving directions are obtained from the public transportation information database; based on the preset station coordinates corresponding to the starting and ending stations of the target route in different driving directions, the preset azimuth angles corresponding to the target route in different driving directions are determined; the azimuth angles corresponding to the directional information are matched with the preset azimuth angles corresponding to the target route in different driving directions, and if the match is successful, the route direction corresponding to the target route is determined based on the matched preset azimuth angles.

[0148] In one possible implementation, the semantic attributes include point of interest information, and the route direction determination unit is further used for:

[0149] When the semantic attributes of the keywords include point of interest information, relevant information for the target route is obtained from the public transportation information database, including the preset station coordinates corresponding to the starting and ending stations of the target route in different driving directions.

[0150] Determine the coordinates of the points of interest corresponding to the keywords;

[0151] Based on the coordinates of the point of interest and the coordinates of the preset station, determine the first distance between the point of interest and the originating station, and the second distance between the point of interest and the destination station;

[0152] Based on the comparison results of the first distance and the second distance, the direction of the target route is determined.

[0153] In one possible implementation, the line direction determination unit is further configured to:

[0154] When the direction type corresponding to the direction semantic element is a two-way direction, the two preset route directions corresponding to the target route stored in the public transportation information database are determined as the route directions corresponding to the target route.

[0155] The functions of each module in the data processing apparatus of this application embodiment can be found in the corresponding description in the above method, and have corresponding beneficial effects, which will not be repeated here.

[0156] According to embodiments of this application, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0157] Figure 4 This is a block diagram of an electronic device used to implement embodiments of this application. For example... Figure 4 As shown, the electronic device includes a memory 401 and a processor 402. The memory 401 stores a computer program that can run on the processor 402. When the processor 402 executes the computer program, it implements the method described in the above embodiments. The number of memories 401 and processors 402 can be one or more.

[0158] The electronic device also includes:

[0159] Communication interface 403 is used to communicate with external devices and perform data exchange and transmission.

[0160] If the memory 401, processor 402, and communication interface 403 are implemented independently, they can be interconnected via a bus to communicate with each other. This bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. This bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 4 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0161] Optionally, in a specific implementation, if the memory 401, processor 402, and communication interface 403 are integrated on a single chip, then the memory 401, processor 402, and communication interface 403 can communicate with each other through an internal interface.

[0162] This application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method provided in this application.

[0163] This application also provides a chip, which includes a processor for calling and executing instructions stored in a memory, causing a communication device on which the chip is installed to perform the method provided in this application.

[0164] This application also provides a chip, including: an input interface, an output interface, a processor, and a memory. The input interface, output interface, processor, and memory are connected through an internal connection path. The processor is used to execute code in the memory. When the code is executed, the processor is used to execute the method provided in the application embodiment.

[0165] It should be understood that the aforementioned processor can be a Central Processing Unit (CPU), or other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate Arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. General-purpose processors can be microprocessors or any conventional processor. It is worth noting that the processor can be a processor supporting Advanced Reduced Instruction Set Machines (ARM) architecture.

[0166] Further, optionally, the aforementioned memory may include read-only memory and random access memory. The memory may be volatile memory or non-volatile memory, or may include both. Non-volatile memory may include read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory may include random access memory (RAM), which serves as an external cache. Many forms of RAM are available by way of example, but not limitation. Examples include Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), Synchronous Link Dynamic Random Access Memory (SLDRAM), and Direct Rambus RAM (DR RAM).

[0167] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions according to this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another.

[0168] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of those different embodiments or examples.

[0169] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "a plurality of" means two or more, unless otherwise explicitly specified.

[0170] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process. Furthermore, the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functionality involved.

[0171] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus or device (such as a computer-based system, a processor-included system or other system that can fetch and execute instructions from, an instruction execution system, apparatus or device).

[0172] It should be understood that various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. All or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware, the program being stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiments.

[0173] Furthermore, the functional units in the various embodiments of this application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. This storage medium can be a read-only memory, a disk, or an optical disk, etc.

[0174] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various variations or substitutions within the technical scope disclosed in this application, and these should all be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A data processing method for extracting public transportation information, comprising: Extract target semantic elements from data objects related to public transportation. The target semantic elements are used to represent semantic information related to public transportation. The target semantic elements include name semantic elements and direction semantic elements. Based on the route number included in the name semantic element, determine the name information corresponding to at least one candidate route that matches the route number from the public transportation information database; determine the semantic similarity between the name semantic element and the name information corresponding to each candidate route; and determine the name information corresponding to the target route from the name information corresponding to the at least one candidate route based on the semantic similarity. Based on the directional semantic elements, determine the directional information corresponding to the target route.

2. The method according to claim 1, wherein, Determining the semantic similarity between the name semantic elements and the name information corresponding to each candidate line includes: The name semantic elements are processed according to preset rules to obtain the formatted text corresponding to the name semantic elements; Determine the semantic similarity between the formatted text and the name information corresponding to each candidate line.

3. The method according to claim 2, wherein, The semantic elements of the name are processed according to preset rules, including at least one of the following: Insert a preset character at the target character position in the name semantic element; Remove irrelevant characters from the semantic elements of the name; The line types corresponding to the semantic elements of the names are expressed in a differentiated manner; Convert the line number in the semantic elements of the name into a preset format; Convert the special symbols in the semantic elements of the name into separator symbols.

4. The method according to claim 1, wherein, Based on the directional semantic elements, the directional information corresponding to the target route is determined, including: Extract keywords from the directional semantic elements; The direction type corresponding to the target route is determined based on the keywords, and the direction type includes a one-way direction or a two-way direction. Based on the direction type corresponding to the target route, determine the direction information corresponding to the target route.

5. The method according to claim 4, wherein, Based on the direction type corresponding to the target route, the direction information corresponding to the target route is determined, including: If the direction type corresponding to the directional semantic element is a single-line direction, the route direction corresponding to the target route is determined based on the semantic attribute corresponding to the keyword.

6. The method according to claim 5, wherein, Based on the semantic attributes corresponding to the keywords, the route direction corresponding to the target route is determined, including at least one of the following: If the semantic attribute corresponding to the keyword includes station information, the preset station name information corresponding to the target route is obtained from the public transportation information database; the station names included in the station information are matched with the preset station name information corresponding to the target route; if the match is successful, the route direction corresponding to the target route is determined based on the matched preset station name information. If the semantic attribute corresponding to the keyword includes regional information, the preset regional information corresponding to the target route is obtained from the public transportation information database; The area information is matched with the preset area information corresponding to the target route. If the match is successful, the route direction corresponding to the target route is determined based on the matched preset area information. When the semantic attributes corresponding to the keyword include directional information, the preset station coordinates corresponding to the starting station and the terminal station of the target route in different driving directions are obtained from the public transportation information database; based on the preset station coordinates corresponding to the starting station and the terminal station of the target route in different driving directions, the preset azimuth angles corresponding to the target route in different driving directions are determined. The azimuth angle corresponding to the azimuth information is matched with the preset azimuth angle corresponding to the target route under different driving directions. If the match is successful, the route direction corresponding to the target route is determined according to the matched preset azimuth angle.

7. The method according to claim 5, wherein, The semantic attributes include point-of-interest information; based on the semantic attributes corresponding to the keywords, the route direction corresponding to the target route is determined, including: When the semantic attribute corresponding to the keyword includes point of interest information, relevant information corresponding to the target route is obtained from the public transportation information database, including the preset station coordinates corresponding to the starting station and the terminal station of the target route under different driving directions. Determine the coordinates of the points of interest corresponding to the keywords; Based on the coordinates of the point of interest and the coordinates of the preset station, determine the first distance between the point of interest and the originating station and the second distance between the point of interest and the destination station; Based on the comparison results of the first distance and the second distance, the direction of the target route is determined.

8. The method according to claim 1, wherein, Based on the direction type corresponding to the target route, the direction information corresponding to the target route is determined, including: When the direction type corresponding to the directional semantic element is a two-way direction, the two preset route directions corresponding to the target route stored in the public transportation information database are determined as the route directions corresponding to the target route.

9. A data processing device for extracting public transportation information, comprising: The target semantic element extraction module is used to extract target semantic elements from data objects related to public transportation; The target semantic elements are used to represent semantic information related to public transportation, wherein the target semantic elements include name semantic elements and direction semantic elements; The target route information determination module is used to determine the name information corresponding to at least one candidate route that matches the route number from the public transportation information database based on the route number included in the name semantic element; determine the semantic similarity between the name semantic element and the name information corresponding to each candidate route; determine the name information corresponding to the target route from the name information corresponding to the at least one candidate route based on the semantic similarity; and determine the direction information corresponding to the target route based on the direction semantic element.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory, wherein the processor, when executing the computer program, implements the method of any one of claims 1 to 8.

11. A computer-readable storage medium storing a computer program that, when executed by a processor, implements the method of any one of claims 1 to 8.