Fuzzy query method, apparatus, device, medium and program product

By acquiring user query statements and interacting with external knowledge bases for matching and hierarchical feature fusion, and utilizing the Transformer encoder and multi-task learning framework, the problems of polysemy and context dependence in existing technologies are solved, and more accurate and flexible multi-dimensional query results are achieved.

CN121051222BActive Publication Date: 2026-02-13AEROSPACE INFORMATION RES INST CAS
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511188658.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-25
Publication Date
2026-02-13
Estimated Expiration
2045-08-25

AI Technical Summary

Technical Problem

Existing hot topic clustering and multi-dimensional fuzzy query methods suffer from misjudgment or omission when handling complex queries, resulting in inaccurate or incomplete query results, especially when dealing with polysemous words, metaphors, and context-dependent semantics, which are difficult to understand accurately.

Method used

By acquiring user-input query statements and multi-source heterogeneous text data, interactive matching is performed using an external knowledge base to generate knowledge-enhanced semantic representation vectors. Hierarchical feature fusion is then performed, and a Transformer encoder is used to aggregate word-level, sentence-level, and document-level features layer by layer. Intent recognition and slot extraction are then performed through a multi-task learning framework to generate spatiotemporal retrieval conditions, and finally, retrieval parsing results are output.

Benefits of technology

It improves the accuracy and flexibility of query results, better understands user intent, provides more comprehensive and accurate query results, and adapts to multi-dimensional query needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121051222B_ABST
    Figure CN121051222B_ABST
Patent Text Reader

Abstract

The present disclosure provides a fuzzy query method, which can be applied to the field of artificial intelligence technology. The method comprises: acquiring a query statement input by a user and multi-source heterogeneous text data; interacting and matching the query statement with an external knowledge base to generate a knowledge-enhanced semantic representation vector; performing hierarchical feature fusion on the semantic representation vector and the multi-source heterogeneous text data to obtain text representation with fused knowledge features, wherein the hierarchical feature fusion comprises layer-by-layer aggregation of word-level, sentence-level and document-level features through a Transformer encoder; inputting the text representation with fused knowledge features into a multi-task learning framework for intent recognition and slot extraction to obtain a structured query understanding result; generating a time-space retrieval condition according to time entities and geographic location entities in the structured query understanding result, and outputting a corresponding retrieval analysis result. The present disclosure also provides an event cognitive reasoning device, equipment, storage medium and program product.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of artificial intelligence, and more particularly to a fuzzy query method, device, equipment, medium and program product. BACKGROUND

[0002] Although the existing hotspot event clustering tracking and multi-dimensional fuzzy query method has achieved certain results in practical application, there are still some problems and challenges. For semantic understanding, semantic understanding in natural language processing still has challenges, especially when dealing with polysemous words, metaphors and context-dependent semantics. This may lead to inaccurate or incomplete query results, and fuzzy matching may misjudge or miss the case when dealing with complex queries, affecting the quality of the query results. SUMMARY

[0003] In view of the above problems, the present application provides a fuzzy query method, device, equipment, medium and program product.

[0004] According to a first aspect of the present application, a fuzzy query method is provided, the method comprising:

[0005] obtaining a query sentence input by a user and multi-source heterogeneous text data;

[0006] interactively matching the query sentence with an external knowledge base to generate a knowledge-enhanced semantic representation vector;

[0007] performing hierarchical feature fusion on the semantic representation vector and the multi-source heterogeneous text data to obtain a text representation with fused knowledge features, wherein the hierarchical feature fusion includes aggregating word-level, sentence-level and document-level features layer by layer through a Transformer encoder;

[0008] inputting the text representation with fused knowledge features into a multi-task learning framework to perform intent recognition and slot extraction, and obtaining a structured query understanding result;

[0009] generating a spatio-temporal retrieval condition according to the time entity and the geographic location entity in the structured query understanding result, and outputting a corresponding retrieval analysis result.

[0010] According to the present disclosure, the interactive matching of the query sentence with the external knowledge base to generate a knowledge-enhanced semantic representation vector comprises:

[0011] mapping the words in the query sentence to low-dimensional dense vector representations to generate a word embedding sequence;

[0012] performing context semantic encoding on the word embedding sequence through a bidirectional long short-term memory network to obtain a text representation containing context information;

[0013] extracting inter-word relations of words in the query sentence from an external knowledge base, constructing an inter-word relation matrix, the inter-word relations including synonym, antonym, hypernym, hyponym, and hyponym relation;

[0014] calculating a semantic similarity matrix between the query sentence and candidate knowledge entries in the external knowledge base;

[0015] dynamically weighting and fusing the inter-word relation matrix and the semantic similarity matrix to generate knowledge-enhanced attention weights;

[0016] interactively weighting the text representation vector according to the knowledge-enhanced attention weights to obtain a knowledge-enhanced semantic representation vector.

[0017] According to the embodiments of the present disclosure, the hierarchical feature fusion of the semantic representation vector and the multi-source heterogeneous text data to obtain the text representation with fused knowledge features includes:

[0018] taking the knowledge-enhanced semantic representation vector as an initial input, and introducing associated text segments in the external knowledge base and user historical query logs as multi-source heterogeneous text data;

[0019] performing parallel convolution operations on the initial input and the multi-source heterogeneous text data to extract local features at word, phrase, and sentence levels, respectively;

[0020] splicing output feature maps of each convolution layer in the channel dimension through a dense connection mechanism to form cross-scale fusion features, the dense connection satisfying that the input of the nth convolution layer contains the output features of all the previous n-1 convolution layers;

[0021] calculating feature importance weights of each text position in the cross-scale fusion features based on a self-attention mechanism;

[0022] performing weighted global average pooling on the cross-scale fusion features according to the feature importance weights to generate a text representation vector with a fixed dimension;

[0023] outputting probability distributions of each predefined category based on the text representation vector, the predefined categories being constructed based on the domain ontology of the external knowledge base and containing fine-grained labels related to knowledge;

[0024] taking the fine-grained category corresponding to the maximum probability as the text representation with fused knowledge features.

[0025] According to the embodiments of the present disclosure, the consciousness recognition branch and the slot extraction branch of the multi-task learning framework, the input of the text representation with fused knowledge features into the multi-task learning framework for intent recognition and slot extraction to obtain a structured query understanding result includes:

[0026] inputting the text representation of the fused knowledge features through a hybrid encoder to generate a context-aware sequence representation;

[0027] inputting the context-aware sequence representation into the intent recognition branch to output an intent category result of the query statement;

[0028] inputting the context-aware sequence representation into the slot extraction branch to identify slot labels of words in the query statement and generate an entity sequence;

[0029] combining the intent category result and the entity sequence into a structured query logical form to obtain a structured query understanding result.

[0030] According to embodiments of the present disclosure, the generating a spatio-temporal retrieval condition according to the time entity and the geographic location entity in the structured query understanding result, and outputting a corresponding retrieval resolution result comprises:

[0031] extracting a time entity and a geographic location entity from the structured query understanding result;

[0032] standardizing the geographic location entity to obtain a standardized geographic location entity;

[0033] generating a spatio-temporal retrieval condition based on the time entity and the standardized geographic location entity;

[0034] inputting the spatio-temporal retrieval condition into a spatio-temporal knowledge base for retrieval to output a retrieval resolution result.

[0035] According to embodiments of the present disclosure, the hybrid encoder is composed of a shared bidirectional long short-term memory network and a self-attention mechanism, the output dimension of the hybrid encoder is consistent with the dimension of the text representation vector, and the original knowledge features are retained through residual connection.

[0036] A second aspect of the present application provides a fuzzy query device, the device comprising:

[0037] an acquisition module configured to acquire a query statement input by a user and multi-source heterogeneous text data;

[0038] a matching module configured to interactively match the query statement with an external knowledge base to generate a knowledge-enhanced semantic representation vector;

[0039] a fusion module configured to hierarchically fuse the semantic representation vector and the multi-source heterogeneous text data to obtain a text representation of fused knowledge features, wherein the hierarchical feature fusion comprises aggregating word-level, sentence-level and document-level features layer by layer through a Transformer encoder;

[0040] The input module is configured to input the text representation of the fused knowledge features into a multi-task learning framework for intent recognition and slot extraction to obtain a structured query understanding result.

[0041] The generation module is configured to generate a spatio-temporal retrieval condition according to a time entity and a geographic location entity in the structured query understanding result, and output a corresponding retrieval resolution result.

[0042] The third aspect of the present application provides an electronic device, comprising: one or more processors; a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the method.

[0043] The fourth aspect of the present application further provides a computer-readable storage medium having stored thereon a computer program or instructions, wherein the computer program or instructions are executed by a processor to implement the steps of the method.

[0044] The fifth aspect of the present application further provides a computer program product comprising a computer program or instructions, wherein the computer program or instructions are executed by a processor to implement the steps of the method. BRIEF DESCRIPTION OF DRAWINGS

[0045] The above and other objects, features and advantages of the present application will become more apparent from the following description of embodiments of the present application, taken in conjunction with the accompanying drawings, in which:

[0046] Figure 1 An application scenario diagram of the fuzzy query method, device, equipment, medium and program product according to the embodiments of the present application is schematically shown;

[0047] Figure 2 A flowchart of the fuzzy query method according to the embodiments of the present application is schematically shown;

[0048] Figure 3 A structural block diagram of the fuzzy query device according to the embodiments of the present application is schematically shown; and

[0049] Figure 4 A block diagram of an electronic device suitable for implementing the fuzzy query method according to the embodiments of the present application is schematically shown. DETAILED DESCRIPTION

[0050] Hereinafter, embodiments of the present application will be described with reference to the accompanying drawings. It should be understood, however, that the description is merely exemplary of the present application, and is not intended to limit the scope of the present application. In the following detailed description of the embodiments of the present application, numerous specific details are set forth in order to provide a thorough understanding of the present application. However, it will be apparent to one skilled in the art that the present application can be practiced without these specific details. In other instances, well-known structures and functions have not been described in detail in order to avoid obscuring aspects of the present application.

[0051] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the present application. As used herein, the term "includes" and tautological expressions thereof, such as "including," "includes," "include," "contains," "containing," and so forth, shall be read expansively and without limitation. The terms "comprising," "comprise" and / or "comprised of," and tautological expressions thereof (e.g., "comprising of") will be construed to be inclusive (i.e., to mean "including, but not limited to"), unless otherwise indicated.

[0052] All terms used herein including technical and scientific terms have the same meanings as commonly understood by one of ordinary skill in the art unless otherwise defined herein. It should be noted that the terms used herein are merely specific examples for the described embodiments and should not be limiting, and should also be interpreted in the context of the entire specification and claims.

[0053] In the case of using expressions similar to "at least one of A, B, and C, etc.", it is generally construed that the expression means to include at least one of the items, but does not mean to the exclusion of the others. In other words, the expression "at least one of A, B, and C, etc." should be construed to mean to include at least one of A, B, or C, etc., but not excluding the possibility of including all of them at the same time.

[0054] In the technical solutions of the present application, the user information (including but not limited to user personal information, user image information, user equipment information, such as location information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved are information and data authorized by the user or authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of related data comply with relevant laws, regulations and standards, necessary security measures are taken, do not violate public order and good customs, and provide corresponding operation portal for user to choose authorization or refusal.

[0055] In the scenario of making automated decisions by using personal information, the method, device and system provided by the embodiments of the present application all provide corresponding operation entrances for the user to select to agree or reject the automated decision result; if the user selects to reject, the expert decision process is entered. The expression "automated decision" here refers to the activity of making decisions by automatically analyzing and evaluating the personal behavior habits, interests and hobbies, or economic, health and credit conditions, etc. by a computer program. The expression "expert decision" here refers to the activity of making decisions by personnel who are engaged in a certain field of work, have special experience, knowledge and skills and reach a certain professional level.

[0056] Figure 1 An application scenario diagram of the automated event extraction method, apparatus, device, medium and program product according to the embodiments of the present application is schematically shown.

[0057] As shown in Figure 1 , the application scenario 100 according to the embodiments can include a terminal device 101, a second terminal device 102, a third terminal device 103, a network 104 and a server 105. The network 104 is used as a medium to provide a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103 and the server 105. The network 104 can include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0058] The user can use the first terminal device 101, the second terminal device 102 and the third terminal device 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications can be installed on the first terminal device 101, the second terminal device 102 and the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as examples).

[0059] The first terminal device 101, the second terminal device 102 and the third terminal device 103 can be various electronic devices with display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers and desktop computers, etc.

[0060] The server 105 can be a server providing various services, such as a background management server supporting the website browsed by the user using the first terminal device 101, the second terminal device 102 and the third terminal device 103 (only as an example). The background management server can analyze and process the received user request data, etc., and feed back the processing result (such as a web page, information or data, etc. obtained or generated according to the user request) to the terminal device.

[0061] It should be noted that the method provided by the embodiments of the present application can be generally executed by the server 105. Correspondingly, the apparatus provided by the embodiments of the present application can be generally arranged in the server 105. The method provided by the embodiments of the present application can also be executed by a server or a server cluster different from the server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105. Correspondingly, the apparatus provided by the embodiments of the present application can also be arranged in a server or a server cluster different from the server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105.

[0062] It should be understood that Figure 1 The number of terminal devices, networks and servers in the above-mentioned system is only illustrative. According to the needs of implementation, there can be any number of terminal devices, networks and servers.

[0063] Fuzzy query algorithm: Fuzzy query technology allows users to use fuzzy keywords or phrases when querying to obtain more extensive search results. These algorithms provide users with more flexible query methods through fuzzy matching and similarity calculation.

[0064] Multi-dimensional query: Multi-dimensional fuzzy query technology allows users to query from multiple dimensions, such as time, location, and characters. This query method can more comprehensively cover the user's query needs, improving the accuracy and efficiency of the query.

[0065] Semantic understanding: The semantic understanding capability in natural language processing technology enables the system to better understand the user's query intent, thereby providing more accurate query results. Semantic understanding technology combined with fuzzy query can further improve the flexibility and accuracy of the query.

[0066] Events have a wide range of sources, are characterized by multiple languages and multiple categories, and the relationships between different events are complex. Cross-domain text matching technology based on multi-source data is a technology for processing two or more natural language texts to exhibit the semantic relationship between texts in the form of text similarity and relevance. It is a core support in natural language application systems and an important basic technology for event clustering and spatio-temporal retrieval. Text matching technology includes:

[0067] Multivariate word matching: Different words may represent the same semantics, and the same word may have different semantics in different contexts.

[0068] Structural phrase matching: Multiple words can be combined into phrases according to certain structures, and matching two phrases requires considering the structural information of the phrases.

[0069] Hierarchy of text matching: Text is organized in a hierarchical manner, with words forming phrases, phrases forming sentences, sentences forming paragraphs, and paragraphs forming chapters. This characteristic requires considering matching information at different levels when performing text matching, and organizing text matching information in a hierarchical manner.

[0070] Text classification technology is a technology that uses computers to automatically classify and label text according to certain classification systems or standards. In the face of the explosive growth of event information, classifying and managing it according to predefined event types is beneficial for people to discover some urgent events in time and take timely measures.

[0071] The following will be based on Figure 1 The scenario described, through Figure 2 The fuzzy query method according to the embodiments of the present application is described in detail.

[0072] Figure 2 The flowchart of the fuzzy query method according to the embodiments of the present application is schematically shown.

[0073] As Figure 2 shown, the fuzzy query method of this embodiment includes operation S210~operation S240.

[0074] In operation S210, the query statement input by the user and the multi-source heterogeneous text data are obtained.

[0075] According to the embodiments of the present application, the query statement input by the user can be the text content input by the user to obtain specific information, which can be a question, instruction or requirement described in natural language. For example, the user may input a query statement such as "find traffic accidents that occurred in the past week near Haidian District, Beijing", expressing the user's intention to obtain information related to a specific time (the past week), a specific geographic location (near Haidian District, Beijing), and a specific event (traffic accident).

[0076] According to the embodiments of the present application, "multi-source" in multi-source heterogeneous text data means that these text data come from multiple different data sources, such as news websites, social media platforms, government open databases, and enterprise internal documents. "Heterogeneous" means that these text data differ in structure, format, semantics, etc. For example, text data on news websites may have a relatively standardized news reporting structure, including title, body, time, location, etc. While text data on social media platforms may be more casual, containing a large number of internet slang, emoticons, etc., and having an unstable structure. The purpose of obtaining these multi-source heterogeneous text data is to mine information related to the user's query from them.

[0077] In operation S220, the query statement is interactively matched with an external knowledge base to generate a knowledge-enhanced semantic representation vector.

[0078] According to an embodiment of the present application, the external knowledge base can be a pre-constructed database containing a large amount of structured or semi-structured knowledge. These knowledge can cover various fields, such as geographic information, historical events, scientific common sense, professional term explanation, etc. For example, the geographic information knowledge base may contain the location information of cities, regions, countries, administrative divisions, etc. in the world; the scientific common sense knowledge base may contain the basic principles and explanations of various physical, chemical, biological phenomena.

[0079] According to an embodiment of the present application, interactive matching can be the process of comparing and associating the user input query statement with the knowledge in the external knowledge base through specific algorithms and techniques. For example, when the user query statement contains "Haidian District", the interactive matching process may find the detailed information of "Haidian District" in the geographic information knowledge base, such as its belonging to Beijing, geographic location coordinates, area, population, etc., and associate these relevant information with the query statement.

[0080] According to an embodiment of the present application, the knowledge-enhanced semantic representation vector can be a vector representation form generated by enhancing and enriching the semantics of the query statement with the matched external knowledge after the interactive matching. This vector representation can capture the core semantics of the query statement and the related external knowledge information, making the computer better understand and process the query statement. For example, by fusing the query statement with the geographic information, time concept, etc. knowledge in the external knowledge base, the generated semantic representation vector can more accurately express the time range and geographic location requirements of the user query.

[0081] In operation S230, the semantic representation vector is hierarchically fused with the multi-source heterogeneous text data to obtain a text representation with fused knowledge features.

[0082] According to an embodiment of the present application, hierarchical feature fusion can be a method of integrating text features at different levels, aiming to extract and utilize information in the text from multiple dimensions to obtain a more comprehensive and accurate text representation.

[0083] According to an embodiment of the present application, the Transformer encoder is a deep learning model architecture based on self-attention mechanism, which can extract and convert features of input sequence data, and capture the dependency relationship between different position elements in the sequence through self-attention mechanism.

[0084] According to an embodiment of the present application, the word-level feature refers to processing each word in the multi-source heterogeneous text data and extracting its basic semantic, grammatical, and other information. For example, each word is converted into a vector representation through word embedding technology, and these vectors can reflect the semantic similarity and grammatical function of the word. The bottom layer of the Transformer encoder mainly focuses on word-level feature extraction and interaction, and calculates the correlation between each word and other words through the self-attention mechanism, thereby capturing the meaning of the word in the local context.

[0085] According to an embodiment of the present application, the sentence-level feature refers to further aggregating word information to form a sentence-level feature representation on the basis of the word-level feature. The middle layer of the Transformer encoder integrates and analyzes the word-level feature, considers the position, grammatical structure, and semantic relationship of the word in the entire sentence, and generates a vector representation that can represent the semantic of the entire sentence. For example, by analyzing the logical relationship and semantic coherence between the words in the sentence, the core theme and key information of the sentence are extracted.

[0086] According to an embodiment of the present application, the document-level feature refers to aggregating the sentence-level feature to form a document-level feature representation. The high layer of the Transformer encoder comprehensively processes the features of multiple sentences, considers the order, theme consistency, and context relationship between the sentences, and generates a vector representation that can represent the semantic of the entire document. For example, for a document containing multiple paragraphs, by analyzing the logical structure and theme evolution between the paragraphs, the overall theme and key points of the document are extracted.

[0087] According to an embodiment of the present application, the text representation fused with knowledge features can be a combination of the text representation obtained after the hierarchical feature fusion and the previously generated knowledge-enhanced semantic representation vector, so that the final text representation not only contains the hierarchical features of the multi-source heterogeneous text data itself, but also incorporates relevant information from the external knowledge base, thereby improving the accuracy and richness of the text representation

[0088] In operation S240, the text representation fused with knowledge features is input into a multi-task learning framework for intent recognition and slot extraction, and a structured query understanding result is obtained.

[0089] According to an embodiment of the present application, the multi-task learning framework is a machine learning paradigm that allows the model to learn multiple related tasks simultaneously, improves the generalization ability and learning efficiency of the model by sharing model parameters and feature representations. In the query understanding task, intent recognition and slot extraction are two closely related but different tasks.

[0090] According to an embodiment of the present application, the intent recognition can determine the core purpose or intent of the user query. For example, for the query sentence "find traffic accidents that occurred in the past week near Haidian District, Beijing City", the intent recognition task needs to determine that the user's intent is "query traffic accident information". By inputting the text representation fused with knowledge features into the multi-task learning framework, the model can utilize the semantic information in the text and external knowledge to accurately identify the user's intent.

[0091] According to an embodiment of the present application, slot filling is to extract key information related to the intent from the user query sentence and fill these information into the predefined slots. For example, in the above query sentence, the slot filling task needs to identify that the "time slot" is "past week" and the "geographical location slot" is "near Haidian District, Beijing City". The multi-task learning framework can simultaneously learn the intent recognition and slot filling tasks, and improve the performance of the two tasks by sharing model parameters and feature representations.

[0092] According to an embodiment of the present application, the structured query understanding result is the result after intent recognition and slot filling, which is presented in a structured form and usually includes the intent label and each slot and its corresponding filling value. For example, the structured query understanding result can be represented as: { "intent": "query traffic accident information", "time": "past week", "geographical location": "near Haidian District, Beijing City"}. This structured representation facilitates subsequent information retrieval and processing.

[0093] In operation S250, according to the time entity and the geographical location entity in the structured query understanding result, a spatio-temporal retrieval condition is generated, and a corresponding retrieval resolution result is output.

[0094] According to an embodiment of the present application, the time entity and the geographical location entity refer to information related to time and geographical location extracted from the structured query understanding result. For example, in the above structured result, "past week" is a time entity and "near Haidian District, Beijing City" is a geographical location entity.

[0095] According to an embodiment of the present application, the spatio-temporal retrieval condition refers to a condition constructed according to the extracted time entity and geographical location entity for retrieval in multi-source heterogeneous text data. For example, the spatio-temporal retrieval condition can be represented as "time range: past week; geographical location range: near Haidian District, Beijing City".

[0096] According to an embodiment of the present application, the retrieval and analysis result refers to retrieving in multi-source heterogeneous text data by using the constructed spatio-temporal retrieval condition, and outputting the retrieved relevant information after collation and analysis. For example, the retrieval and analysis result can include detailed reports of traffic accidents occurring in the past week near Haidian District, Beijing, relevant statistical data, etc., in a form easy for users to understand, such as a text list, a chart, etc.

[0097] In some embodiments of the present disclosure, the words in the query sentence can be mapped to a low-dimensional dense vector representation to generate a word embedding sequence; the word embedding sequence is encoded by a bidirectional long short-term memory network to obtain a text representation containing context information; the inter-word relationships of the words in the query sentence are extracted from an external knowledge base to construct an inter-word relationship matrix, and the inter-word relationships include synonym, antonym, hypernym, hyponym, and co-hyponym relationships; a semantic similarity matrix between the query sentence and candidate knowledge entries in the external knowledge base is calculated, and the inter-word relationship matrix is dynamically weighted to generate knowledge-enhanced attention weights; the inter-word relationship matrix and the semantic similarity matrix are dynamically weighted and fused to generate knowledge-enhanced attention weights; and the text representation vector is interactively weighted according to the knowledge-enhanced attention weights to obtain a knowledge-enhanced semantic representation vector.

[0098] First, each word in the query sentence is mapped to a low-dimensional dense vector representation, which is called word embedding. Word embedding can map words to a continuous vector space, so that semantically similar words are close in the vector space. Through this step, the query sentence is converted into a series of word embedding vectors, i.e., a word embedding sequence.

[0099] Next, a bidirectional long short-term memory network (BiLSTM) is used to encode the context semantics of the word embedding sequence. BiLSTM can consider the information before and after the word in the sentence, so as to obtain a text representation containing more rich context information.

[0100] In one example, as shown in Figure 2 , suppose there are two texts a and b with lengths m and n respectively. First, word embedding is performed to map each word to a low-dimensional space to obtain and . Then, a bidirectional LSTM network is used to encode the context information, and the forward and backward encoding results are spliced to obtain and .

[0101] For the above encoding results, external knowledge and adopt text interaction based on attention mechanism: first, calculate the similarity of two texts

[0102]

[0103] where is a 5-dimensional vector, which represents the words in text 1 and text 2 whether to meet the synonym, antonym, hypernym, hyponym, and same hyponym relationship, if the relationship between the two words is met, it is 1, otherwise it is 0. And is a 5-dimensional vector, which represents the words in text 1 is a 5-dimensional vector, which represents the words in text 1

[0104] Then normalize the similarity to get and . Then take the normalized probability as the weight, and perform weighted summation on the other text to get and .

[0105] After the text interaction is completed, the features obtained by the interaction, external knowledge and the original text representation need to be fused in a splicing manner to get the following results

[0106]

[0107]

[0108] Then, the fused features are input into the combination layer. The combination layer uses bidirectional LSTM to get and .

[0109] Finally, use max pooling mechanism to extract the above combined features, and input the extracted results into the task-related output layer to get the final text matching result, that is, the text representation containing context information.

[0110] At the same time, extract the inter-word relationships between the words in the query statement from the external knowledge base (such as electronic dictionaries such as WordNet), which include but are not limited to synonym, antonym, hypernym, hyponym, and same hyponym relationship. According to these relationships, a word relationship matrix is constructed to represent the semantic connection between words.

[0111] A semantic similarity matrix between the query sentence and the candidate knowledge entries in the external knowledge base is calculated. This matrix reflects the similarity between each word in the query sentence and the relevant entries in the external knowledge base. Subsequently, the semantic similarity matrix is dynamically weighted in combination with the inter-word relationship matrix. The inter-word relationship information in the external knowledge base can be used to adjust the calculation of semantic similarity, making the result more accurate and comprehensive.

[0112] By dynamically weighting and fusing the inter-word relationship matrix and the semantic similarity matrix, knowledge-enhanced attention weights are generated. These weights reflect the importance of different words in the query sentence to the overall semantic representation when considering external knowledge.

[0113] Finally, according to the generated knowledge-enhanced attention weights, the previously obtained text representation vectors containing context information are interactively weighted. The purpose of this step is to use the attention mechanism to highlight the parts of the query sentence that are closely related to the information in the external knowledge base, thereby obtaining a more accurate and comprehensive knowledge-enhanced semantic representation vector.

[0114] In one example, as shown in Figure 4 , for text q and p, first, the same word vector embedding is performed on the text, and a bidirectional LSTM is used for context encoding to obtain and . Then four different attention interaction methods are used to realize the interaction between texts:

[0115] Concatenation type attention interaction:

[0116]

[0117]

[0118]

[0119] Bilinear attention interaction:

[0120]

[0121]

[0122]

[0123] Multiplication type attention interaction:

[0124]

[0125]

[0126]

[0127] Subtraction attention interaction:

[0128]

[0129]

[0130]

[0131] After obtaining the interaction results of different ways, the various interaction results need to be fused: first, the feature fusion within the same way, the original representation in the text p is spliced with the results of the four interactions respectively, four groups of vectors are obtained, and the bidirectional LSTM is used again for encoding. Then the feature fusion of different interaction methods is fused, the attention mechanism is used again here, through training, different weights are given to different interaction results, and then the four interaction features are weighted and summed. Finally, the fused information is again passed through the bidirectional LSTM network, so that the sequence features are fully interacted.

[0132] For the text q, first use the self-attention mechanism to get the weighted representation , and select the important part of the fused information of the text p with to get , and finally connect a task-related output layer to get the final text matching result. The model takes the integration of the two, which can embed more information, and can make the information fully interact, so that the robustness and applicability of the model are strengthened.

[0133] In some embodiments of the present disclosure, the knowledge-enhanced semantic representation vector can be used as an initial input, and the associated text segments in the external knowledge base and the user historical query log can be introduced as multi-source heterogeneous text data; the initial input and the multi-source heterogeneous text data are subjected to parallel convolution operation, and the local features of the word level, phrase level and sentence level are extracted respectively; the output feature maps of each convolution layer are spliced in the channel dimension through the dense connection mechanism to form the cross-scale fusion features, and the dense connection satisfies that the input of the nth layer convolution contains the output features of all the previous n-1 convolution layers; the feature importance weight of each text position in the cross-scale fusion feature is calculated based on the self-attention mechanism; the cross-scale fusion features are weighted and globally averaged pooled according to the feature importance weight, and a fixed-dimensional text representation vector is generated; based on the text representation vector, the probability distribution of each predefined category is output, the predefined category is constructed based on the domain ontology of the external knowledge base, and contains the fine-grained label of knowledge association; the fine-grained category corresponding to the maximum probability is taken as the text representation of the fused knowledge features.

[0134] Multi-source heterogeneous text data includes two types of data: related text segments from external knowledge bases: structured knowledge such as synonyms, antonyms, and hyponyms in WordNet related to the query; user historical query logs: record past user query behavior, provide context and preference information, and enhance personalized text representation.

[0135] Word-level feature extraction can capture local semantic relationships between words through small convolution kernels (e.g., 3x3), such as the impact of synonym replacement on sentence meaning.

[0136] Phrase-level feature extraction can use medium convolution kernels (e.g., 5x5) to identify phrase structures such as verb phrases or noun phrases, preserving the syntax and semantic information within the phrase.

[0137] Sentence-level feature extraction can use large convolution kernels (e.g., 7x7) to capture the overall semantics of a sentence, such as understanding the core intent of the sentence through long-distance dependencies.

[0138] Parallel processing refers to the simultaneous execution of three groups of convolution operations, respectively outputting word-level, phrase-level, and sentence-level feature maps, preserving semantic information at different granularities.

[0139] Cross-layer connections can include all feature maps from the previous n-1 layers as input to the nth layer (e.g., the 3rd layer input includes the output of the 1st and 2nd layers), achieving information flow through channel dimension concatenation.

[0140] Cross-scale fusion can be the concatenation of features from word, phrase, and sentence levels, forming a more comprehensive text representation. For example, the combination of synonym relationships (word level) and phrase structures (phrase level) can more accurately determine text similarity.

[0141] Feature importance calculation can be a self-attention mechanism that assigns weights to each position in the cross-scale fusion feature, highlighting key semantic information (e.g., event core entities).

[0142] Weighted pooling can be a global average pooling of feature maps with weights, generating a fixed-dimensional vector to avoid information loss.

[0143] Domain ontology construction can be based on domain knowledge (e.g., technology, politics) from external knowledge bases to define pre-defined categories, each containing fine-grained labels (e.g., "electronic products - smartphones"). Probability distribution output is calculated by the Softmax function to determine the probability of the text belonging to each fine-grained category, such as determining whether the text belongs to "technology - electronic products" or "entertainment - movies".

[0144] The maximum probability class selection can be to select the fine-grained label with the highest probability as the final text representation. For example, if the probability of "iPhone 15 release" is the highest, the text representation is "technology-electronic products-smartphone". The knowledge association enhancement can be the association of the fine-grained label with the external knowledge base ontology, supporting more accurate query expansion (such as expanding "iPhone" to "Apple" related events).

[0145] In an example, text classification based on a dense connection multi-scale convolutional neural network, a convolutional neural network plays a crucial role in text classification technology due to its good ability to extract local information. The introduction of a multi-scale convolutional neural network can better depict different levels of text information in a text in order to obtain more rich text features from multi-level text information. Text classification based on a dense connection multi-scale convolutional neural network can be divided into the following specific steps:

[0146] Text multi-scale information extraction: Given a text to be classified, first map each word in the text to a dense vector representation using a pre-trained word vector representation. Assume that a text contains m words, the text can be represented as X = [x_1, x_1, …, x_m]. As shown in the figure above, the mapped text will pass through multiple stacked convolutional neural networks, and each layer of convolutional neural network can be formulated as X_l = f(W_l, X_(l-1)), where f(·) includes three consecutive operations of convolution, batch normalization and Relu nonlinear activation function. The word-level information can be extracted at the bottom of the network, and the deep semantic information can be extracted at the top of the network. Further, the dense connection between each convolutional layer (which can be formulated as X_l = f(W_l, 〖[X〗_1, X_2, 〖…,X〗_(l-1)])) can establish cross-layer connections between bottom features and high-level features, achieving multi-level and multi-scale information extraction.

[0147] Text multi-scale information integration and fusion based on attention mechanism: Attention mechanism originates from the study of human vision. In cognitive science, due to the bottleneck of information processing, humans selectively focus on a part of all information while ignoring other visible information. Attention mechanism mimics the human way of thinking to capture the most discriminative information and has been widely used in various fields of deep learning in recent years. In this method, attention mechanism will be used to filter and fuse multi-scale information to extract the most discriminative text features.

[0148] In some embodiments of the present disclosure, the multi-task learning framework includes an intent recognition branch and a slot extraction branch. The text representation fused with knowledge features can be input through a hybrid encoder to generate a context-aware sequence representation; the context-aware sequence representation can be input into the intent recognition branch to output an intent category result of the query statement; the context-aware sequence representation can be input into the slot extraction branch to identify slot labels of each word in the query statement and generate an entity sequence; the intent category result and the entity sequence can be combined into a structured query logical form to obtain a structured query understanding result.

[0149] The word vector embedding layer can convert text into dense vectors using pre-trained word vectors (such as Word2Vec) to capture semantic correlations between words. The bidirectional recurrent network layer can use a bidirectional LSTM or GRU network to contextually encode the word vector sequence to generate a sequence representation containing information about the context before and after. The attention mechanism layer can introduce a self-attention mechanism (such as the scaled dot-product attention of Transformer) to dynamically adjust the weights of each position in the sequence and highlight key semantic information (such as the core entities of an event).

[0150] The context-aware sequence representation is in the form of a vector sequence, with each vector corresponding to a word or clause in the text.

[0151] In the intent branch, the task objective can be to determine the intent type of the query statement (such as "query ship location" and "find the number of ships in the port" predefined event types). The corresponding model structure includes a fully connected layer and a Softmax classifier. The fully connected layer is used to average pool or max pool the sequence representation output by the hybrid encoder to generate a fixed-dimension feature vector. The Softmax classifier is used to calculate the probability of the query belonging to each intent category through the fully connected layer and the Softmax function, and outputs the category with the highest probability as the result. Example: input query: "Where is the position of the Enterprise aircraft carrier at 2 pm this afternoon?" Output intent: "query ship location".

[0152] In the slot extraction branch, the task objective can be to label the slot types of each word in the query statement (such as ship name, time, location, etc.) and extract the entity sequence. The corresponding model structure includes a sequence labeling layer, slot label definition, and entity sequence generation. Sequence labeling layer: uses conditional random field (CRF) or BiLSTM-CRF model to label each word of the sequence representation output by the hybrid encoder. Slot label definition is used to define slot types based on the domain ontology of external knowledge base (such as military, transportation), for example: ship name: Enterprise, aircraft carrier time: today, 2 pm; location: port. Entity sequence generation is used to combine the labeled slot labels into a structured entity sequence, for example: entity sequence: [ship = Enterprise, ship type = aircraft carrier, time = today 2 pm].

[0153] The combination manner of the structured query logic form can splice the intent recognition result and the slot extraction result into the structured query logic form, for example: intent: "query the position of the ship"; slot sequence: [ship = Enterprise, time = 2 o'clock this afternoon]; structured query: "query the position of the ship 'Enterprise' at 2 o'clock this afternoon". The output result is to generate a query logic that can be directly executed by a retrieval system, supporting efficient retrieval of space-time events.

[0154] In an example, event retrieval under a space-time framework requires in-depth structured understanding of the query content, and the main part of the understanding includes query intent and slot. The query intent represents the purpose of event retrieval, such as "query the position of the ship", "find the number of ships in the port", and other predefined event types, and the slot is a restriction on the query for more detailed retrieval, such as ship hull number, time, location, etc. The main benefit of joint extraction of query intent and slot based on multi-task learning is that a part of information can be shared between the two related tasks. When the data volume is small or the task is complex, this information sharing mechanism can better utilize the labeled information and make the model more robust. As shown in Table 1.

[0155] Table 1

[0156]

[0157] The input query sentence can be segmented into a sequence of words using a Chinese word segmentation tool, and then the word sequence is encoded into corresponding word ids using a predefined word table, and then mapped into word vectors using Word2vec. Word2vce is a pre-trained word vector, which has the advantage of being able to learn the semantic correlation between words. Related words have greater similarity in vector space, thereby improving the generalization performance of the model.

[0158] In some embodiments of the present disclosure, the hybrid encoder is composed of a shared bidirectional long short-term memory network and a self-attention mechanism. The output dimension of the hybrid encoder is consistent with the dimension of the text representation vector, and the original knowledge features are preserved through residual connection.

[0159] In some embodiments of the present disclosure, the time entity and the geographic location entity can be extracted from the structured query understanding result; the geographic location entity is standardized to obtain a standardized geographic location entity; a space-time retrieval condition is generated based on the time entity and the standardized geographic location entity; and the space-time retrieval condition is input into a space-time knowledge base for retrieval, and a retrieval analysis result is output.

[0160] The structured query understanding result can include an intent category and a slot sequence (such as a ship name, a time, a location, and the like).

[0161] Extracting time entities and geographic location entities can be based on predefined slot tags (e.g., as <time>、 <location>) directly extract entities from slot sequences. Example: in the query "Weather in Beijing on October 1, 2023", extract the time entity 2023-10-01 and the geographic location entity Beijing.

[0162] Among them, regular expressions can be used to pattern match and convert time formats in unstructured text (such as "yesterday" and "3 pm"). Use external knowledge base to verify entity validity with domain ontology (such as geographic information system GIS), and exclude irrelevant information (such as "Mars" is invalid in Earth weather query).

[0163] The standardization method for standardizing geographic location entities can include geographic coding: converting text geographic locations into latitude and longitude coordinates or standard administrative division codes (such as ISO 3166-2); synonym mapping: building a geographic location synonym table based on external knowledge base to unify different expressions; hierarchical normalization: normalizing geographic locations to a unified hierarchy (such as provincial, municipal) to avoid retrieval omissions due to granularity differences.

[0164] The spatio-temporal retrieval condition can include time condition, space condition and joint condition. Time condition: support absolute time (such as 2023-10-01) and relative time (such as the last 7 days), and convert to a format that can be recognized by the spatio-temporal knowledge base (such as Unix timestamp). Space condition: based on the standardized geographic location entity, generate spatial range constraints (such as point, circle, polygon). Joint condition: combine time and space conditions through logical operators (such as AND) to form complete retrieval conditions.

[0165] The spatio-temporal knowledge base can include data storage: using spatio-temporal index structure (such as R-Tree, Quad-Tree) to store event data, supporting efficient range query; knowledge fusion: integrating multi-source heterogeneous data (such as news, social media, sensor data), correlating time, place, event type, etc.

[0166] Based on the above event cognitive reasoning method, the application also provides a fuzzy query device. The following will be combined Figure 3 with the description of the device.

[0167] Figure 3 The structure block diagram of the fuzzy query device according to the embodiment of the application is schematically shown.

[0168] As Figure 3 shown, the event cognitive reasoning device 300 of this embodiment includes an acquisition module 310, a matching module 320, a fusion module 330, an input module 340 and a generation module 350.

[0169] The acquisition module 310 is configured to acquire a query sentence input by a user and multi-source heterogeneous text data. In an embodiment, the acquisition module 310 can be configured to perform operation S210 described above, and details are not repeated here.

[0170] The matching module 320 is configured to interactively match the query sentence with an external knowledge base to generate a knowledge-enhanced semantic representation vector. In an embodiment, the matching module 320 can be configured to perform operation S220 described above, and details are not repeated here.

[0171] The fusion module 330 is configured to hierarchically fuse the semantic representation vector and the multi-source heterogeneous text data to obtain a text representation of fused knowledge features, wherein the hierarchical feature fusion includes layer-by-layer aggregation of word-level, sentence-level and document-level features through a Transformer encoder. In an embodiment, the fusion module 330 can be configured to perform operation S230 described above, and details are not repeated here.

[0172] The input module 340 is configured to input the text representation of the fused knowledge features into a multi-task learning framework for intent recognition and slot extraction to obtain a structured query understanding result. In an embodiment, the input module 340 can be configured to perform operation S240 described above, and details are not repeated here.

[0173] The generation module 350 is configured to generate a spatio-temporal retrieval condition according to a temporal entity and a geographic location entity in the structured query understanding result, and output a corresponding retrieval resolution result. In an embodiment, the generation module 340 can be configured to perform operation S250 described above, and details are not repeated here.

[0174] According to an embodiment of the present application, the interactive matching of the query sentence with the external knowledge base to generate a knowledge-enhanced semantic representation vector includes:

[0175] mapping words in the query sentence to low-dimensional dense vector representations to generate a word embedding sequence;

[0176] contextual semantic encoding of the word embedding sequence through a bidirectional long short-term memory network to obtain a text representation containing context information;

[0177] extracting inter-word relationships of words in the query sentence from the external knowledge base to construct an inter-word relationship matrix, the inter-word relationships including synonym, antonym, hypernym, hyponym, and co-hyponym relationships;

[0178] calculating a semantic similarity matrix between the query sentence and candidate knowledge entries in the external knowledge base, and dynamically weighting in combination with the inter-word relationship matrix to generate knowledge-enhanced attention weights;

[0179] The word relationship matrix and the semantic similarity matrix are dynamically weighted and fused to generate a knowledge-enhanced attention weight;

[0180] The text representation vector is interactively weighted according to the knowledge-enhanced attention weight to obtain a knowledge-enhanced semantic representation vector.

[0181] According to an embodiment of the present application, the hierarchical feature fusion of the semantic representation vector and the multi-source heterogeneous text data to obtain a text representation with fused knowledge features comprises:

[0182] The knowledge-enhanced semantic representation vector is taken as an initial input, and associated text segments and user historical query logs in the external knowledge base are introduced as multi-source heterogeneous text data;

[0183] Parallel convolution operations are performed on the initial input and multi-source heterogeneous text data to extract local features at the word level, phrase level, and sentence level, respectively;

[0184] The output feature maps of each convolution layer are spliced in the channel dimension through a dense connection mechanism to form cross-scale fusion features, and the dense connection satisfies that the input of the nth convolution layer contains the output features of all the previous n-1 convolution layers;

[0185] Feature importance weights of each text position in the cross-scale fusion features are calculated based on a self-attention mechanism;

[0186] The cross-scale fusion features are weighted global average-pooled according to the feature importance weights to generate a text representation vector with a fixed dimension;

[0187] Based on the text representation vector, a probability distribution of each predefined category is output, the predefined categories are constructed based on the domain ontology of the external knowledge base, and contain fine-grained labels related to knowledge;

[0188] The fine-grained category corresponding to the maximum probability is taken as the text representation with fused knowledge features.

[0189] According to an embodiment of the present application, the consciousness recognition branch and the slot extraction branch of the multi-task learning framework, the text representation with fused knowledge features is input into the multi-task learning framework for intent recognition and slot extraction to obtain a structured query understanding result, which comprises:

[0190] The text representation with fused knowledge features is input into a hybrid encoder to generate a context-aware sequence representation;

[0191] The context-aware sequence representation is input into the intent recognition branch to output an intent category result of the query sentence;

[0192] The context-aware sequence representation is input into the slot extraction branch to identify slot labels of words in the query statement and generate an entity sequence;

[0193] The intent category result and the entity sequence are combined into a structured query logical form to obtain a structured query understanding result.

[0194] According to an embodiment of the present application, the spatio-temporal retrieval condition is generated based on the time entity and the geographic location entity in the structured query understanding result, and the corresponding retrieval resolution result is output, which includes:

[0195] The time entity and the geographic location entity are extracted from the structured query understanding result;

[0196] The geographic location entity is standardized to obtain a standardized geographic location entity;

[0197] The spatio-temporal retrieval condition is generated based on the time entity and the standardized geographic location entity;

[0198] The spatio-temporal retrieval condition is input into a spatio-temporal knowledge base for retrieval, and a retrieval resolution result is output.

[0199] According to an embodiment of the present application, the hybrid encoder is composed of a shared bidirectional long short-term memory network and a self-attention mechanism. The output dimension of the hybrid encoder is consistent with the dimension of the text representation vector, and the original knowledge features are retained through residual connection.

[0200] According to an embodiment of the present application, any of the modules of the construction module 310, the classification module 320, the verification module 330 and the reasoning module 430 can be combined in one module, or any of the modules can be split into multiple modules. Alternatively, at least part of the function of one or more of the modules can be combined with at least part of the function of the other modules, and implemented in one module. According to an embodiment of the present application, at least one of the construction module 310, the classification module 320, the verification module 330 and the reasoning module 430 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on chip, a system on board, a system on package, an application specific integrated circuit (ASIC), or any other reasonable way of integrating or packaging a circuit, etc. hardware or firmware, or any one of software, hardware and firmware or a suitable combination of any of them. Alternatively, at least one of the construction module 310, the classification module 320, the verification module 330 and the reasoning module 430 can be at least partially implemented as a computer program module which can perform corresponding functions when the computer program module is run.

[0201] Figure 4 A block diagram of an electronic device suitable for implementing the data processing method according to embodiments of the present application is shown schematically.

[0202] As shown in Figure 4 embodiments of the present application includes a processor 401 which can perform various appropriate actions and processes in accordance with a program stored in a read only memory (ROM) 402 or a program loaded into a random access memory (RAM) 403 from a storage section 408. The processor 401 can include, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor, and / or a related chipset, and / or a special purpose microprocessor (e.g., an application specific integrated circuit (ASIC)), and so on. The processor 401 can also include an on-board memory for cache use. The processor 401 can include a single processing unit or multiple processing units to perform the various actions of the method processes according to embodiments of the present application.

[0203] In the RAM 403, various programs and data required for the operation of the electronic device 400 are stored. The processor 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. The processor 401 performs various operations of the method processes according to embodiments of the present application by executing the programs in the ROM 402 and / or the RAM 403. Note that the programs can also be stored in one or more memories other than the ROM 402 and the RAM 403. The processor 401 can also perform various operations of the method processes according to embodiments of the present application by executing the programs stored in the one or more memories.

[0204] According to embodiments of the present application, the electronic device 400 can also include an input / output (I / O) interface 405 which is also connected to the bus 404. The electronic device 400 can also include one or more of the following components connected to the input / output (I / O) interface 405: an input section 406 including a keyboard, a mouse, etc.; an output section 407 including a display such as a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 408 including a hard disk, etc.; and a communication section 409 including a network interface card such as a LAN card, a modem, etc. The communication section 409 performs communication processing via a network such as the Internet. A drive 410 is also connected to the input / output (I / O) interface 405 as necessary. A removable recording medium 411 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc. is attached to the drive 410 as necessary so that a computer program read therefrom is installed into the storage section 408 as necessary.

[0205] The application further provides a computer readable storage medium, which can be included in the device / apparatus / system described in the above embodiments, or can exist independently without being assembled into the device / apparatus / system. The computer readable storage medium carries one or more programs, which, when executed, implement the method according to the embodiments of the application.

[0206] According to the embodiments of the application, the computer readable storage medium can be a non-volatile computer readable storage medium, which can include, but is not limited to, 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), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any appropriate combination thereof. In this application, a computer readable storage medium can be any tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device. For example, according to the embodiments of the application, the computer readable storage medium can include the ROM 402 and / or the RAM 403 described above, and / or one or more memories other than the ROM 402 and the RAM 403.

[0207] The embodiments of the application also include a computer program product, which includes a computer program containing program codes for executing the method shown in the flow chart. When the computer program product is run in a computer system, the program codes are used to make the computer system implement the data processing method provided by the embodiments of the application.

[0208] The above functions defined in the system / apparatus of the embodiments of the application are performed when the computer program is executed by the processor 401. According to the embodiments of the application, the system, apparatus, module, unit, etc. described above can be implemented by computer program modules.

[0209] In one embodiment, the computer program can rely on a tangible storage medium such as an optical storage device, a magnetic storage device, etc. In another embodiment, the computer program can also be transmitted, distributed, and downloaded in the form of a signal on a network medium, and be downloaded and installed through the communication part 409, and / or installed from the detachable medium 411. The program codes contained in the computer program can be transmitted by any appropriate network medium, including but not limited to wireless, wired, etc., or any appropriate combination thereof.

[0210] In such embodiments, the computer program can be downloaded and installed from the network via the communication section 409, and / or installed from the removable media 411. When the computer program is executed by the processor 401, the above-described functions defined in the system of the embodiments of the present application are executed. According to the embodiments of the present application, the system, device, apparatus, module, unit, and the like described above can be realized by the computer program module.

[0211] According to the embodiments of the present application, the program code for executing the computer program provided by the embodiments of the present application can be written in any combination of one or more programming languages, and specifically, these computer programs can be implemented using high-level procedural and / or object-oriented programming language, and / or assembly / machine language. The programming language includes, but is not limited to, such as Java, C++, python, "C" language, or similar programming language. The program code can be executed entirely on the user computing device, partially on the user device, partially on a remote computing device, or entirely on a remote computing device or server. In the case involving a remote computing device, the remote computing device can be connected to the user computing device through any kind of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, connected to the Internet through an Internet service provider).

[0212] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectural, functional, and operational scenarios of systems, methods, and computer program products according to various embodiments of the present application. In this regard, each block in the flowcharts or block diagrams can represent a module, a program segment, or a portion of code that contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur in a different order than that shown in the figures. For example, two blocks that are shown in succession can actually be executed substantially concurrently, or they can sometimes be executed in reverse order, depending on the functionality involved. It should also be noted that each block in the flowcharts or block diagrams, and combinations of blocks in the flowcharts or block diagrams, can be implemented by dedicated hardware-based systems that perform the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.

[0213] Those skilled in the art can understand that the features described in various embodiments of the present application can be combined and / or integrated in various combinations, even if such combinations are not explicitly described in the present application. In particular, the features described in various embodiments of the present application can be combined and / or integrated in various combinations without departing from the spirit and teachings of the present application. All such combinations and / or integrations are within the scope of the present application.< / location> < / time>

Claims

1. A method of fuzzy querying, characterized by, The method comprises: acquiring a query sentence input by a user and multi-source heterogeneous text data; interactively matching the query sentence with an external knowledge base to generate a knowledge-enhanced semantic representation vector; performing hierarchical feature fusion on the semantic representation vector and the multi-source heterogeneous text data to obtain a text representation with fused knowledge features, wherein the hierarchical feature fusion comprises aggregating word-level, sentence-level and document-level features layer by layer through a Transformer encoder; inputting the text representation with fused knowledge features into a multi-task learning framework to perform intent recognition and slot extraction, and obtaining a structured query understanding result; generating a spatio-temporal retrieval condition according to time entities and geographic location entities in the structured query understanding result, and outputting a corresponding retrieval analysis result.

2. The method of claim 1, wherein, The interactive matching of the query sentence with the external knowledge base to generate the knowledge-enhanced semantic representation vector comprises: mapping words in the query sentence into low-dimensional dense vector representations to generate a word embedding sequence; performing context semantic encoding on the word embedding sequence through a bidirectional long short-term memory network to obtain a text representation containing context information; extracting inter-word relationships of words in the query sentence from the external knowledge base to construct an inter-word relationship matrix, wherein the inter-word relationships include synonym, antonym, hypernym, hyponym and co-hyponym relationships; calculating a semantic similarity matrix between the query sentence and candidate knowledge items in the external knowledge base; performing dynamic weighted fusion on the inter-word relationship matrix and the semantic similarity matrix to generate knowledge-enhanced attention weights; interactively weighting the text representation vector according to the knowledge-enhanced attention weights to obtain a knowledge-enhanced semantic representation vector.

3. The method of claim 1, wherein, The hierarchical feature fusion of the semantic representation vector and the multi-source heterogeneous text data to obtain the text representation with fused knowledge features comprises: taking the knowledge-enhanced semantic representation vector as an initial input, and introducing associated text segments in the external knowledge base and user historical query logs as multi-source heterogeneous text data; performing parallel convolution operations on the initial input and the multi-source heterogeneous text data to extract word-level, phrase-level and sentence-level local features respectively; splicing output feature maps of all convolution layers in the channel dimension through a dense connection mechanism to form cross-scale fusion features, wherein the dense connection satisfies that the input of the nth convolution layer contains the output features of all convolution layers before the n-1th layer; calculating feature importance weights of each text position in the cross-scale fusion features based on a self-attention mechanism; performing weighted global average pooling on the cross-scale fusion features according to the feature importance weights to generate a text representation vector with a fixed dimension; outputting probability distributions of each predefined category based on the text representation vector, wherein the predefined categories are constructed based on a domain ontology of the external knowledge base and contain fine-grained labels related to knowledge; taking a fine-grained category corresponding to the maximum probability as the text representation with fused knowledge features.

4. The method of claim 3, wherein, The consciousness recognition branch and the slot extraction branch of the multi-task learning framework, inputting the text representation with the fused knowledge features into a multi-task learning framework for intent recognition and slot extraction to obtain a structured query understanding result, including: inputting the text representation with the fused knowledge features into a hybrid encoder to generate a context-aware sequence representation; inputting the context-aware sequence representation into the intent recognition branch to output an intent category result of the query sentence; inputting the context-aware sequence representation into the slot extraction branch to identify slot labels of each word in the query sentence and generate an entity sequence; combining the intent category result and the entity sequence into a structured query logical form to obtain a structured query understanding result.

5. The method of claim 1, wherein, The method according to the time entity and the geographic location entity in the structured query understanding result, generating a spatio-temporal retrieval condition, and outputting a corresponding retrieval analysis result, including: extracting the time entity and the geographic location entity from the structured query understanding result; standardizing the geographic location entity to obtain a standardized geographic location entity; generating a spatio-temporal retrieval condition based on the time entity and the standardized geographic location entity; inputting the spatio-temporal retrieval condition into a spatio-temporal knowledge base for retrieval to output a retrieval analysis result.

6. The method of claim 4, wherein, The hybrid encoder is composed of a shared bidirectional long short-term memory network and a self-attention mechanism, the output dimension of the hybrid encoder is consistent with the dimension of the text representation vector, and the original knowledge features are retained through residual connection.

7. A fuzzy query apparatus characterized by comprising: The device includes: an acquisition module configured to acquire a query sentence input by a user and multi-source heterogeneous text data; a matching module configured to interactively match the query sentence with an external knowledge base to generate a knowledge-enhanced semantic representation vector; a fusion module configured to perform hierarchical feature fusion on the semantic representation vector and the multi-source heterogeneous text data to obtain a text representation with fused knowledge features, wherein the hierarchical feature fusion includes aggregating word-level, sentence-level and document-level features layer by layer through a Transformer encoder; an input module configured to input the text representation with the fused knowledge features into a multi-task learning framework for intent recognition and slot extraction to obtain a structured query understanding result; a generation module configured to generate a spatio-temporal retrieval condition according to a time entity and a geographic location entity in the structured query understanding result, and output a corresponding retrieval analysis result.

8. An electronic device, comprising: one or more processors; a memory for storing one or more computer programs, characterized in that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1-6.

9. A computer readable storage medium having stored thereon a computer program or instructions, characterized in that, The computer program or instructions are executed by the processor to implement the steps of the method according to any one of claims 1-6.

10. A computer program product comprising computer programs or instructions, characterized in that, The computer program or instructions are executed by the processor to implement the steps of the method according to any one of claims 1-6.

Citation Information

Patent Citations

  • Inquiring method of best matching with fuzzy trajectory problems

    CN102567497A

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

    CN118734861A