Natural language place name query method, device and electronic equipment

Through the improved DeBERTa model and knowledge graph method, the place name semantic context knowledge base is constructed, and the natural language space-time question is analyzed, which solves the problem that place name query cannot pay attention to the user query IP context in the existing technology, and achieves more accurate and efficient place name query.

CN120011525BActive Publication Date: 2025-08-22CHINA UNIV OF GEOSCIENCES (BEIJING) +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510489203.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-18
Publication Date
2025-08-22
Estimated Expiration
2045-04-18

AI Technical Summary

Technical Problem

The existing natural language place name query methods cannot accurately focus on the IP context of user query, resulting in the inability to provide place name consultation services rich in spatiotemporal semantics, reducing user satisfaction.

Method used

The improved DeBERTa model is used to analyze natural language space-time questions by combining the deep learning model of the BiGRU layer and the CRF layer, and combine knowledge graph to build a place name semantic context knowledge base, and query the space-time question information through the place name context knowledge base to obtain the place name query results.

Benefits of technology

It improves the accuracy and query efficiency of place name query, meets users' semantic needs, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120011525B_ABST
    Figure CN120011525B_ABST
Patent Text Reader

Abstract

The embodiments of this specification disclose a natural language place name query method, device, and electronic device. The method includes extracting place name feature words from parsed text semantic information, fusing the extracted place name data context with the place name context information corresponding to the user's query IP address into place name context information, further integrating the text semantic information and place name context information into spatiotemporal question information, and constructing a place name semantic context knowledge base covering potential place name context information and rich place name semantic relationships for querying spatiotemporal question information. This enables the server to more accurately identify the potential place name semantic context behind the target natural language spatiotemporal question, ensuring that the place name query optimization results are more in line with user needs, meeting semantic requirements while significantly improving query execution efficiency and user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] One or more embodiments of the present specification relate to the field of natural language query technology, and in particular, to a natural language place name query method, device, and electronic device. Background Art

[0002] The explosive growth of information resources, coupled with their massive volume and complex data organization, presents significant challenges to place name information retrieval. Geographic and temporal information is often provided in the form of unstructured text, making information retrieval tasks more complex and indirect. Therefore, a user-oriented place name query method is needed that analyzes the natural question language provided by users and extracts the geographic information implicit in the semantics. However, existing query methods can only focus on queries at the semantic level of place names, and fail to address the user query IP context in natural question language. Consequently, they are unable to accurately meet the needs of real-world natural language place name queries, resulting in an inability to accurately provide place name consultation services rich in spatiotemporal semantics, reducing user satisfaction. Summary of the Invention

[0003] The embodiments of this specification provide a natural language place name query method, device, and electronic device, and the technical solutions thereof are as follows:

[0004] In a first aspect, an embodiment of this specification provides a natural language place name query method, the method comprising:

[0005] Parsing spatiotemporal question information corresponding to a target natural language spatiotemporal question based on a trained deep learning model, wherein the trained deep learning model is an improved DeBERTa model, obtained by adding a BiGRU layer and a CRF layer to the DeBERTa model; the target natural language spatiotemporal question is obtained by obtaining a query instruction; the spatiotemporal question information includes text semantic information and place name context information;

[0006] Constructing a place name semantic context knowledge base corresponding to preset place information according to the knowledge graph method, wherein the preset place information includes place common name information, place type information and place scale information, and the place scale information includes the spatial scale information and administrative level information of the place;

[0007] The spatiotemporal question information is queried based on the place name semantic context knowledge base to obtain a place name query result corresponding to the target natural language spatiotemporal question.

[0008] In a second aspect, a natural language place name query device is provided, the device comprising:

[0009] A parsing module is configured to parse the spatiotemporal question information corresponding to the target natural language spatiotemporal question based on a trained deep learning model, wherein the trained deep learning model is an improved DeBERTa model, which is obtained by adding a BiGRU layer and a CRF layer to the DeBERTa model. The target natural language spatiotemporal question is obtained by obtaining a query instruction, and the spatiotemporal question information includes text semantic information and place name context information;

[0010] A construction module is used to construct a place name semantic context knowledge base corresponding to preset place information based on a knowledge graph method, wherein the preset place information includes place common name information, place type information, and place scale information, wherein the place scale information includes spatial scale information and administrative level information of the place;

[0011] The query module is used to query the spatiotemporal question information based on the place name semantic context knowledge base to obtain a place name query result corresponding to the target natural language spatiotemporal question.

[0012] In a third aspect, an electronic device is provided, including a device processor and a memory;

[0013] The device processor is connected to the memory;

[0014] The memory is used to store executable program code;

[0015] The device processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to execute the steps of the method provided in the first aspect or any possible implementation manner of the first aspect.

[0016] In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored, and the computer-readable storage medium stores instructions. When the instructions are executed on a computer or device processor, the computer or device processor executes the method provided in the first aspect or any possible implementation of the first aspect.

[0017] The beneficial effects of the technical solutions provided by some embodiments of this specification include at least:

[0018] In one or more embodiments of the present specification, the spatiotemporal question information corresponding to the target natural language spatiotemporal question is first parsed based on a trained deep learning model, and then a place name semantic context knowledge base corresponding to the preset location information is constructed according to the knowledge graph method. The spatiotemporal question information is further queried based on the place name semantic context knowledge base, and finally the place name query result corresponding to the target natural language spatiotemporal question is obtained. The place name feature words are extracted from the parsed text semantic information, and the extracted place name data context and the place name context information corresponding to the user query IP address are fused into place name context information. The text semantic information and the place name context information are further integrated into spatiotemporal question information, and a place name semantic context knowledge base covering potential place name context information and rich place name semantic relationships is constructed for querying spatiotemporal question information. This enables the server to more accurately identify the potential place name semantic context behind the target natural language spatiotemporal question, ensuring that the place name query optimization result is more in line with user needs, meeting semantic needs while significantly improving query execution efficiency and user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0020] Figure 1 A flowchart of a natural language place name query method provided in an embodiment of this specification;

[0021] Figure 2 A schematic diagram of the construction process of a place name semantic context knowledge base provided in an embodiment of this specification;

[0022] Figure 3 A schematic diagram of the structure of a natural language place name query device provided in an embodiment of this specification;

[0023] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this specification. DETAILED DESCRIPTION

[0024] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application.

[0025] Throughout this specification, the claims, and the accompanying drawings, the terms "first," "second," "third," and the like are used to distinguish between different items, not to describe a particular order. Furthermore, the terms "including," "having," and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or elements is not limited to the listed steps or elements but may optionally include steps or elements not listed, or may include other steps or elements inherent to the process, method, product, or apparatus.

[0026] The following description provides examples and does not limit the scope, applicability, or examples set forth in the claims. Changes may be made to the functions and arrangements of the elements described without departing from the scope of this specification. Various examples may appropriately omit, replace, or add various processes or components. For example, the described methods may be performed in an order different from the order described, and various steps may be added, omitted, or combined. Furthermore, features described with respect to some examples may be combined in other examples.

[0027] See also Figure 1 , Figure 1 The figure shows an overall flow chart of a natural language place name query method provided by an embodiment of this specification.

[0028] like Figure 1 As shown, the natural language place name query method may at least include the following steps:

[0029] Step 101: parse the spatiotemporal question information corresponding to the target natural language spatiotemporal question based on the trained deep learning model.

[0030] Among them, the trained deep learning model is an improved DeBERTa model, which is obtained by adding a BiGRU layer and a CRF layer after the DeBERTa model. The target natural language spatiotemporal question is obtained by obtaining a query instruction, and the spatiotemporal question information includes text semantic information and place name context information.

[0031] In an embodiment of the present specification, after receiving a query instruction sent by a target user terminal, the server can obtain the target natural language spatiotemporal question through the query instruction. In general, the target natural language spatiotemporal question contains important information closely related to the place name, place name attributes, spatiotemporal relationships, numbers and units, etc. Therefore, in order to understand the query intention of the target user and enable the computer to directly understand and process the query request, the target natural language spatiotemporal question can be parsed through a trained deep learning model to obtain text semantic information and place name context information, and express it as spatiotemporal question information. Through the above process, the target natural language spatiotemporal question in an unstructured format can be parsed and converted into structured data that can be used for direct computer recognition and processing, so as to facilitate subsequent further place name queries.

[0032] Among them, the trained deep learning model adopts the improved DeBERTa model, that is, the BiGRU network layer is connected after the DeBERTa model to obtain more contextual semantic features, and then the CRF layer is introduced after the BiGRU network to obtain the label sequence, so as to better understand the semantic relationship between different words in the sentence, capture long-distance dependencies and resolve ambiguity.

[0033] In one possible implementation, parsing the spatiotemporal question information corresponding to the target natural language spatiotemporal question based on the trained deep learning model includes:

[0034] Parse the text semantic information corresponding to the target natural language spatiotemporal question based on the trained deep learning model;

[0035] Determining a place name data context corresponding to the text semantic information and a user query context corresponding to the query address information, respectively, to obtain place name context information composed of the place name data context and the user query context, wherein the place name data context is used to represent the place name information contained in the text semantic information;

[0036] The text semantic information and the place name context information are integrated to obtain spatiotemporal question information.

[0037] In the embodiments of this specification, when parsing the spatiotemporal question information corresponding to the target natural language spatiotemporal question through a trained deep learning model, the target natural language spatiotemporal question can be first taken as input and transmitted to the trained deep learning model, and the text semantic information corresponding to the target natural language spatiotemporal question can be obtained through its model output.

[0038] As an example, the target natural language spatiotemporal question is "What cities are within a radius of 500 kilometers around Beijing?", and the text semantic information output by the model is "Location: Beijing, Distance: 500 kilometers, Event: City".

[0039] Next, because place names themselves have obvious contextual relevance, the geographic spatiotemporal semantics expressed by the same place name in different contexts can differ. Therefore, geographic key feature word extraction can be used to determine the place name data context corresponding to the textual semantic information. As an example, the model outputs the textual semantic information "Location: Beijing, Distance: 500 km, Event: City." Through geographic key feature word extraction, the place name data context corresponding to the geographic key feature word is obtained: "Beijing." Next, the corresponding user query context is determined by querying the IP address information, further deriving the place name context information composed of the two. Finally, the obtained textual semantic information and place name context information are integrated to obtain spatiotemporal question information.

[0040] In one possible implementation, parsing text semantic information corresponding to a target natural language spatiotemporal question based on a trained deep learning model includes:

[0041] Constructing an initial DeBERTa-BiGRU-CRF model, and training the DeBERTa-BiGRU-CRF model based on a training label dataset to obtain a trained DeBERTa-BiGRU-CRF model;

[0042] The text semantic information corresponding to the target natural language spatiotemporal question is parsed based on the trained DeBERTa-BiGRU-CRF model.

[0043] In the embodiments of this specification, to parse the textual semantic information corresponding to the target natural language spatiotemporal question, an initial DeBERTa-BiGRU-CRF model can be constructed. Specifically, the DeBERTa model is first connected after the data embedding layer, and then the BiGRU network layer is connected after the DeBERTa model, and further a CRF layer is introduced after the BiGRU network.

[0044] The embedding layer converts discrete text data into continuous, low-dimensional vector representations. Input text , the embedding layer will generate Learn a corresponding embedding vector, corresponding to the output vector ,in Is the corresponding word These embedding vectors are used as input to subsequent layers.

[0045] The DeBERTa model is an improvement on the BERT model. It uses word embedding training to capture the deep semantic features of natural semantic place name spatiotemporal questions and converts text into word vectors. The formula for calculating the decoupled attention input representation of the DeBERTa model is as follows:

[0046]

[0047] in, 、 represents the content embedding of the i-th and j-th words, Represents the relative position embedding of word i and word j, represents content-to-content computation, and Represents the calculation of content to position and position to content, Represents position-to-position calculations.

[0048] The BiGRU layer is built on top of two unidirectional GRUs, each operating in opposite directions. In a unidirectional GRU network structure, state information is transmitted in one direction, for example, a left-to-right GRU can only learn information from the previous moment. However, the output of the BiGRU network layer is determined by both GRUs, allowing it to learn information from both the previous and next moments. Because the semantic information of a sentence is related to both the preceding and following contexts, the BiGRU network layer is used to further capture comprehensive contextual information.

[0049] Furthermore, the CRF layer introduced after the BiGRU network layer effectively models label dependencies and ensures that the generated label sequence is coherent and reasonable. The goal of this layer is to identify geographic entities in natural language questions and annotate the extracted word vectors using the BIOES format, where B represents the first word in the annotated sequence, I represents the remaining words in the middle, E represents the last word, S represents a single word, and O represents irrelevant information.

[0050] For example, the target natural language spatiotemporal question is "What cities are within a 500-kilometer radius of Beijing?" The model outputs the textual semantic information "Location: Beijing, Distance: 500 kilometers, Event: City." The BiGRU network layer extracts and annotates the geographic entities and relationships in the vector. The following are extracted and annotated: Beijing, city, surrounding, 500 kilometers, and radius. City and Beijing are the first words of the geographic entities, while surrounding, radius, and 500 kilometers represent the distance and buffer zone relationships.

[0051] Next, after constructing the initial DeBERTa-BiGRU-CRF model, the model is trained based on the labeled training dataset, resulting in a trained DeBERTa-BiGRU-CRF model. The labeled training dataset includes labeled natural language spatiotemporal questions. Finally, the labeled natural language spatiotemporal questions are input into the trained DeBERTa-BiGRU-CRF model to obtain the corresponding textual semantic information.

[0052] In one possible implementation, the training of the DeBERTa-BiGRU-CRF model based on the training label dataset to obtain a trained DeBERTa-BiGRU-CRF model includes:

[0053] Based on the DeBERTa model, we obtain the deep semantic features corresponding to each training natural language spatiotemporal question and obtain the training word vector.

[0054] Determine the training label sequence corresponding to each of the training word vectors based on the BiGRU network and the CRF layer;

[0055] The DeBERTa-BiGRU-CRF model is trained based on the training label data set composed of each training label sequence to obtain a trained DeBERTa-BiGRU-CRF model.

[0056] In the embodiments of the present specification, when the DeBERTa-BiGRU-CRF model is trained using a training label data set, a plurality of training natural language spatiotemporal questions can be obtained in advance, and then the deep semantic features corresponding to each training natural language spatiotemporal question are obtained according to the DeBERTa model to obtain each training word vector. Then, each training word vector is passed through the BiGRU network and the CRF layer in turn to determine the training label sequence corresponding to each training word vector, and further, each training label sequence is paired with each training natural language spatiotemporal question to obtain a training label data set. Finally, the obtained training label data set is compared with the label data set that has been manually calibrated in advance, and the DeBERTa-BiGRU-CRF model is continuously trained according to the comparison results, and the parameters of each model are adjusted to obtain a trained DeBERTa-BiGRU-CRF model.

[0057] In one possible implementation, before parsing the spatiotemporal question information corresponding to the target natural language spatiotemporal question based on the trained deep learning model, the method further includes:

[0058] Analyze the target natural language spatiotemporal question based on natural language processing technology to obtain target keywords;

[0059] Based on the semantic matching method, the target keyword is searched in the preset place name database to obtain the query place name category and the query place name context;

[0060] Expanding the target natural language spatiotemporal question sentence according to the query place name category and the query place name context to obtain a target expanded query sentence;

[0061] The spatiotemporal question information corresponding to the target natural language spatiotemporal question is parsed based on the trained deep learning model:

[0062] The spatiotemporal question information corresponding to the target extended query sentence is parsed based on the trained deep learning model.

[0063] In embodiments of this specification, to address the information deficiency and semantic ambiguity of the target natural language spatiotemporal question in a user query, for example, when a user enters "attractions near Beijing," the system needs to expand "near Beijing" to a specific spatial range and map "attractions" to relevant categories and database layers (such as "tourist attractions"). Furthermore, to help the server understand synonyms, near-synonyms, and semantic associations to accommodate diverse user expressions, query expansion can be performed on the target natural language spatiotemporal question before deep learning model parsing. Natural language processing techniques can be used to parse the target natural language spatiotemporal question to obtain preliminary semantic representations of target keywords. For example, for "What hospitals are there in Beijing?", the parsed target keywords include "location: Beijing," "question word: which," and "location type: hospital." Next, semantic matching is used to query the parsed target keywords against a pre-set place name database to obtain the query place name category. This means that any ambiguous descriptions (such as "nearby") that may appear in the query are contextually supplemented by combining the scale information and rules in the pre-set place name database. For example, "nearby" can be expanded to a specific spatial radius range based on the scale or category of the place name, and the place name disambiguation can be performed based on the user's IP address, geographic coordinates and other information, combined with the place name category and query intent, to obtain the query place name context. Furthermore, the target natural language spatiotemporal question is expanded based on the obtained query place name category and query place name context to generate a more complete query expression, namely the target expanded query question. As an example, for "What are the hotels near XX Square", the place name "XX Square" is extracted and mapped to the type, "hotel" is expanded to "hotel, guesthouse, guesthouse", and "nearby" is quantified as a specific spatial range. When subsequently parsing the spatiotemporal question information corresponding to the target natural language spatiotemporal question, the target expanded query question is directly parsed to obtain the spatiotemporal question information, thereby improving the query speed, expanding the query scope, and returning more accurate query results.

[0064] Step 102: Construct a place name semantic context knowledge base corresponding to the preset location information based on the knowledge graph method.

[0065] The preset location information includes location common name information, location type information and location scale information.

[0066] In the embodiments of this specification, since place names themselves often have significant contextual relevance, the geographic spatiotemporal semantics expressed by the same place name in different contexts may differ. In specific contexts, place names can more accurately refer to geographic spatial entities and their locations. Therefore, to consider the contextual information and user intent of the target natural language spatiotemporal question and improve query accuracy and efficiency, a knowledge graph approach can be utilized to construct a place name semantic context knowledge base based on the information of each preset location, encompassing the potential contextual information of place names and enriching their semantic relationships.

[0067] Specifically, the preset location information includes common location name information, location type information, and location scale information. Common location name information refers to the common name of a location, typically a general description of the location without a specific proper name. This type of information is typically used to refer to a category of locations rather than a specific location. Examples include "city," "village," "mountain," and "river."

[0068] Among them, the place type information included refers to the classification information of the place, which is classified according to the function, purpose, nature or other standards of the place. It is usually used to describe the specific attributes of the place and classify the place according to certain standards, such as business, education, transportation, etc. The place type information describes the specific type or nature of the place and can be used to provide more details about the place. For example, "shopping center" represents a commercial area mainly for shopping, and "university" represents an institution that provides higher education and research.

[0069] Among them, the place scale information included refers to the size, scope or hierarchy of the place, which is usually used to describe the spatial scale or administrative level of the place. For example, it describes the spatial range occupied by the place, such as "large", "medium", and "small", and describes the hierarchy of the place in the administrative system, such as "national", "provincial", "municipal", and "county". Place scale information can reflect the hierarchical relationship and inclusion relationship between places.

[0070] Therefore, in the constructed place name semantic context knowledge base, each spatiotemporal question information corresponds one-to-one to a set of place name query results.

[0071] In one possible implementation, the construction of a place name semantic context knowledge base corresponding to the preset location information based on the knowledge graph method includes:

[0072] Determine the place name context semantic ontology and place name context semantic attributes based on the preset place information;

[0073] A place name semantic context knowledge base corresponding to the place name context semantic ontology and the place name context semantic attributes is constructed according to the knowledge graph method.

[0074] In the embodiments of this specification, when constructing a place name semantic context knowledge base according to the knowledge graph method, the place name context semantic ontology can be first determined based on the preset location information. Among them, the place name context semantic ontology is the basic concept unit in the knowledge graph, which can represent a specific entity or concept. Then, the place name context semantic attributes are determined based on the preset location information. Among them, the place name context semantic attributes describe the characteristics or attributes of the ontology, and associate attributes such as the common name information of the place, the type information of the place, and the scale information of the place with the corresponding ontology.

[0075] Further, such as Figure 2 The construction process shown can construct a place name semantic context knowledge base based on the knowledge graph method in a top-down and bottom-up manner. The construction process includes knowledge representation (data acquisition, entity extraction), ontology construction (relationship extraction, attribute extraction), knowledge graph fusion and knowledge storage.

[0076] Step 103: query the spatiotemporal question information based on the place name semantic context knowledge base to obtain a place name query result corresponding to the target natural language spatiotemporal question.

[0077] In the embodiments of this specification, since each spatiotemporal question information in the constructed place name semantic context knowledge base corresponds one-to-one to a set of place name query results, the parsed spatiotemporal question information can be directly input into the place name semantic context knowledge base to obtain the place name query results corresponding to the target natural language spatiotemporal question.

[0078] In one possible implementation, after querying the spatiotemporal question information based on the place name semantic context knowledge base to obtain a place name query result corresponding to the target natural language spatiotemporal question, the method further includes:

[0079] Determine the target address corresponding to each target place name in the place name query result;

[0080] The place name query results are reordered based on the distances between the target addresses and the query address to obtain a place name query optimization result.

[0081] In the embodiment of this specification, after obtaining the place name query result corresponding to the target natural language spatiotemporal question through the place name semantic context knowledge base, since the place name query result may include multiple target place names, the target address corresponding to each target place name in the place name query result can be determined first. Then, the distance between each target address and the query IP address is determined. Furthermore, the sorting priority of each target place name in the place name query result is adjusted from near to far according to the distance, and then the place name query result is re-sorted to obtain the place name query optimization result, so as to ensure that the place name query optimization result is more in line with user needs, meets semantic needs, and significantly improves the query execution efficiency and user experience.

[0082] The foregoing description of this specification describes specific embodiments. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that described in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order shown or the sequential order to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0083] See next Figure 3 , Figure 3 The following is a schematic diagram showing the structure of a natural language place name query device provided by an embodiment of this specification. Figure 3 The natural language place name query device shown is used to execute this application Figure 1 For the convenience of explanation, only the part related to the embodiment of the present application is shown. For the specific technical details not disclosed, please refer to the present application. Figure 1 The embodiment shown.

[0084] like Figure 3 As shown, the natural language place name query device may at least include:

[0085] Parsing module 301 is used to parse spatiotemporal question information corresponding to a target natural language spatiotemporal question based on a trained deep learning model, wherein the trained deep learning model is an improved DeBERTa model obtained by adding a BiGRU layer and a CRF layer to the DeBERTa model. The target natural language spatiotemporal question is obtained by obtaining a query instruction, and the spatiotemporal question information includes text semantic information and place name context information;

[0086] A construction module 302 is configured to construct a place name semantic context knowledge base corresponding to preset place information based on a knowledge graph method, wherein the preset place information includes place common name information, place type information, and place scale information, wherein the place scale information includes spatial scale information and administrative level information of the place;

[0087] The query module 303 is configured to query the spatiotemporal question information based on the place name semantic context knowledge base to obtain a place name query result corresponding to the target natural language spatiotemporal question.

[0088] In one embodiment, the parsing module 301 is specifically configured to:

[0089] Parse the text semantic information corresponding to the target natural language spatiotemporal question based on the trained deep learning model;

[0090] Determining a place name data context corresponding to the text semantic information and a user query context corresponding to the query address information, respectively, to obtain place name context information composed of the place name data context and the user query context, wherein the place name data context is used to represent the place name information contained in the text semantic information;

[0091] The text semantic information and the place name context information are integrated to obtain spatiotemporal question information.

[0092] In one embodiment, the parsing module 301 is further configured to:

[0093] Constructing an initial DeBERTa-BiGRU-CRF model, and training the DeBERTa-BiGRU-CRF model based on a training label dataset to obtain a trained DeBERTa-BiGRU-CRF model;

[0094] The text semantic information corresponding to the target natural language spatiotemporal question is parsed based on the trained DeBERTa-BiGRU-CRF model.

[0095] In one embodiment, the parsing module 301 is further configured to:

[0096] Based on the DeBERTa model, we obtain the deep semantic features corresponding to each training natural language spatiotemporal question and obtain the training word vector.

[0097] Determine the training label sequence corresponding to each of the training word vectors based on the BiGRU network and the CRF layer;

[0098] The DeBERTa-BiGRU-CRF model is trained based on the training label data set composed of each training label sequence to obtain a trained DeBERTa-BiGRU-CRF model.

[0099] In one embodiment, the parsing module 301 is further configured to:

[0100] Analyze the target natural language spatiotemporal question based on natural language processing technology to obtain target keywords;

[0101] Based on the semantic matching method, the target keyword is searched in the preset place name database to obtain the query place name category and the query place name context;

[0102] Expanding the target natural language spatiotemporal question sentence according to the query place name category and the query place name context to obtain a target expanded query sentence;

[0103] The spatiotemporal question information corresponding to the target natural language spatiotemporal question is parsed based on the trained deep learning model:

[0104] The spatiotemporal question information corresponding to the target extended query sentence is parsed based on the trained deep learning model.

[0105] In one embodiment, the construction module 302 is specifically configured to:

[0106] Determine the place name context semantic ontology and place name context semantic attributes based on the preset place information;

[0107] A place name semantic context knowledge base corresponding to the place name context semantic ontology and the place name context semantic attributes is constructed according to the knowledge graph method.

[0108] In one embodiment, the query module 303 is specifically configured to:

[0109] Determine the target address corresponding to each target place name in the place name query result;

[0110] The place name query results are reordered based on the distances between the target addresses and the query address to obtain a place name query optimization result.

[0111] Those skilled in the art will clearly understand that the technical solutions of the embodiments of the present application can be implemented with the help of software and / or hardware. "Unit" and "module" in this specification refer to software and / or hardware that can independently perform or cooperate with other components to perform specific functions, where the hardware can be, for example, a field-programmable gate array (FPGA) or an integrated circuit (IC).

[0112] Each processing unit and / or module in the embodiments of the present application may be implemented by an analog circuit that implements the functions described in the embodiments of the present application, or may be implemented by software that executes the functions described in the embodiments of the present application.

[0113] See next Figure 3 , Figure 3 A schematic structural diagram of an electronic device provided in an embodiment of this specification is shown.

[0114] See next Figure 4 , Figure 4 A schematic structural diagram of an electronic device provided in an embodiment of this specification is shown.

[0115] like Figure 4 As shown, the electronic device 400 may include: at least one device processor 401 , at least one network interface 404 , a user interface 403 , a memory 405 and at least one communication bus 402 .

[0116] The communication bus 402 may be used to implement connection and communication among the above components.

[0117] The user interface 403 may include buttons, and the optional user interface may also include a standard wired interface or a wireless interface.

[0118] The network interface 404 may include, but is not limited to, a Bluetooth module, an NFC module, a Wi-Fi module, and the like.

[0119] Among them, the device processor 401 may include one or more processing cores. The device processor 401 uses various interfaces and lines to connect the various parts of the entire electronic device 400, and executes various functions of the electronic device 400 and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 405, and calling data stored in the memory 405. Optionally, the device processor 401 can be implemented in at least one hardware form of DSP, FPGA, and PLA. The device processor 401 can integrate one or a combination of CPU, GPU, and modem. Among them, the CPU mainly processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; and the modem is used to handle wireless communications. It is understandable that the above-mentioned modem may not be integrated into the device processor 401, but may be implemented separately through a chip.

[0120] Among them, the memory 405 may include RAM and ROM. Optionally, the memory 405 includes a non-transitory computer-readable medium. The memory 405 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 405 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 405 may also be optionally at least one storage device located away from the aforementioned device processor 401. As Figure 4 As shown, the memory 405 as a computer storage medium may include an operating system, a network communication module, a user interface module, and program instructions.

[0121] Specifically, the device processor 401 may be configured to call a natural language place name query application stored in the memory 405 and perform the following operations:

[0122] Parsing spatiotemporal question information corresponding to a target natural language spatiotemporal question based on a trained deep learning model, wherein the trained deep learning model is an improved DeBERTa model, obtained by adding a BiGRU layer and a CRF layer to the DeBERTa model; the target natural language spatiotemporal question is obtained by obtaining a query instruction; the spatiotemporal question information includes text semantic information and place name context information;

[0123] Constructing a place name semantic context knowledge base corresponding to preset place information according to the knowledge graph method, wherein the preset place information includes place common name information, place type information and place scale information, and the place scale information includes the spatial scale information and administrative level information of the place;

[0124] The spatiotemporal question information is queried based on the place name semantic context knowledge base to obtain a place name query result corresponding to the target natural language spatiotemporal question.

[0125] As an optional embodiment of this specification, the parsing of the spatiotemporal question information corresponding to the target natural language spatiotemporal question based on the trained deep learning model includes:

[0126] Parse the text semantic information corresponding to the target natural language spatiotemporal question based on the trained deep learning model;

[0127] Determining a place name data context corresponding to the text semantic information and a user query context corresponding to the query address information, respectively, to obtain place name context information composed of the place name data context and the user query context, wherein the place name data context is used to represent the place name information contained in the text semantic information;

[0128] The text semantic information and the place name context information are integrated to obtain spatiotemporal question information.

[0129] As an optional embodiment of this specification, the parsing of text semantic information corresponding to the target natural language spatiotemporal question based on the trained deep learning model includes:

[0130] Constructing an initial DeBERTa-BiGRU-CRF model, and training the DeBERTa-BiGRU-CRF model based on a training label dataset to obtain a trained DeBERTa-BiGRU-CRF model;

[0131] The text semantic information corresponding to the target natural language spatiotemporal question is parsed based on the trained DeBERTa-BiGRU-CRF model.

[0132] As an optional embodiment of this specification, the DeBERTa-BiGRU-CRF model is trained based on the training label data set to obtain a trained DeBERTa-BiGRU-CRF model, including:

[0133] Based on the DeBERTa model, we obtain the deep semantic features corresponding to each training natural language spatiotemporal question and obtain the training word vector.

[0134] Determine the training label sequence corresponding to each of the training word vectors based on the BiGRU network and the CRF layer;

[0135] The DeBERTa-BiGRU-CRF model is trained based on the training label data set composed of each training label sequence to obtain a trained DeBERTa-BiGRU-CRF model.

[0136] As an optional embodiment of this specification, the construction of a place name semantic context knowledge base corresponding to the preset location information based on the knowledge graph method includes:

[0137] Determine the place name context semantic ontology and place name context semantic attributes based on the preset place information;

[0138] A place name semantic context knowledge base corresponding to the place name context semantic ontology and the place name context semantic attributes is constructed according to the knowledge graph method.

[0139] As an optional embodiment of this specification, before parsing the spatiotemporal question information corresponding to the target natural language spatiotemporal question based on the trained deep learning model, the method further includes:

[0140] Analyze the target natural language spatiotemporal question based on natural language processing technology to obtain target keywords;

[0141] Based on the semantic matching method, the target keyword is searched in the preset place name database to obtain the query place name category and the query place name context;

[0142] Expanding the target natural language spatiotemporal question sentence according to the query place name category and the query place name context to obtain a target expanded query sentence;

[0143] The spatiotemporal question information corresponding to the target natural language spatiotemporal question is parsed based on the trained deep learning model:

[0144] The spatiotemporal question information corresponding to the target extended query sentence is parsed based on the trained deep learning model.

[0145] As an optional embodiment of this specification, after querying the spatiotemporal question information based on the place name semantic context knowledge base to obtain the place name query result corresponding to the target natural language spatiotemporal question, the method further includes:

[0146] Determine the target address corresponding to each target place name in the place name query result;

[0147] The place name query results are reordered based on the distances between the target addresses and the query address to obtain a place name query optimization result.

[0148] The embodiments of this specification also provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above method. The computer-readable storage medium may include, but is not limited to, any type of disk, including a floppy disk, an optical disk, a DVD, a CD-ROM, a microdrive, a magneto-optical disk, a ROM, a RAM, an EPROM, an EEPROM, a DRAM, a VRAM, a flash memory device, a magnetic or optical card, a nanosystem (including a molecular memory IC), or any other type of medium or device suitable for storing instructions and / or data.

[0149] It should be noted that for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this application.

[0150] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0151] In the several embodiments provided in this application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some service interface, and the indirect coupling or communication connection of the device or unit can be electrical or other forms.

[0152] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0153] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0154] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a memory and includes a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned memory includes: U disk, read-only memory (ROM), random access memory (RAM), mobile hard disk, magnetic disk, or optical disk, etc., various media that can store program code.

[0155] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable memory, which may include a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc.

[0156] The foregoing description of this specification describes specific embodiments. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that described in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order shown or the sequential order to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

Claims

1. A natural language place name query method, characterized in that: The method comprises: Parsing spatiotemporal question information corresponding to a target natural language spatiotemporal question based on a trained deep learning model, wherein the trained deep learning model is an improved DeBERTa model, obtained by adding a BiGRU layer and a CRF layer to the DeBERTa model; the target natural language spatiotemporal question is obtained by obtaining a query instruction; the spatiotemporal question information includes text semantic information and place name context information; Constructing a place name semantic context knowledge base corresponding to preset place information according to the knowledge graph method, wherein the preset place information includes place common name information, place type information and place scale information, and the place scale information includes the spatial scale information and administrative level information of the place; Querying the spatiotemporal question information based on the place name semantic context knowledge base to obtain a place name query result corresponding to the target natural language spatiotemporal question; The step of parsing the spatiotemporal question information corresponding to the target natural language spatiotemporal question based on the trained deep learning model includes: Parse the text semantic information corresponding to the target natural language spatiotemporal question based on the trained deep learning model; Determining a place name data context corresponding to the text semantic information and a user query context corresponding to the query address information, respectively, to obtain place name context information composed of the place name data context and the user query context, wherein the place name data context is used to represent the place name information contained in the text semantic information; The text semantic information and the place name context information are integrated to obtain spatiotemporal question information.

2. The method according to claim 1, characterized in that The text semantic information corresponding to the target natural language spatiotemporal question is parsed based on the trained deep learning model, including: Constructing an initial DeBERTa-BiGRU-CRF model, and training the DeBERTa-BiGRU-CRF model based on a training label dataset to obtain a trained DeBERTa-BiGRU-CRF model; The text semantic information corresponding to the target natural language spatiotemporal question is parsed based on the trained DeBERTa-BiGRU-CRF model.

3. The method according to claim 2, characterized in that The DeBERTa-BiGRU-CRF model is trained based on the training label data set to obtain a trained DeBERTa-BiGRU-CRF model, including: Based on the DeBERTa model, we obtain the deep semantic features corresponding to each training natural language spatiotemporal question and obtain the training word vector. Determine the training label sequence corresponding to each of the training word vectors based on the BiGRU network and the CRF layer; The DeBERTa-BiGRU-CRF model is trained based on the training label data set composed of each training label sequence to obtain a trained DeBERTa-BiGRU-CRF model.

4. The method according to claim 1, wherein The method of constructing a place name semantic context knowledge base corresponding to the preset location information according to the knowledge graph method includes: Determine the place name context semantic ontology and place name context semantic attributes based on the preset place information; A place name semantic context knowledge base corresponding to the place name context semantic ontology and the place name context semantic attributes is constructed according to the knowledge graph method.

5. The method according to claim 1, wherein Before parsing the spatiotemporal question information corresponding to the target natural language spatiotemporal question based on the trained deep learning model, the method further includes: Analyze the target natural language spatiotemporal question based on natural language processing technology to obtain target keywords; Based on the semantic matching method, the target keyword is searched in the preset place name database to obtain the query place name category and the query place name context; Expanding the target natural language spatiotemporal question sentence according to the query place name category and the query place name context to obtain a target expanded query sentence; The spatiotemporal question information corresponding to the target natural language spatiotemporal question is parsed based on the trained deep learning model: The spatiotemporal question information corresponding to the target extended query sentence is parsed based on the trained deep learning model.

6. The method according to claim 1, characterized in that After querying the spatiotemporal question information based on the place name semantic context knowledge base to obtain the place name query result corresponding to the target natural language spatiotemporal question, the method further includes: Determine the target address corresponding to each target place name in the place name query result; The place name query results are reordered based on the distances between the target addresses and the query address to obtain a place name query optimization result.

7. A natural language place name query device, characterized in that: The device comprises: A parsing module is configured to parse the spatiotemporal question information corresponding to the target natural language spatiotemporal question based on a trained deep learning model, wherein the trained deep learning model is an improved DeBERTa model, which is obtained by adding a BiGRU layer and a CRF layer to the DeBERTa model. The target natural language spatiotemporal question is obtained by obtaining a query instruction, and the spatiotemporal question information includes text semantic information and place name context information; A construction module is used to construct a place name semantic context knowledge base corresponding to preset place information based on a knowledge graph method, wherein the preset place information includes place common name information, place type information, and place scale information, wherein the place scale information includes spatial scale information and administrative level information of the place; A query module, configured to query the spatiotemporal question information based on the place name semantic context knowledge base to obtain a place name query result corresponding to the target natural language spatiotemporal question; The parsing module is specifically used for: Parse the text semantic information corresponding to the target natural language spatiotemporal question based on the trained deep learning model; Determining a place name data context corresponding to the text semantic information and a user query context corresponding to the query address information, respectively, to obtain place name context information composed of the place name data context and the user query context, wherein the place name data context is used to represent the place name information contained in the text semantic information; The text semantic information and the place name context information are integrated to obtain spatiotemporal question information.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, wherein the computer-readable storage medium stores instructions, which, when the instructions are executed on a computer or a processor, cause the computer or processor to execute the steps of the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Chinese named entity recognition method based on BERT-BiGRU-CRF

    CN110083831A

  • Space-time question semantic understanding method and device, equipment and medium

    CN118734861A