Question and answer method, device and equipment based on urban mapping knowledge domain, medium and product

By using a question-answering method based on urban knowledge graphs and generating structured query statements through vector databases and inference paths, the problem of inaccurate intelligent question-answering results in existing technologies is solved, and highly adaptable and accurate question-answering feedback is achieved.

CN121579649APending Publication Date: 2026-02-27JINGDONG CITY BEIJING DIGITS TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202511812871.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-03
Publication Date
2026-02-27

AI Technical Summary

Technical Problem

Existing knowledge graphs cannot effectively perform multi-step iterative reasoning when dealing with city-related events, resulting in inaccurate intelligent question-answering results with poor user adaptability, and a lack of dynamic processing capabilities for time and space information.

Method used

The question-answering method based on urban knowledge graphs receives question description information, utilizes temporal and spatial information from vector databases and urban knowledge graphs to determine search and reasoning paths, generates structured query statements, and combines a large language model for question-answering feedback.

Benefits of technology

It improves the adaptability and accuracy of question-and-answer feedback, can handle complex urban events, meet the dynamic changes in time and space, and achieves high adaptability between intelligent question-and-answer results and users.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121579649A_ABST
    Figure CN121579649A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a question and answer method, device and equipment based on an urban knowledge graph, a medium and a product. The method comprises the steps that question description information input by a user is received; on the basis of a vector database corresponding to the urban knowledge graph, first question and answer feedback associated with the question description information is searched, and a description text corresponding to the event at least comprises time sequence information and space information; in response to an event that the first question and answer feedback does not meet a preset condition, determining at least one reasoning path based on the question description information and the urban knowledge graph; wherein the reasoning path comprises at least two associated entities and an edge connected with the at least two associated entities, and the edge is used for representing an entity relationship of the at least two associated entities; and based on the at least one reasoning path, determining a second question and answer feedback associated with the question description information and displaying the second question and answer feedback. According to the scheme provided by the embodiment of the invention, the accuracy and effectiveness of question answering are realized.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present application relate to the technical field of data processing, and in particular to a question and answer method and device based on a city knowledge graph, equipment, medium and product. BACKGROUND

[0002] As a structured knowledge representation, the knowledge graph is a core component of intelligent question answering, aiming to obtain accurate answers directly from the knowledge graph through natural language questions. Traditional knowledge graphs rely on semantic analysis, but when dealing with complex problems, it is difficult to accurately capture logical rules, and at the same time, meta-models perform well in natural language processing, capable of handling complex language patterns and generating fluent answers. When determining intelligent question answering results based on natural language, there are limitations such as limited reasoning, outdated / missing knowledge, susceptibility to factual errors, limited context, and high training costs. Based on this, the knowledge graph can be combined with natural language to improve the results of intelligent question answering. The inventors found the following problems when implementing the technical solution based on the above method:

[0003] Natural language processing methods can rely on structured knowledge supported by knowledge graphs when determining intelligent question answering results, but lack an effective mechanism to guide natural language to achieve multi-step iterative reasoning. Moreover, existing knowledge graphs are mostly relationships between entities, relationships, and objects, and when dealing with events occurring in a city, it is impossible to process them based on static knowledge graphs, resulting in inaccurate intelligent question answering results or significant differences in user adaptation. SUMMARY

[0004] Embodiments of the present application provide a question and answer method, device, equipment, medium and product based on a city knowledge graph to improve the accuracy and effectiveness of question description information answers.

[0005] In a first aspect, embodiments of the present application provide a question and answer method based on a city knowledge graph, the method comprising:

[0006] receiving question description information input by a user;

[0007] searching for a first question and answer feedback associated with the question description information based on a vector database corresponding to a city knowledge graph, wherein the city knowledge graph is determined in combination with at least one event occurring in a target city, and the description text corresponding to the event includes at least time sequence information and spatial information.

[0008] Further, in response to an event that the first question-answer feedback does not satisfy a preset condition, at least one reasoning path is determined based on the question description information and the city knowledge graph; wherein the reasoning path includes at least two associated entities and edges connecting the at least two associated entities, and the edges are used to represent the entity relationship of the at least two associated entities.

[0009] Based on the at least one reasoning path, a second question-answer feedback associated with the question description information is determined and displayed.

[0010] Further, after receiving the question description information input by the user, the method further includes:

[0011] The question description information is parsed to determine a query template corresponding to the question description information.

[0012] Based on the query template and the question description information, a structured query statement is generated.

[0013] The structured query statement is used to determine the first question-answer feedback.

[0014] Further, the searching, based on the vector database corresponding to the city knowledge graph, for the first question-answer feedback associated with the question description information includes:

[0015] Based on the structured query statement corresponding to the question description information, the plurality of vector data stored in the vector database is searched.

[0016] Based on the search result, the first question-answer feedback associated with the question description information is determined.

[0017] The vector data is determined based on the city knowledge graph.

[0018] Further, the determining, based on the question description information and the city knowledge graph, of at least one reasoning path includes:

[0019] At least one initial entity in the question description information is obtained.

[0020] According to the at least one initial entity, the city knowledge graph is queried to determine at least one first path including the at least one initial entity; wherein the first path includes at least one associated entity.

[0021] According to the relevance of the at least one first path to the at least one initial entity, at least one reasoning path that is adapted to a preset path quantity threshold is determined.

[0022] Further, the determining the second question and answer feedback associated with the question description information based on the at least one reasoning path comprises:

[0023] For the at least one reasoning path, if the reasoning path includes the to-be-used result corresponding to the question description information in at least one associated entity, the to-be-used result is taken as the second question and answer feedback.

[0024] Further, the determining the second question and answer feedback associated with the question description information based on the at least one reasoning path comprises:

[0025] For the at least one reasoning path, if the second question and answer feedback is not determined based on at least one associated entity in the reasoning path, a next path node is acquired in the city knowledge graph from a starting point of a last path node of the reasoning path, the reasoning path is updated based on the next path node, and the second question and answer feedback is determined based on the updated reasoning path.

[0026] Further, the method further comprises:

[0027] For all reasoning paths, if a depth value of down exploration of the city knowledge graph reaches a maximum exploration depth value, or the down exploration reaches a last exploration node of the city knowledge graph and the second question and answer feedback is not determined, the second question and answer feedback corresponding to the question description information is determined based on a target language model.

[0028] Further, the method further comprises:

[0029] After the second question and answer feedback is filled into the question description information, the second question and answer feedback is displayed; or,

[0030] In a case where the first question and answer feedback satisfies the preset condition, the first question and answer feedback is filled into the question description information and displayed.

[0031] In a second aspect, an embodiment of the present application further provides a question and answer device based on a city knowledge graph, which comprises:

[0032] A question description information receiving module is configured to receive question description information input by a user.

[0033] A first question and answer feedback module is configured to search a first question and answer feedback associated with the question description information based on a vector database corresponding to a city knowledge graph, wherein the city knowledge graph is determined in combination with at least one event occurring in a target city, and description text corresponding to the event at least includes time sequence information and space information.

[0034] In a third aspect, an electronic device is provided, and the electronic device includes:

[0035] one or more processors;

[0036] a memory for storing one or more programs;

[0037] When the one or more programs are executed by the one or more processors, the one or more processors implement the method for question and answer based on a city knowledge graph as provided in any of the embodiments of the present application.

[0038] In a fourth aspect, a computer-readable storage medium is provided, and the computer-readable storage medium stores a computer program, and the computer program, when executed by a processor, implements the method for question and answer based on a city knowledge graph as provided in any of the embodiments of the present application.

[0039] In a fifth aspect, a computer program product is provided, and the computer program product includes a computer program, and the computer program, when executed by a processor, implements the method for question and answer based on a city knowledge graph as provided in any of the embodiments of the present application.

[0040] The technical solution provided by the embodiments of the present application can search for the first question and answer feedback corresponding to the question description information input by the user based on the vector data corresponding to the city knowledge graph created in advance after receiving the question description information input by the user. At this time, the city knowledge graph includes the time and space information corresponding to the city, and accordingly, the first question and answer feedback corresponding to the question description information can be determined based on the knowledge graph including the time and space information, which can improve the adaptability between the first question and answer feedback and the user. The technical effect of determining the intelligent question and answer feedback adapted to the question and answer description is achieved, and the problem that the determined question and answer result is not adapted to the actual situation when the data is processed based on the static knowledge graph including only the subject, the relationship, and the object in the prior art is solved. BRIEF DESCRIPTION OF DRAWINGS

[0041] In order to more clearly illustrate the technical solutions of the example embodiments of the present application, the drawings needed in the description of the embodiments are briefly introduced below. Obviously, the drawings introduced are only a part of the drawings of the embodiments to be described by the present application, and not all the drawings. Those skilled in the art can also obtain other drawings from these drawings without creating labor.

[0042] Figure 1 A flowchart of a question and answer method based on a city knowledge graph provided by the embodiments of the present application is provided.

[0043] Figure 2A schematic diagram of determining the first question and answer feedback provided by the embodiment of the present application;

[0044] Figure 3 A flowchart of the question and answer method based on the urban knowledge graph provided by the embodiment of the present application;

[0045] Figure 4 A schematic diagram of the question and answer method based on the urban knowledge graph provided by the embodiment of the present application;

[0046] Figure 5 A schematic diagram of determining the embedding learning vector provided by the embodiment of the present application;

[0047] Figure 6 A flowchart of the question and answer method based on the urban knowledge graph provided by the embodiment of the present application;

[0048] Figure 7 A flowchart of the question and answer method based on the urban knowledge graph provided by the embodiment of the present application;

[0049] Figure 8 A structural schematic diagram of the question and answer device based on the urban knowledge graph provided by the embodiment of the present application;

[0050] Figure 9 A structural schematic diagram of the electronic device provided by the embodiment of the present application. DETAILED DESCRIPTION

[0051] The present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the present application, but not to limit the present application. In addition, it should be noted that, for the convenience of description, only the parts related to the present application are shown in the drawings, but not all the structures.

[0052] The present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the present application, but not to limit the present application. In addition, it should be noted that, for the convenience of description, only the parts related to the present application are shown in the drawings, but not all the structures.

[0053] Before introducing the technical solutions provided by the embodiments of the present application, the application scenarios can be exemplarily described.

[0054] When the analysis result of a certain event in a certain city is determined, the analysis result corresponding to the certain event can be determined based on the processing mode based on the double modal based on the scheme provided by the embodiments of the present application.

[0055] In this embodiment, an urban knowledge graph (UKG) that is adapted to a certain task and a certain city can be created in advance, and then an analysis result is determined according to the urban knowledge graph. The urban knowledge graph can be determined based on data collected in a certain city. The task can be a city traffic prediction task, a city planning task, a public security analysis task, a people flow prediction task, an environment prediction task, and the like, and the specific task can be set according to actual needs in this embodiment and is not limited.

[0056] However, it should be noted that the urban knowledge graph mentioned in this embodiment includes time information and spatial information, that is, the graph associates time information and spatial information, and when task processing is performed based on this graph, the accuracy of task processing can be improved. The urban knowledge graph integrates traffic flow, points of interest (POI), environmental sensors, administrative divisions, and other heterogeneous city data to represent city entities and their relationships in a structured form. It has important value in city computing tasks such as traffic flow prediction, city planning, and intelligent traffic management. In the field of intelligent question answering, it supports complex queries and reasoning for city-related questions, such as traffic congestion analysis or event scenario generation.

[0057] Figure 1 A flowchart of a question answering method based on an urban knowledge graph provided in this embodiment of the present application. This embodiment can be applied in the scenario of feeding back feedback information that is adapted to the problem description information submitted by the user in the intelligent question answering scenario. The question answering method based on the urban knowledge graph provided in this embodiment can be integrated in an electronic device, which can be a mobile terminal or a server, etc. The implementation of the technical solution provided in this embodiment of the present application can be based on a client deployed in a mobile terminal, or a server, or a combination of a client and a server.

[0058] As shown in the method, the method specifically includes the following steps: Figure 1

[0059] S110, receiving problem description information input by a user.

[0060] In actual applications, the corresponding application software can be developed based on the technical solution provided in this embodiment of the present application, or it can be integrated as a functional module in any existing software, or it can be integrated in a smart robot.

[0061] ​Specifically, when the application software is triggered, the application software can be triggered to display a main interface. The main interface can include a question editing box, and a user can edit question description information in the question editing box. When the function module is triggered, the function module can be triggered to display a main interface corresponding to the function module, and then the question description information can be edited in a question input editing box corresponding to the main interface. Of course, if the question description information is integrated in the intelligent robot, the question description information can be input in the display screen of the robot. In actual application, the user can also input the question description information in the form of voice input. After the question description information is input, when an event that meets the feedback to the client or the server is detected, the question description information can be sent to the client or the server, so that the client or the server can receive the question description information input by the user.

[0062] In this embodiment, the event that meets the feedback to the client or the server can be that a control for sending the question description information is triggered, a display duration of the question description information reaches a preset duration threshold, the question description information in the question editing box is not changed within a preset duration, and the like.

[0063] It should be noted that the question description information mentioned in this embodiment can also be understood as prompt information for guiding the feedback content of the feedback-related event.

[0064] After receiving the question description information input by the user, the method further includes: analyzing the question description information to determine a query template corresponding to the question description information; generating a structured query statement based on the query template and the question description information; and wherein the structured query statement is used to determine a first question and answer feedback.

[0065] Generally, the question description information input by the user is natural language. In order to make the computer understand the question description information, the question description information can be analyzed and processed based on a large language model to determine a query statement corresponding thereto. The query template is used to determine the question asking template that the large language model is adapted to after analyzing the question description information. The query statement is a statement referred to by the computer when performing a query.

[0066] When a real business demand of a smart city is addressed, a series of query rules can be specified in advance, and a corresponding standard query query can be defined. For example, where is a person's work unit? Or, how is the weather on a certain day? The query template corresponding to the above questions can be defined. The advantage of defining the query template is that after receiving the question description information, the query template adapted to the question description information can be used to determine the final query statement, thereby improving the efficiency of finding feedback information based on the query statement.

[0067] Specifically, after receiving the question description information, the question description information can be parsed based on a language model, and matched to a query template suitable therefor. Based on the LLM, a structured query statement can be quickly and accurately generated according to the determined query template and prior knowledge. The main significance of the structured query statement is that it can be used to determine the first question and answer feedback. It should be noted that the first question and answer feedback is the question and answer feedback suitable for the question description information.

[0068] In this embodiment, the purpose of determining the query template corresponding to the question description information and then generating the structured query statement based on the query template is to improve the response efficiency of searching for the question and answer feedback.

[0069] S120, search for the first question and answer feedback associated with the question description information based on the vector database corresponding to the city knowledge graph.

[0070] In this embodiment, the city knowledge graph is determined in combination with at least one event occurring in the target city. The description text corresponding to the event includes at least time sequence information and spatial information.

[0071] It can be understood that a plurality of event data corresponding to the target city under a preset task can be collected. The event data can include subject, object, relationship, time, space, and other information corresponding to the occurrence of an event. It can also include weather information, environmental information, holiday information, and other information corresponding to the occurrence of the event. The city knowledge graph corresponding to the plurality of events can be generated based on the obtained event data. Accordingly, embedding learning can be performed based on the city knowledge graph to obtain an embedding learning vector corresponding to the city knowledge graph. The embedding learning vector can be stored in the vector database. The embedding vector includes the results obtained after comprehensive processing of various factors such as subject, object, relationship, time, and space.

[0072] The city knowledge graph provided in this embodiment not only considers the subject, relationship, and object, but also considers the information in the time and space dimensions, so that the result data predicted by the obtained city knowledge graph is more suitable for the real scene.

[0073] The first question and answer feedback is an answer determined based on the vector database corresponding to the city knowledge graph. When the answer corresponding to the question description information is determined based on the city knowledge graph, the first question and answer feedback includes feedback content associated therewith. When no answer suitable therefor is found based on the city knowledge graph, the first question and answer feedback can be empty. The specific content of the first question and answer feedback is adapted to the search question and answer result based on the city knowledge graph.

[0074] Specifically, after converting the question description information into a structured query statement, the structured query statement can be used as a basis for reading a learning embedding vector corresponding to the city knowledge graph in the vector database. Then, the first question and answer feedback that matches the learning embedding vector is determined.

[0075] In this embodiment, searching for the first question and answer feedback associated with the question description information based on the vector database corresponding to the city knowledge graph includes: performing vector search on the embedding learning vector corresponding to the city knowledge graph stored in the vector database based on the structured query statement corresponding to the question description information; determining the first question and answer feedback associated with the question description information based on the search result; wherein the vector data is determined based on the city knowledge graph.

[0076] After obtaining the city knowledge graph, it can be mapped into a high-order tensor. That is, according to the data content corresponding to each modality preset, the data value mapped into the high-order tensor is determined. The high-order tensor is input into the pre-trained multi-relation graph convolution network to learn the modality interaction information including each modality and the relationship between any two modalities. The result output by the multi-relation graph convolution network is used as the embedding learning vector corresponding to the city knowledge graph. That is, the embedding learning vector is a numerical vector obtained by mapping the entity, relationship, time, space and other information in the knowledge graph to a low-dimensional continuous vector space. These vectors can preserve the semantic information and structural features in the knowledge graph, so that the operations in the vector space can reflect the semantic relationships in the knowledge graph. For example, if there is a triple (h, r, t), then in the ideal case h + r ≈ t, where h, r, and t are the embedding vectors of the head entity, the relationship, and the tail entity, respectively.

[0077] Based on the above, the search result can be determined according to the structured query statement corresponding to the question description information and the embedding learning vector. When the search result is not empty, the first question and answer feedback matches the search result. When the search result is empty, the first question and answer feedback can be empty.

[0078] In this embodiment, the purpose of determining the first question and answer feedback based on the embedding learning vector is to accelerate the search efficiency of the question and answer directly by searching the vector database when the question description information explicitly contains known entities or relationships. That is, the embedding learning vector of the high-quality knowledge graph can be fully utilized to achieve efficient approximate nearest neighbor search, achieving the effect of efficient determination of search results.

[0079] For example, referring to Figure 2, the user input question description information is: "where is the birthplace of Wang Er?" The question description information can be analyzed and processed by natural language, and a query template suitable for the question description information is called, and then a structured query statement is generated based on the query template identification 1, prior knowledge and question description information, see Figure 2 identification 2 in. Based on the embedding learning vector corresponding to the city knowledge graph, the structured query statement can be analyzed and processed to determine the search result. Based on the search result, the first question and answer feedback can be determined, see Figure 2 identification 3 in.

[0080] Further examples, when the natural language corresponding to the question description information is parsed and converted into a structured query statement based on a natural language model, efficient semantic matching and retrieval can be performed in a vector database including embedding learning vectors according to known entities or relationships explicitly contained in the structured query statement. For example, when the user asks "what is the traffic flow at X intersection on Tuesday last week?", the spatio-temporal embedding corresponding to "X intersection" and "last Tuesday" can be quickly retrieved, so that the relevant traffic flow data can be quickly located, and the near real-time answer can be returned. This way can directly solve the challenge brought by large-scale and real-time requirements of city data.

[0081] It can be understood that: when embedding learning is performed on the city knowledge graph to obtain an embedding learning vector corresponding thereto, due to the extreme washing property of event data under fine-grained space-time, the robustness of entity and relationship identification learning is insufficient, and when it is converted into a corresponding high-order tensor, the problem of data source sparsity can be compensated. Further, since the event data includes time and space information, it can cope with question and answer descriptions that require time information. Further, since the city knowledge graph includes time and space information, it can meet the effect of real-time scene reasoning and prediction.

[0082] The technical solution provided by the embodiment of the application can search for the first question and answer feedback corresponding to the question description information based on the vector data corresponding to the city knowledge graph created in advance after receiving the question description information input by the user. At this time, the city knowledge graph includes the time and space information corresponding to the city, and accordingly, the first question and answer feedback corresponding to the question description information can be determined based on the knowledge graph including time and space information, which can improve the adaptability between the first question and answer feedback and the user. The problem that the determined question and answer result is not adapted to the actual situation when data processing is performed based on a static knowledge graph including only the subject, relationship and object in the prior art, which cannot be applied to spatial regions with changes in space and time, is solved, and the technical effect of determining an intelligent question and answer result feedback adapted to the question and answer description is achieved.

[0083] Figure 3A flowchart of a question and answer method based on a city knowledge graph provided by an embodiment of the present application is shown in the figure. If the first question and answer feedback is not determined or does not match the question description information, the city knowledge graph can be further explored to obtain question and answer feedback that better matches the question description information. The specific implementation can be referred to the detailed description of the embodiment. The same or corresponding technical terms as the above embodiments are not described herein.

[0084] As shown in Figure 3 the method further comprises:

[0085] S210, receiving question description information input by a user;

[0086] S220, searching for first question and answer feedback associated with the question description information based on a vector database corresponding to the city knowledge graph.

[0087] S230, in response to an event that the first question and answer feedback does not meet a preset condition, determining at least one reasoning path based on the question description information and the city knowledge graph.

[0088] The preset condition can be understood as a condition that fails to provide an answer that matches the question description information. For example, the first question and answer feedback is empty, i.e., no corresponding search result is found based on the city knowledge graph, then the first question and answer feedback does not meet the preset condition.

[0089] It can be understood that when the question and answer feedback is not determined based on the search method, the question and answer feedback corresponding to the question description information can be determined based on the reasoning method.

[0090] The number of at least one reasoning path can include one or more, and the specific number of reasoning paths can be determined according to the specific content of the city knowledge graph and the question description information, which is not limited in the embodiment. In the embodiment, the reasoning path refers to a path determined based on the city knowledge graph that matches the question description information.

[0091] Generally, the knowledge graph includes multiple nodes and edges connecting the nodes. Then, the reasoning path also includes nodes and edges connecting the nodes. Here, the entity corresponding to the node in the reasoning path is referred to as an associated entity, and the edge connecting the associated entities is referred to as an entity relationship. That is, the reasoning path includes at least two associated entities and edges connecting the at least two associated entities, and the edges are used to represent the entity relationship of the at least two associated entities.

[0092] Specifically, when it is detected that the first question and answer feedback is empty, it indicates that the mode of reasoning needs to be combined to determine the question and answer feedback corresponding to the question description information. At this time, the reasoning path including the question description information can be determined based on the question description information and the city knowledge graph. At this time, one or more reasoning paths can be found.

[0093] In actual application, there can be a case that no reasoning path is found based on the city knowledge graph, at this time, the second question and answer feedback can be empty. However, generally, the corresponding question and answer feedback can be found based on the reasoning mode, only the referenceability of the question and answer feedback has certain difference.

[0094] S240, determining and displaying the second question and answer feedback associated with the question description information based on at least one reasoning path.

[0095] Among them, the second question and answer feedback is the question and answer feedback corresponding to the question description information determined based on at least one reasoning path.

[0096] Specifically, each reasoning path can be analyzed and processed to determine and display the second question and answer feedback corresponding to the question description information. In this embodiment, whether the first question and answer feedback is determined or the second question and answer feedback is determined, it needs to be displayed, and the specific display mode can be: the second question and answer feedback is filled into the question description information and then displayed; or in the case that the first question and answer feedback meets the preset condition, the first question and answer feedback is filled into the question description information and then displayed.

[0097] It can be understood that: in the case that the first question and answer feedback is obtained, the case of determining the second question and answer description based on the reasoning path can not be executed, at this time, the first question and answer feedback can be filled into the question description information and then displayed. Further, if the first question and answer feedback is not obtained, the second question and answer feedback is determined by using the reasoning path reasoning mode, and the second question and answer feedback is filled into the question description information and then displayed.

[0098] That is to say, in the answer generation stage, the first question and answer feedback or the second question and answer feedback can be directly added to the question description information to obtain the final displayed answer.

[0099] The question and answer framework corresponding to the question and answer scheme based on the city knowledge graph provided by the embodiment of the application can be referred to Figure 4, based on the question and answer framework, a dual-modal urban knowledge graph intelligent question and answer method can be realized. At this time, the dual-modal mainly refers to the search question and answer modal and the reasoning question and answer modal. The search question modal mainly refers to the modal of directly searching based on the embedding learning vector corresponding to the urban knowledge graph to obtain the first question and answer feedback; the reasoning question and answer modal is the second question and answer feedback inferred based on the reasoning path of the urban knowledge graph when the first question and answer feedback output by the search question and answer modal does not meet the preset condition. For example, the problem description information is: "X city can use oxygen for how many days", first search based on the search question and answer modal, and in the case that the first question and answer feedback is not obtained, the second question and answer feedback is determined based on the reasoning modal.

[0100] It can be understood that when the user submits a natural language question, the system first tries to retrieve the answer directly from the urban knowledge graph through the search question and answer module. If the search is successful and the answer is returned, the question and answer process is directly ended. If the search question and answer module cannot return the answer, it indicates that the problem may require more complex reasoning, and the system will automatically switch to the reasoning question and answer module to obtain the answer through iterative optimization of the thinking chain, and finally return the result. This phased processing strategy aims to balance the efficiency and accuracy of question and answer.

[0101] The embodiment of the application innovatively proposes a dual-modal intelligent question and answer framework combining search question and answer and reasoning question and answer. The framework can intelligently select and execute different question and answer modes according to the complexity of the user's question. For factual questions that can be directly retrieved through the knowledge graph, prompt learning-based query generation is used to accurately convert natural language questions into structured query statements, and vector databases are combined for efficient retrieval. For complex problems that require multi-step logical reasoning, switch to prompt learning-based thinking chain iterative optimization reasoning to gradually explore and verify the reasoning path.

[0102] The technical scheme provided by the embodiment of the application can search the first question and answer feedback corresponding to the problem description information based on the pre-created vector data corresponding to the urban knowledge graph after receiving the problem description information input by the user. At this time, the urban knowledge graph includes the time and space information corresponding to the city, and accordingly, the first question and answer feedback corresponding to the problem description information can be determined based on the knowledge graph including the time and space information, which can improve the adaptability between the first question and answer feedback and the user. Further, when the first question and answer feedback does not meet the preset condition, i.e., the first question and answer feedback is empty, a plurality of exploration paths corresponding to the problem description information can be determined based on the urban knowledge graph as an exploration basis, and then the second question and answer feedback corresponding to the question and answer description information is determined according to the exploration path, realizing the effect of improving the adaptability of the intelligent question and answer result to the user.

[0103] Figure 5The flowchart provided by the embodiment of the present application for determining the embedding learning vector corresponding to the city knowledge graph can store the obtained embedding learning vector in a vector database to determine the first question and answer feedback based on the embedding learning vector. The specific implementation manner can be referred to the detailed description of the embodiment. The same or corresponding technical terms as the above embodiment are not described herein.

[0104] Referring to Figure 5 First, a plurality of events corresponding to a preset task in a target city can be acquired. Meanwhile, event data corresponding to the events can be acquired. Whether each event data includes the content in the above-mentioned modalities, i.e., entity, relationship, object, time, space, weather, environment, and festival, is determined according to a plurality of modalities set in advance. If the above-mentioned modalities set in advance all include the corresponding content, when the content is mapped to a high-order tensor, the content value of the cell where the content is located can be a first value 1, otherwise, the content value of the cell where the content is located is 0. That is, first, city multi-source heterogeneous data acquisition (a plurality of event data are acquired), and a city knowledge graph is constructed based on the plurality of event data. The event data corresponding to the city knowledge graph is mapped to a high-order time series tensor constructed in advance. That is, the event data is represented by the high-order time series tensor. The embedding learning is enhanced based on the MR-GCN (multi-relation graph convolution network) of high-order tensor decomposition. Through tensor decomposition and generalized tensor product convolution processing, a low-dimensional embedding vector of entity / relationship / multi-dimensional context is obtained. The low-dimensional embedding vector is used as an embedding learning vector.

[0105] The embedding learning vector is based on the embedding vector of the learned entity, relationship, object, time domain, space domain, and the relationship between any two, which can be stored in a vector database. Based on the embedding learning vector in the vector database, approximate nearest neighbor search can be quickly performed instead of traditional exact matching, thereby significantly improving the query efficiency. Further, when determining the embedding learning vector, the concept of "generalized tensor product" is introduced, and high-quality, low-dimensional entity, relationship, time, and space (geospatial) embedding including time information and space information (geospatial information) is learned. The above-mentioned embedding can capture the inherent complex, heterogeneous, sparse, and large spatial and temporal dynamics of the city knowledge graph. Further, the high-quality spatiotemporal embedding is used as the bottom knowledge representation and acceleration mechanism of the city knowledge graph to determine the question and answer feedback.

[0106] Based on the embedding learning vector, the missing information in the city knowledge graph can be completed, and further, when the second question and answer feedback corresponding to the city knowledge graph reasoning and the problem description information is determined, the high-quality spatiotemporal embedding provides rich contextual information and structured clues for the large language model, thereby improving the adaptability between the second question and answer feedback and the problem description information.

[0107] On the basis of the above technical solutions, after obtaining the embedding learning vector corresponding to the city knowledge graph, the missing facts in the city knowledge graph can be inferred based on the embedding learning vector to complete the city knowledge graph.

[0108] Thirdly, the obtained embedding learning vector can be applied to downstream tasks. Optionally, it can be used for traffic prediction, event detection, city planning, public security analysis, etc. That is, after obtaining the embedding learning vector, it can be integrated into a model corresponding to a certain task, and after receiving input data, the output result of the input data can be determined based on the embedding learning vector. For example, when the traffic prediction task is a binary classification result of congestion or not, the input data can be analyzed based on the embedding learning vector, and the classification result corresponding to 0 or 1 can be output according to the analysis result. The classification result 0 represents congestion, and 1 represents no congestion. The specific application is not limited in this embodiment, and users can design according to actual needs.

[0109] The scheme provided by the embodiment of the application can obtain a plurality of event data associated with a preset task, at this time, the event data can include data content in the time dimension and the space dimension. By constructing a knowledge graph on the event data and learning an embedding learning vector corresponding to the knowledge graph, since the embedding learning vector includes modal information corresponding to each modal and modal interaction information between any two modals, when determining the question and answer feedback corresponding to the problem description information based on the embedding learning vector, since the embedding learning vector includes time and space information, the obtained question and answer feedback has high adaptability to the user.

[0110] Figure 6 The question and answer method based on the city knowledge graph provided by the embodiment of the application is shown in the flowchart, and on the basis of the foregoing embodiment, how to determine the reasoning path can be further refined, and the specific implementation can be referred to the detailed description of the embodiment. The same or corresponding technical terms as the above embodiments are not described herein.

[0111] As shown in 6, the method comprises:

[0112] S310, obtaining at least one initial entity in the problem description information.

[0113] The initial entity can be understood as entity information directly extracted after language analysis of the problem description information. The initial entity in the problem description information can be extracted based on a large language model.

[0114] Specifically, a large language model can be used to analyze and process the description text corresponding to the question description information to extract the entity in the question description information, and the entity can be used as an initial entity. The number of initial entities can include one or more, and the specific number is related to the text content in the question description information.

[0115] For example, the question description information is: "How many days can oxygen in X City be used?" The large language model can extract "X City" and "oxygen", and the above two entities can be used as initial entities.

[0116] S320, querying the city knowledge graph according to at least one initial entity to determine at least one first path related to the at least one initial entity.

[0117] Among them, the city knowledge graph includes multiple levels, and each level can include at least one node. The nodes included in adjacent two levels can have certain association. The node attribute of each node can include an entity, at which time the entity consistent with the initial entity and the entity having similarity with the initial entity can be determined. Based on this, subgraph query and path recall can be performed based on the city knowledge graph to determine at least one query path associated with the initial entity. The query path is used as the first path. Correspondingly, the first path includes at least one associated entity related to the initial entity.

[0118] Specifically, for each initial entity, the associated entity related to the initial entity can be determined first. Optionally, the association degree between the initial entity and the entity in the city knowledge graph can be calculated, and optionally, the cosine similarity method is used to determine the association degree, based on which the entity associated with the initial entity is determined. Further, the subgraph query is performed on the city knowledge graph to determine at least one first path. The path recall instruction is executed to display at least one first path.

[0119] S330, determining at least one reasoning path according to the related attribute of at least one first path corresponding to at least one initial entity.

[0120] Among them, the related attribute is used to represent the association degree or matching degree of each path relative to all initial entities. The related attribute can be represented by a score, and optionally, the higher the score, the more suitable the first path is for the at least one initial entity, and vice versa, the less suitable the first path is for the at least one initial entity.

[0121] Generally, the number of first paths can include multiple, and the related attribute between each first path and at least one initial entity has certain difference. In order to improve the accuracy and efficiency of determining the second question and answer feedback based on the reasoning path, a certain number of reasoning paths can be determined according to the related attribute of the first path.

[0122] Optionally, the first path with the preset number threshold is selected from high to low according to the related attribute of the first path, and is taken as the reasoning path.

[0123] Specifically, the related attribute of the first path and at least one initial entity can be determined, the first path with the preset path number threshold is determined from high to low according to the related attribute, and is taken as the reasoning path. Or, the first path with the related attribute higher than the preset attribute threshold is taken as the reasoning path.

[0124] It can be understood that for a given initial entity, there may be multiple first paths, therefore, the first path needs to be pruned. The pruning process can also be completed through the problem description information, for example, the input can be: “please return the most relevant N reasoning paths”, based on the related attribute of the first path, N reasoning paths are returned.

[0125] It should be noted that when the number of the first path is less than the preset path number threshold, the determined first path can be taken as the reasoning path.

[0126] In the exploration of the city knowledge graph and the path recall process, the embedded similarity can help the system to efficiently find the most relevant relationship and entity with the current reasoning step, thereby avoiding blind traversal of the entire city knowledge graph, and can improve the efficiency of determining the second question and answer feedback.

[0127] Further, when the first path is pruned to obtain the reasoning path, the semantic and spatio-temporal correlation information contained in the embedding learning vector can be combined to more intelligently evaluate the relevance and rationality of different reasoning paths, thereby effectively pruning redundant or incorrect paths, and improving the accuracy and efficiency of reasoning. In addition, the embedding learning vector can also help the large language model to better understand the complex spatio-temporal dynamics and heterogeneity in the city knowledge graph, for example, to distinguish the changes in traffic patterns in different time periods, or to understand the complex relationships between different types of city entities (such as POI, sensors, administrative divisions), thereby performing more accurate time perception and location perception reasoning.

[0128] The present application designs a customized query prompt template and reasoning path pruning strategy in view of the specific challenges of the high heterogeneity, complex spatio-temporal dynamics and large data volume of the city knowledge graph. By integrating the structural information of the city knowledge graph (such as entity types, relationship patterns) and high-quality spatio-temporal vector embeddings based on tensors (stored in a vector database) into the prompt word design, the natural language model can better understand the city domain context and generate more accurate queries and reasoning paths. For example, in search and question answering, vector embeddings are used to accelerate the matching of known entities and relationships; in reasoning and question answering, the LLM is guided by the prompt word to perform more accurate entity positioning and relationship exploration, and the reasoning path is effectively pruned.

[0129] The technical solution provided by the embodiment of the application can traverse the city knowledge graph according to at least one initial entity associated with the problem description information, determine a plurality of reasoning paths, and then explore according to the reasoning paths to determine a second question and answer feedback that is adapted to the problem description information, thereby achieving the effect of improving the adaptability between the question and answer feedback and the problem description information by deeply exploring the city knowledge graph to determine the question and answer feedback.

[0130] Figure 7 For the question and answer method flowchart based on the city knowledge graph provided by the embodiment of the application, how to determine the second question and answer feedback based on the reasoning path can be further refined based on the foregoing embodiment, and the specific implementation can be referred to the detailed description of the embodiment. The same or corresponding technical terms as the above embodiment are not described herein.

[0131] As shown in 7, the method comprises:

[0132] S410, receiving problem description information input by a user.

[0133] S420, searching for a first question and answer feedback associated with the problem description information based on a vector database corresponding to the city knowledge graph.

[0134] S430, if the second question and answer feedback is not determined based on at least one associated entity in the reasoning path, obtaining a next path node in the city knowledge graph from the last path node of the reasoning path as a starting point, and updating the reasoning path based on the next path node to determine the second question and answer feedback based on the updated reasoning path.

[0135] It should be noted that the processing order of the reasoning path can be determined according to the related attribute of the reasoning path relative to the at least one initial entity. Optionally, the reasoning path is processed in order from high to low according to the related attribute. The advantage of this processing is that the second question and answer feedback can be determined from the reasoning path with a higher related attribute, and the efficiency and accuracy of determining the second question and answer feedback can be improved.

[0136] Of course, the reasoning path can also be analyzed and processed respectively to obtain the second question and answer feedback. In the case where the number of second question and answer feedback includes multiple, the reasoning path can be determined according to the related attribute from high to low. For the reasoning path, it is a subgraph in the city knowledge graph. The subgraph can be a sub-path on a path in the city knowledge graph.

[0137] For at least one reasoning path, if at least one associated entity in the reasoning path includes a to-be-used result corresponding to the problem description information, the to-be-used result is taken as the second question and answer feedback.

[0138] It should be noted that the processing mode corresponding to each reasoning path is the same, and one of the reasoning paths is taken as an example for description.

[0139] It can be understood that the question description information includes at least one initial entity. The reasoning path can include at least one associated entity. If the at least one initial entity is included in the at least one associated entity, and the result information corresponding to the at least one initial entity is included, the result in the reasoning path can be taken as the second question answer feedback.

[0140] Further, if the first question answer feedback corresponding to the at least one initial entity is not found based on the at least one associated entity in the reasoning path, the reasoning path can be searched.

[0141] Specifically, when the reasoning path is a sub-path in the city knowledge graph, and the last node of the reasoning path is not the last node of the city knowledge graph, the next path node is obtained in the city knowledge graph from the path node as a starting point. Update the reasoning path according to the node information of the next path node. The node information can include the entity information stored in the node. The second question answer feedback is determined again based on the at least one initial entity of the reasoning path.

[0142] Further, if the second question answer feedback is not determined based on the updated reasoning path, the last path node of the reasoning path is taken as a starting point to obtain the next path node in the city knowledge graph, and the reasoning path is updated based on the obtained path node. The second question answer feedback can be determined based on the above-mentioned manner.

[0143] The advantage of determining the second question answer feedback in the above-mentioned manner is that the iterative optimization manner can be used to determine the second question answer feedback, and the efficiency of determining the question answer feedback is improved. In actual application, if the downlink exploration depth value reaches the preset depth value threshold, and the second question answer feedback is determined based on the downlink determined reasoning path, it is possible that the second question answer feedback found is not suitable for the question description information. Based on this, a preset depth threshold can be set, and once the preset depth threshold is reached, the downlink exploration is no longer performed.

[0144] For all reasoning paths, if the depth value of the downlink exploration of the city knowledge graph reaches the maximum exploration depth value, or the last path node of the city knowledge graph is reached in the downlink exploration, and the second question answer feedback is not determined, the second question answer feedback corresponding to the question description information is determined based on the target language model.

[0145] The maximum exploration depth value is a preset maximum depth value of the downlink exploration of the knowledge graph. The last path node is the node of the last level of the city knowledge graph.

[0146] It can be understood that for each reasoning path, if it is necessary to explore the city knowledge graph downward, the exploration depth value of the reasoning path can be obtained, that is, the number of nodes of the path node obtained downward. If the depth value is less than the maximum exploration depth value, the downward exploration can be continued; if the depth value is equal to the maximum exploration depth value, but the second question and answer feedback is still not determined, the second question and answer feedback corresponding to the problem description information can be determined based on the target language model. Of course, if the depth value does not reach the maximum exploration depth value, but has already explored downward to the last path node of the city knowledge graph, the second question and answer feedback corresponding to the problem description information can be determined based on the target language model.

[0147] That is, if the second question and answer feedback is determined based on the city knowledge graph iterative optimization manner to update the reasoning path, it can be directly displayed. If the second question and answer feedback is not determined, the second question and answer feedback corresponding to the problem description information can be determined based on the natural language model.

[0148] On the basis of the above technical solutions, if the second question and answer description includes multiple cases, that is, the second question and answer feedback is determined based on multiple reasoning paths, a preset manner can be used to determine the final feedback second question and answer feedback.

[0149] The preset manner can include at least one of the following manners:

[0150] Manner one: the second question and answer feedback determined directly based on the reasoning path is obtained. If the second question and answer feedback is the same, it is directly used as the second question and answer feedback that can be displayed. If the second question and answer feedback is different, the similarity between the second question and answer feedback and the problem description information is calculated. If the similarity is higher than a preset similarity threshold, the second question and answer feedback with the highest similarity is used as the final second question and answer feedback displayed.

[0151] If there is no question and answer feedback with a similarity higher than the preset similarity threshold, the frequency of the same second question and answer feedback can be counted, and the question and answer feedback with the highest frequency is used as the second question and answer feedback. Alternatively, the similarity between each second question and answer feedback and the problem description information is determined, and the second question and answer feedback with the highest similarity is used as the final second question and answer feedback displayed.

[0152] The second question and answer feedback determined based on the path iteration optimization is counted, and the second question and answer feedback with the highest frequency is taken as the final second question and answer feedback that can be displayed.

[0153] The second question and answer feedback determined based on the path iteration optimization is counted, and the second question and answer feedback with the highest frequency is taken as the final second question and answer feedback that can be displayed.

[0154] For the complex multi-hop reasoning problem in the city knowledge graph, the technical solution provided by the embodiment of the application uses the thinking chain iteration optimization idea of prompt learning, performs initialization entity extraction through a language model, and then performs subgraph query and path recall. The key is that it uses prompt learning to intelligently prune multiple possible reasoning paths (for example, “please return the most relevant N relationships”), and performs conditional judgment on the current reasoning path through the language model. If the condition is not met, the thinking chain is continuously iteratively optimized, and the answer is gradually approached until the maximum search depth is reached. Even if the answer cannot be directly found in the knowledge graph, the model can flexibly use the internal knowledge of the language model to supplement, thereby providing a more comprehensive answer.

[0155] The technical solution provided by the embodiment of the application can traverse the city knowledge graph according to at least one initial entity associated with the problem description information, determine multiple reasoning paths, and then explore the reasoning paths to determine the second question and answer feedback that adapts to the reasoning paths, thereby achieving the effect of improving the adaptability between the question and answer feedback and the problem description information.

[0156] The following is an embodiment of a question and answer device based on a city knowledge graph provided by the embodiment of the application. The device and the question and answer method based on the city knowledge graph in each of the above embodiments belong to the same inventive concept. Details not described in the embodiment of the question and answer device based on the city knowledge graph can be referred to the embodiment of the question and answer method based on the city knowledge graph

[0157] Figure 8 The structure of the question and answer device based on the city knowledge graph provided by the embodiment of the application is shown in the figure. The device specifically includes a problem description information receiving module 510 and a first question and answer feedback module 520.

[0158] The problem description information receiving module 510 is configured to receive problem description information input by a user.

[0159] The first question and answer feedback module 520 is configured to search for first question and answer feedback associated with the problem description information based on a vector database corresponding to a city knowledge graph, wherein the city knowledge graph is determined in combination with at least one event occurring in a target city, and the event corresponds to description text including at least time sequence information and spatial information.

[0160] The technical solution provided by the embodiment of the present application can search for first question and answer feedback corresponding to the problem description information based on the vector data corresponding to the city knowledge graph created in advance after receiving the problem description information input by the user. At this time, the city knowledge graph includes time and spatial information corresponding to the city. Accordingly, the first question and answer feedback corresponding to the problem description information can be determined based on the knowledge graph including the time and spatial information, which can improve the adaptability between the first question and answer feedback and the user. The technical effect of determining the intelligent question and answer feedback that is adapted to the question and answer description is achieved.

[0161] On the basis of the above technical solution, the device further comprises:

[0162] The reasoning path determining module is configured to determine at least one reasoning path based on the problem description information and the city knowledge graph in response to an event that the first question and answer feedback does not satisfy a preset condition, wherein the reasoning path includes at least two associated entities and edges connecting the at least two associated entities, and the edges are used to represent the entity relationship of the at least two associated entities.

[0163] The second question and answer feedback and display module is configured to determine second question and answer feedback associated with the problem description information based on the at least one reasoning path and display the second question and answer feedback.

[0164] The technical solution provided by the embodiment of the present application,

[0165] On the basis of each of the above technical solutions, the device further comprises:

[0166] The query template determining module is configured to analyze the problem description information to determine a query template corresponding to the problem description information.

[0167] The query statement generating module is configured to generate a structured query statement based on the query template and the problem description information.

[0168] The structured query statement is used to determine the first question and answer feedback.

[0169] On the basis of the above technical solutions, the first question and answer feedback module comprises:

[0170] A first query unit is configured to search a plurality of vector data stored in the vector database based on a structured query statement corresponding to the problem description information.

[0171] A first feedback unit is configured to determine a first question and answer feedback associated with the problem description information based on the search result.

[0172] The vector data is determined based on the city knowledge graph.

[0173] On the basis of the above technologies, the reasoning path determination module comprises:

[0174] An initial entity acquisition unit is configured to acquire at least one initial entity in the problem description information.

[0175] A first path determination unit is configured to query the city knowledge graph according to the at least one initial entity to determine at least one first path comprising the at least one initial entity, wherein the first path comprises at least one associated entity.

[0176] A reasoning path determination unit is configured to determine at least one reasoning path adapted to a preset path quantity threshold based on the relevance of the at least one first path to the at least one initial entity.

[0177] On the basis of the above technical solutions, the second question and answer feedback and display module is further configured to:

[0178] For the at least one reasoning path, if the at least one associated entity in the reasoning path comprises a to-be-used result corresponding to the problem description information, the to-be-used result is taken as the second question and answer feedback.

[0179] On the basis of the above technical solutions, the second question and answer feedback and display module is further configured to, for the at least one reasoning path, if the second question and answer feedback is not determined based on the at least one associated entity in the reasoning path, acquire a next path node in the city knowledge graph with the last path node of the reasoning path as a starting point, and update the reasoning path based on the next path node to determine the second question and answer feedback based on the updated reasoning path.

[0180] On the basis of the above technical solutions, the device further comprises:

[0181] The exploration cutoff module is used to determine the second question-and-answer feedback corresponding to the question description information based on the target language model if, for all reasoning paths, the depth value of the downward exploration of the city knowledge graph reaches the maximum exploration depth value, or the downward exploration reaches the last exploration node of the city knowledge graph and the second question-and-answer feedback has not been determined.

[0182] Based on the above technical solutions, the information merging module in the device is further used to: fill the question description information with the second question-and-answer feedback and then display it; or,

[0183] If the first question-and-answer feedback meets the preset conditions, the first question-and-answer feedback is filled into the question description information and then displayed.

[0184] The question-answering device based on urban knowledge graph provided in this embodiment of the invention can execute the question-answering method based on urban knowledge graph provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects for executing the question-answering method based on urban knowledge graph.

[0185] It is worth noting that in the above embodiments of the question-answering device based on urban knowledge graphs, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the scope of protection of the present invention.

[0186] Figure 9 This is a schematic diagram of a server structure provided in an embodiment of the present invention. Figure 9 A block diagram is shown of an exemplary electronic device 12 suitable for implementing embodiments of the present invention. Figure 9 The electronic device 12 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of the present invention.

[0187] like Figure 9 As shown, the electronic device 12 is represented in the form of a general-purpose computing device. The components of the electronic device 12 may include, but are not limited to: one or more processors or processing units 16, system memory 28, and bus 18 connecting different system components (including system memory 28 and processing unit 16).

[0188] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration bus, a processor or local bus using any of a variety of bus architectures. By way of example, these architectures include Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MCA) bus, Enhanced ISA (EISA) bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.

[0189] Electronic device 12 typically includes a variety of computer system readable media. These media can be any available media that is accessible by electronic device 12 and includes both volatile and non-volatile media, removable and non-removable media.

[0190] System memory 28 can include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. Electronic device 12 can further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 can be provided for reading from and writing to a non-removable, non-volatile magnetic media (e.g., a "hard drive"). Figure 9 not shown, is typically provided as residual storage across electronic device 12, and can be used for storing data that is both received as well as data that is generated by the processor 20. Although Figure 9 not shown, is typically provided as residual storage across electronic device 12, and can be used for storing data that is both received as well as data that is generated by the processor 20. Although

[0191] Program / utility 40 having a set (at least one) of program modules 42 can be stored in, for example, system memory 28 by way of example, such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data, each or some combination thereof, which can include implementation of the network environment. Program modules 42 generally carry out the functions and / or methodologies of embodiments of the present application as described herein.

[0192] The electronic device 12 can also communicate with one or more external devices 14 such as a keyboard, a pointing device, a display 24, etc.; other devices that enable a user to interact with the electronic device 12; and / or any devices (e.g., a network card, a modem, etc.) that enable the electronic device 12 to communicate with one or more other computing devices. Such communication can occur via the input / output (I / O) interface 22. Still yet, the electronic device 12 can communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or the Internet) through a network adapter 20. As depicted, the network adapter 20 communicates with the other components of the electronic device 12 through the bus 18. It should be appreciated that although the network adapter 20 is depicted as a single component, the network adapter 20 can comprise two or more components that operate together to facilitate communications with one or more networks. It is to be appreciated that while the example described above can be susceptible to various modifications and alternative forms, specific examples thereof have been shown by way of example in order to elucidate the embodiments of the present application and it should be understood that the intention is to cover all modifications, equivalents, and alternatives falling within the spirit and scope of the present application. For example, the whole apparatus can be implemented as a software program. Those skilled in the art will readily implement the steps of the methods given above using the techniques for making and using software programs that are known to them. The methods provided herein could be implemented via software, hardware or any combination thereof.

[0193] The processing unit 16 performs various function applications and data processing by running programs stored in the system memory 28, such as implementing the steps of the question and answer method based on the city knowledge graph provided in the first embodiment of the present application, which comprises:

[0194] receiving problem description information input by a user;

[0195] searching, based on a vector database corresponding to a city knowledge graph, first question and answer feedback associated with the problem description information, wherein the city knowledge graph is determined in combination with at least one event occurring in a target city, and the event corresponds to description text including at least time sequence information and spatial information.

[0196] Of course, those skilled in the art can understand that the processor can also implement the technical solutions of the question and answer method based on the city knowledge graph provided in any embodiment of the present application.

[0197] The present embodiment provides a computer readable storage medium having stored thereon a computer program, which, when executed by a processor, implements the steps of the question and answer method based on the city knowledge graph provided in the foregoing embodiments of the present application, which comprises:

[0198] receiving problem description information input by a user;

[0199] searching, based on a vector database corresponding to a city knowledge graph, first question and answer feedback associated with the problem description information, wherein the city knowledge graph is determined in combination with at least one event occurring in a target city, and the event corresponds to description text including at least time sequence information and spatial information.

[0200] The computer storage medium of the embodiments of the present application can adopt any combination of one or more computer readable media. The computer readable medium can be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium may, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any combination thereof. More specific examples (non-exhaustive list) of the computer readable storage medium include: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, the computer readable storage medium can be any tangible medium that contains or stores a program that can be used by or in connection with an instruction execution system, apparatus or device.

[0201] The computer readable signal medium can include a data signal propagated in baseband or propagated as a carrier wave, in which computer readable program code is embodied. Such propagated data signals can take a wide variety of forms, including but not limited to electro-magnetic signals, optical signals, or any suitable combination thereof. The computer readable signal medium can also be any computer readable medium that is not a storage medium, that is capable of storing the program for use by or in connection with the instruction execution system, apparatus or device.

[0202] The program code embodied on the computer readable medium can be transmitted using any appropriate medium, including but not limited to wireless, wire line, optical fiber cable, RF, etc., or any suitable combination of the above.

[0203] The computer program code for carrying out operations of the embodiments of the present application can be written in one or more programming languages or combinations of languages including an object oriented programming language such as Java, Smalltalk, C++ or the like and conventional procedural programming languages such as "C" or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).

[0204] Note that the above merely describes preferred embodiments of the present application and the principles of the technology applied. Those skilled in the art will understand that the present application is not limited to the specific embodiments described herein, and that various obvious changes, modifications and substitutions can be made thereto without departing from the scope of the present application. Therefore, although the present application has been described in detail through the above embodiments, the present application is not limited to the above embodiments, and can include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the claims.

Claims

1. A question-answering method based on urban knowledge graphs, characterized in that, include: Receive the problem description information input by the user; Based on a vector database corresponding to the city knowledge graph, a first question-and-answer response associated with the question description information is searched. The city knowledge graph is determined by combining at least one event that occurred in the target city, and the description text corresponding to the event includes at least temporal and spatial information.

2. The method according to claim 1, characterized in that, The method further includes: In response to an event where the first question-and-answer feedback does not meet preset conditions, at least one reasoning path is determined based on the question description information and the city knowledge graph; wherein, the reasoning path includes at least two related entities and an edge connecting the at least two related entities, the edge being used to characterize the entity relationship between the at least two related entities; Based on the at least one reasoning path, a second question-and-answer feedback associated with the question description information is determined and displayed.

3. The method according to claim 1, characterized in that, After receiving the problem description information input by the user, the method further includes: The problem description information is parsed to determine the query template corresponding to the problem description information; Based on the query template and the problem description information, a structured query statement is generated; The structured query statement is used to determine the first question and answer feedback.

4. The method according to claim 1, characterized in that, The process of searching for a first question-and-answer response associated with the question description information based on a vector database corresponding to the city knowledge graph includes: Based on the structured query statement corresponding to the problem description information, a vector search is performed on the embedded learning vectors stored in the vector database that correspond to the city knowledge graph; Based on the search results, a first question-and-answer response associated with the question description information is determined.

5. The method according to claim 2, characterized in that, The determination of at least one reasoning path based on the problem description information and the city knowledge graph includes: Obtain at least one initial entity from the problem description information; Based on the at least one initial entity, the city knowledge graph is queried to determine at least one first path related to the at least one initial entity; wherein the first path includes at least one associated entity; Based on the relevant attributes of the at least one initial entity corresponding to the at least one first path, at least one reasoning path is determined.

6. The method according to claim 2, characterized in that, The determination of the second question-and-answer feedback associated with the question description information based on the at least one reasoning path includes: For the at least one reasoning path, if at least one associated entity in the reasoning path includes a result to be used corresponding to the question description information, then the result to be used is used as the second question-and-answer feedback.

7. The method according to claim 2, characterized in that, The determination of the second question-and-answer feedback associated with the question description information based on the at least one reasoning path includes: For the at least one reasoning path, if the second question-and-answer feedback is not determined, the next path node is obtained from the last path node of the reasoning path in the city knowledge graph, and the reasoning path is updated based on the node information of the next path node, so as to determine the second question-and-answer feedback based on the updated reasoning path.

8. The method according to claim 7, characterized in that, The method further includes: For all reasoning paths, if the depth value of the downward exploration of the city knowledge graph reaches the maximum exploration depth value, or if the downward exploration reaches the last path node of the city knowledge graph and the second question-and-answer feedback is not determined, then the second question-and-answer feedback corresponding to the question description information is determined based on the target language model.

9. The method according to claim 2, characterized in that, The method further includes: The second Q&A feedback is then filled into the question description information and displayed; or... If the first question-and-answer feedback meets the preset conditions, the first question-and-answer feedback is filled into the question description information and then displayed.

10. A question-answering device based on a city knowledge graph, characterized in that, include: The problem description information receiving module is used to receive problem description information input by the user; The first question-and-answer feedback module is used to search for first question-and-answer feedback associated with the question description information based on a vector database corresponding to the city knowledge graph. The city knowledge graph is determined by combining at least one event that occurred in the target city, and the description text corresponding to the event includes at least temporal information and spatial information.

11. An electronic device, characterized in that, The electronic device includes: One or more processors; Memory, used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the question-answering method based on the city knowledge graph as described in any one of claims 1-9.

12. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by the processor, the program implements the question-answering method based on the city knowledge graph as described in any one of claims 1-9.

13. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the question-answering method based on the city knowledge graph as described in any one of claims 1-9.

Citation Information

Patent Citations

  • Question and answer retrieval method and device, electronic equipment and storage medium

    CN119377354A

  • Knowledge graph-based traffic engineering large model intelligent question-answering system and method

    CN120407752A

  • Government affair policy question and answer method based on knowledge graph and related equipment

    CN120849569A

  • Knowledge graph question-answer method and apparatus based on deep learning technology, and device

    WO2021139283A1