Query semantic analysis in knowledge base question answering

By combining natural language query rewriting with constituent syntactic analysis, the problem of the diversity and complexity of query expressions in knowledge base question answering is solved, and efficient and accurate semantic analysis and knowledge base retrieval are achieved.

CN113821584BActive Publication Date: 2025-12-30MICROSOFT TECHNOLOGY LICENSING LLC
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202010561326.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-06-18
Publication Date
2025-12-30
Estimated Expiration
2040-06-18

AI Technical Summary

Technical Problem

Existing technologies struggle to effectively handle the diversity and complexity of natural language queries in knowledge base question answering, leading to problems with diverse query expressions and difficulties in determining query paths, making it difficult to accurately retrieve the correct answer.

Method used

This paper adopts a combined approach of natural language query rewriting and constituent syntactic analysis. By extracting slot frames through natural language understanding, it generates standardized queries and uses constituent syntactic analysis to generate logical expressions, thereby improving the accuracy and efficiency of semantic analysis.

Benefits of technology

It significantly improves the accuracy of semantic analysis, reduces the cost of constituent syntactic analysis, enhances the scalability of the system, ensures the standardization and completeness of query expressions, and improves the retrieval efficiency of knowledge base question answering.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113821584B_ABST
    Figure CN113821584B_ABST
Patent Text Reader

Abstract

The present disclosure provides methods and apparatus for query semantic analysis in knowledge base question answering. An initial query can be obtained. Natural language understanding can be performed on the initial query to extract one or more slot frames from the initial query. A normalized query corresponding to the initial query can be generated based at least on the one or more slot frames. Constituent syntax analysis can be performed on the normalized query to generate a logical form corresponding to the normalized query.
Need to check novelty before this filing date? Find Prior Art

Description

Background Technology

[0001] Question answering is a natural language processing task widely used in various scenarios and products involving information retrieval, such as search engines, chatbots, and virtual assistants. The goal of a question answering task is to provide an answer to a received question. In this paper, the term "question" can also be referred to as a "query." In some cases, answers corresponding to questions can be retrieved from a structured knowledge base, which is also known as knowledge base question answering (KB-QA) or knowledge base-based question answering. Typically, in KB-QA tasks, the natural language query is first converted into a logical form through semantic parsing, which is a machine-understandable representation of the query's meaning. This logical form can then be converted into a structured query applicable to the knowledge base. This structured query can then be used to retrieve the corresponding answer from the knowledge base. Summary of the Invention

[0002] This invention is provided to introduce a set of concepts, which will be further described in the following detailed description. This invention is not intended to identify key or essential features of the protected subject matter, nor is it intended to limit the scope of the protected subject matter.

[0003] Embodiments of this disclosure provide methods and apparatus for query semantic analysis in knowledge base question answering. An initial query can be obtained. Natural language understanding can be performed on the initial query to extract one or more slot frames. A normalized query corresponding to the initial query can be generated, at least based on the one or more slot frames. Component syntactic analysis can be performed on the normalized query to generate a logical expression corresponding to the normalized query.

[0004] It should be noted that one or more of the above aspects include the features specifically pointed out in the following detailed description and claims. Certain illustrative features of the one or more aspects are set forth in detail in the following specification and drawings. These features merely indicate various ways in which the principles of each aspect can be implemented, and this disclosure is intended to include all such aspects and their equivalents. Attached Figure Description

[0005] The following description will take into account several aspects disclosed, which are provided to illustrate rather than limit the aspects disclosed.

[0006] Figure 1 An exemplary process for knowledge base question answering is shown.

[0007] Figure 2An exemplary process for performing query semantic analysis in a knowledge base question answering system, according to an embodiment, is shown.

[0008] Figure 3 An exemplary process for performing natural language understanding according to an embodiment is shown.

[0009] Figure 4 An exemplary process for performing normalized query generation according to an embodiment is shown.

[0010] Figure 5 A flowchart of an exemplary method for query semantic analysis in knowledge base question answering, according to an embodiment, is shown.

[0011] Figure 6 An exemplary apparatus for query semantic analysis in knowledge base question answering, according to an embodiment, is shown.

[0012] Figure 7 An exemplary apparatus for query semantic analysis in knowledge base question answering, according to an embodiment, is shown. Detailed Implementation

[0013] This disclosure will now be discussed with reference to various exemplary embodiments. It should be understood that this discussion of embodiments is merely intended to enable those skilled in the art to better understand and thus implement the embodiments of this disclosure, and is not intended to teach any limitation on the scope of this disclosure.

[0014] Typically, KB-QA tasks face challenges such as analyzing and understanding natural language expressions and the complexity of search. The problems themselves are complex because they may contain various concerns or constraints. Problem formulations vary because the same problem can be expressed equivalently in multiple ways. For example, the question "The 10 best-selling mobile phones of 2019" and the question "The 10 best-selling mobile phones of last year" are essentially the same question, but expressed differently. Furthermore, due to the complexity of the problems, it is often difficult to determine the correct query path to obtain an answer.

[0015] For KB-QA tasks that use semantic analysis, several implementation methods have been proposed.

[0016] In one approach, Natural Language Understanding (NLU) can be performed on natural language queries using, for example, a statistical model, to obtain a semantic frame corresponding to the query. This semantic frame includes, for example, domains, intents, slots, etc. The semantic frame can then be further transformed into a logical expression using predetermined logic. This approach can effectively handle different semantic forms of queries and address the problem of diverse query expressions, but it may lose constraint information such as dependencies between slots.

[0017] In another approach, syntactical analysis can be performed on natural language queries using, for example, a context-free grammar (CFG) analyzer to transform the query into a logical expression. This method effectively preserves dependency information between sentence components within the logical expression, achieving high accuracy but lower recall.

[0018] In another approach, end-to-end neural networks can be used to convert natural language queries into logical expressions. This method can achieve good performance on datasets within a specific domain, but it is difficult to debug for defects and has low scalability, such as difficulty in extending to other domains.

[0019] Embodiments of this disclosure propose an efficient and accurate method for performing query semantic analysis in knowledge base question answering to obtain a logical expression corresponding to the input natural language query. Query semantic analysis according to embodiments of this disclosure can be implemented based on, for example, a combination of natural language query rephrasing and consistency parsing.

[0020] In one aspect, an initial natural language query can be rewritten into a normalized query through natural language query rewriting. In this paper, a normalized query can refer to a query written in natural language that, for example, has its word expression normalized, implicit information completed, and its expression order conforming to conventional grammatical conventions. In one implementation, the initial query can be analyzed using natural language understanding to extract key information, such as slot frames. The natural language understanding can be performed, for example, using a statistical model. A normalized query generation process can be used to generate a normalized query, at least based on the extracted slot frames. This normalized query generation process can include, for example, performing normalization processing on the slot frames to obtain normalized slot frames, and at least using the normalized slot frames to generate a normalized query.

[0021] In one aspect, constituent syntactic analysis can be performed on a normalized query to generate a logical expression corresponding to the normalized query. This logical expression can also be viewed as a logical expression corresponding to the initial query obtained through query semantic analysis according to embodiments of this disclosure. Constituent syntactic analysis can be performed, for example, by a CFG analyzer.

[0022] The embodiments of this disclosure implement end-to-end query semantic analysis. The combination of natural language query rewriting and constituent syntactic analysis can significantly improve the accuracy of semantic analysis, reduce the cost of constituent syntactic analysis, improve system efficiency, and enhance scalability. By applying natural language understanding in query rewriting, diverse expressions of the same problem can be normalized, thereby effectively solving the problem of query expression diversity. The rewritten normalized query can provide more standardized, complete, and ordered information. By applying constituent syntactic analysis, constituent information and dependency information can be preserved in the logical expression, thereby effectively solving the complexity problem. Furthermore, since constituent syntactic analysis is performed on normalized queries, this helps to further improve the execution efficiency and accuracy of constituent syntactic analysis.

[0023] Figure 1 An exemplary process 100 for knowledge base question answering is shown.

[0024] Query 102 can be obtained. Query 102 can be expressed in natural language. Process 100 aims to retrieve the corresponding answer for query 102.

[0025] At point 110, semantic analysis can be performed on query 102 to obtain the corresponding logical expression 104. Semantic analysis aims to extract the meaning of the query and produce a machine-understandable representation. The logical expression can use a domain-specific semantic representation language. It can also use more extensible languages, such as Prolog, lambda calculus, lambda dependency composition semantics (lambda-DCS), structured query language (SQL), abstract semantic representation (AMR), etc. Furthermore, the logical expression can also use many other semantic representation methods, such as query graphs, semantic graphs, vector representations, etc.

[0026] At point 120, logical expression 104 can be transformed into a structured query 106 applicable to the knowledge base using structured query construction. A structured query refers to a query expressed in a language supported by the knowledge base and that can be directly used for retrieval within the knowledge base. Different types of knowledge bases may use different structured query languages. For example, knowledge bases based on Resource Description Framework (RDF) typically use the SPARQL query language, while knowledge bases based on Tag Attribute Graph (LPG) typically use query languages ​​such as Cypher and Gremlin, and so on.

[0027] After obtaining the structured query 106, a search can be performed in the knowledge base 130 based on the structured query 106 to obtain the corresponding answer.

[0028] Figure 2An exemplary process 200 for performing query semantic analysis in a knowledge base question answering system according to an embodiment is shown. Process 200 aims to obtain a logical expression corresponding to a natural language query through a combination of natural language query rewriting and constituent syntactic analysis.

[0029] An initial query 202 can be obtained. This initial query 202 can be a natural language query.

[0030] At point 210, the initial query 202 can be transformed into a normalized query 204 through natural language query rewriting. In one implementation, the query rewriting at 210 may include natural language understanding of the initial query 202 and normalized query generation based on the results of the natural language understanding.

[0031] At 212, natural language understanding can be performed on the initial query 202 to extract key information such as slot frames from the initial query 202. The natural language understanding at 212 can be performed, for example, by using a statistical model for a natural language understanding task. A slot can refer to a word identified or extracted from a sentence through natural language understanding. In this document, a word can broadly refer to a single character, a combination of characters, a word, a combination of words, etc. A slot frame can refer to a structured representation of slots and their related information, which includes not only the word corresponding to the slot but also information related to the slot analyzed through natural language understanding, such as type, value, normalized value, index, length, etc. Embodiments of this disclosure are not limited to any specific natural language understanding technique for extracting slot frames, nor are they limited to any specific representation of slot frames.

[0032] Assuming the initial query 202 is "mobile phones with sales growth exceeding 50% year-on-year", then at 212, the words "sales", "year-on-year", and "exceeding 50%" in the query can be identified as slots, and a slot framework corresponding to these slots can be constructed. Taking the slot "exceeding 50%" as an example, Table 1 shows an exemplary slot framework for this slot.

[0033]

[0034] Table 1

[0035] Table 1 uses a slot framework of type NumberRange, which includes fields such as Name, Type, Confidence, Value, MetaData, Index, and Length. The Value field can be the word "over 50%" corresponding to the slot. The MetaData field defines the CanonicalValue information, which includes the TypeName and SerializedData of the CanonicalValue. The SerializedData field includes the expression ">0.5" converted from "over 50%". The Index field indicates the slot's index position or position order in the query. The Length field indicates the length of the slot. It should be understood that the slot framework in Table 1 is merely exemplary; depending on actual application needs and design, the slot framework may include more or less information.

[0036] At point 214, a normalized query 204 corresponding to the initial query 202 can be generated, at least based on one or more slot frames extracted at point 212. In one implementation, the normalized query generation process at point 214 may include, for example, performing normalization processing on one or more slot frames to obtain one or more normalized slot frames. Normalization processing may include various processing performed on the words corresponding to the slot frames to achieve expression normalization, such as normalizing the word expression form, completing implicit information, adjusting the expression order to conform to conventional grammatical conventions, etc. The normalized query generation process at point 214 may further include generating the normalized query 204 by concatenating one or more normalized slot frames. For example, one or more words corresponding to one or more normalized slot frames may be concatenated to form the normalized query 204. Alternatively, one or more words corresponding to one or more normalized slot frames may be concatenated with at least a portion of the words in the initial query 202 to form the normalized query 204. For example, when the initial query 202 includes words that have not been extracted from slot frames, these words can be added to the normalized query 204 during concatenation. The normalized query 204 is a natural language query with a more normalized expression than the initial query 202.

[0037] At 220, constituent parsing can be performed on normalized query 204 to generate a logical expression 206 corresponding to normalized query 204. Constituent parsing at 220 can be performed using, for example, a CFG parser. Embodiments of this disclosure are not limited to any particular technique for performing constituent parsing.

[0038] It should be understood that all steps in process 200 are exemplary and can be modified in any way depending on the actual application requirements and design. For example, process 200 may further include converting logical expression 206 into a structured query that can be applied to a knowledge base for information retrieval in that knowledge base.

[0039] Figure 3 An exemplary process 300 for performing natural language understanding according to an embodiment is shown. Process 300 is... Figure 2 An exemplary implementation of natural language understanding at point 212. According to process 300, natural language understanding 310 can be performed on an initial query 302 to extract one or more slot frames 304. Natural language understanding 310 may include one or more processes that facilitate the extraction of slot frames.

[0040] In one implementation, natural language understanding 310 may include time information extraction. Time information extraction can be performed using any known technique to identify information representing time from the initial query 302 and construct the corresponding slot frame. Optionally, time information extraction may also include a transformation of the representation of the time information. Time information extraction can be performed using, for example, the TimeX model or any other model for extracting time information.

[0041] Assuming the initial query 302 includes the word "eight o'clock" which corresponds to time information, Table 2 shows the corresponding exemplary slot framework extracted using the TimeX model.

[0042]

[0043] Table 2

[0044] Table 2 uses a slot frame of type Date.Time. In this slot frame, the word "eight o'clock" in the initial query is converted into the standardized word representation "T08".

[0045] In one implementation, natural language understanding 310 may include named entity recognition (NER). Named entity recognition can be performed using any known technique to identify named entities from the initial query 302 and construct corresponding slot frames. Named entities may include, for example, numerical ranges, proper nouns, etc. For example, Table 1 above shows the slot frames corresponding to the numerical range "more than 50%".

[0046] In one implementation, natural language understanding 310 may include negation expression recognition. Negation expression recognition can refer to the recognition of expressions containing negative words. For example, the expression "did not obtain" can be considered a negative expression containing the negative word "did not". Negation expression recognition can be performed using any known technique to identify negative expressions from the initial query 302 and construct the corresponding slot frame. For example, in the slot frame corresponding to "did not obtain", a "negative" attribute can be added to the word "obtain".

[0047] In one implementation, the natural language understanding 310 may include customized natural language understanding. Customized natural language understanding can refer to natural language understanding tailored for a specific domain, used to identify domain-specific slots and construct corresponding slot frames. Taking the e-commerce domain as an example, there may be some specific expressions, such as "sales volume" and "click volume." A natural language understanding model can be pre-customized for the e-commerce domain based on these specific expressions, so that the customized natural language understanding model can effectively extract the slot frames of the e-commerce domain.

[0048] In one implementation, natural language understanding 310 may include rule-based representation transformation. Rules can be predefined to transform specific types of representations in the initial query 302 into standardized representations, and corresponding slot frames can be constructed. For example, the representation "positive" can be transformed into "greater than 0", the representation "negative" into "less than 0", the representation "true" into "equal to 1", and so on.

[0049] It should be understood that the various processes involved in the natural language understanding 310 discussed above are exemplary. Depending on the actual application requirements and design, the natural language understanding 310 may include one or more of these processes, or any other processes that help extract the slot framework. Furthermore, although the above discussion involves the transformation or standardization of specific words or expressions in the natural language understanding 310, the natural language understanding 310 may also simply identify the words or slots in the initial query 302 and directly build the slot framework based on these words and related information.

[0050] Figure 4 An exemplary process 400 for executing normalized query generation according to an embodiment is shown. Process 400 is Figure 2 An exemplary implementation of the normalized query generated at position 214, and is Figure 3 The process of 300 continues.

[0051] According to process 400, normalization processing 410 can be performed on one or more slot frames 402 to obtain one or more normalized slot frames 404. Slot frames 402 can correspond to... Figure 3 The slot frame 304 is used in the context of word slots. Normalization processing 410 may include various processing steps performed on the words corresponding to the slot frame to achieve expression normalization. These processing steps may be performed based on one or more predefined processing rules.

[0052] In one implementation, normalization 410 may include reordering. Rules for reordering can be defined according to common grammatical conventions. For example, when a value appears before a predicate and there are no other predicates preceding it, the value and the predicate can be swapped. Taking the query "shops with zero negative reviews" as an example, language processing might yield three slot frames arranged sequentially: a slot frame corresponding to the word "zero," a slot frame corresponding to the word "negative reviews," and a slot frame corresponding to the word "shops." According to the aforementioned rules, these three slot frames can be reordered so that the value "zero" appears after "negative reviews." Thus, the three slot frames can be reordered as follows: a slot frame corresponding to the word "negative reviews," a slot frame corresponding to the word "zero" or the transformed word "equal to zero," and a slot frame corresponding to the word "shops." The adjusted order of the slot frames can be indicated by updating the index values ​​in the slot frames, thereby including the updated index values ​​in the corresponding normalized slot frames. For example, in the example above, after reordering, the slot frame corresponding to the word "bad review" will have a smaller index value than the slot frame corresponding to the word "equal to zero," indicating that the word "bad review" will appear before the word "equal to zero." It should be understood that embodiments of this disclosure are not limited to the above reordering rules, but may include any other reordering rules.

[0053] In one implementation, normalization processing 410 may include statement completion processing. Some queries may contain implicit information, which can be completed using statement completion processing. Different statement completion rules can be defined for different scenarios. Optionally, these statement completion rules may be defined for specific domains.

[0054] One exemplary expression completion rule could be inferential comparative completion, which aims to complete expressions based on the inferred intrinsic numerical comparison meaning of specific words. Taking the query "discounted mobile phones" as an example, the word "discounted" is actually related to the comparison between the price fluctuation and the threshold 0; that is, "discounted" means the price fluctuation is less than 0. Therefore, the expression "price fluctuation is less than 0" can be used to complete the expression, and in the normalized slot framework, the word "discounted" is replaced with the expression "price fluctuation is less than 0".

[0055] One exemplary expression completion rule could be time-based completion, which aims to complete expressions based on the implicit time information constraints of specific words. Taking the query "highest-selling mobile phones" as an example, the word "sales" is actually related to time; for example, it might refer to sales this year (2020). Therefore, the expression "sales in 2020" can be completed using the time period related to "year," and this completed expression can be adopted in the normalized slot framework.

[0056] One exemplary expression completion rule could be semantic omission completion, which aims to complete expressions based on omitted content in words. For example, in the query "manufacturers whose sales are higher than the industry average," the expression "industry average" is unreasonable because "industry" is not a numerical type and therefore cannot be "averaged." The expression "industry average" can be completed using the numerical predicate "sales" that is closest to "industry" in the query, becoming "industry sales average," and this completed expression can be adopted in the normalized slot framework.

[0057] It should be understood that the embodiments of this disclosure are not limited to the exemplary expression completion processes listed above, but may include any other expression completion processes.

[0058] In one implementation, normalization processing 410 may include time normalization processing. Although time terms or expressions may have already been transformed in the slot framework containing time information extracted through the natural language understanding process, due to the complexity of time information, the time term transformations performed by natural language understanding may still not be uniform and standardized. Therefore, further time normalization processing is required. For example, natural language understanding may transform the expression "eight o'clock" into the expression "T08," where "T08" represents eight o'clock in a day; it may transform the expression "last Friday" into the expression "2020-05-31," where "2020-05-31" is an example date corresponding to "last Friday"; it may transform the expression "last week" into "2020-W21," where "2020-W21" is an example week number corresponding to "last week" in 2020, and so on. It is evident that different types of time information may be transformed into different formats and expressions by natural language understanding. Time normalization processing can unify and normalize the time terms in the slot framework containing time information according to predetermined time normalization rules. For example, date or time values ​​can be normalized to the format "yyy-mm-dd T hh:mm:ss", where "yyyy" corresponds to the year, "mm" to the month, "dd" to the day of the month, "hh" to the hour, "mm" to the minute, and "ss" to the second. Furthermore, time periods can be normalized to the format "from yyyy-mm-dd T hh:mm:ss to yyyy-mm-dd T hh:mm:ss". It should be understood that the embodiments of this disclosure are not limited to the exemplary time normalization processes listed above, but time terms can be normalized to any other format.

[0059] In one implementation, normalization processing 410 may include time-specific logic processing. In some cases, time information may not be directly recognizable by time normalization processing, thus requiring specific processing. For example, terms in a query may contain implicit time-related logic, making direct normalization impossible. Different time-specific logic processing rules can be defined for different scenarios. Optionally, these time-specific logic processing rules can be defined for a specific domain. Taking the query "mobile phones with sales growth exceeding 50% year-on-year" as an example, the term "year-on-year" has time-specific logic, which may represent a comparison between the current quarter (e.g., the second quarter of 2020) and the same quarter of the previous year (i.e., the second quarter of 2019). Based on the time-specific logic processing rules predefined for "year-on-year," the term "year-on-year" can be replaced with the expression "from 2019-Q2 to 2020-Q2," where "2019-Q2" represents the second quarter of 2019 and "2020-Q2" represents the second quarter of 2020. Accordingly, the normalized slot frame corresponding to "year-on-year" can be marked as "not used," and a new normalized slot frame corresponding to "from 2019-Q2 to 2020-Q2" is created and marked as "used" so that the expression "from 2019-Q2 to 2020-Q2" is used to replace the expression "year-on-year" in the final generated normalized query. Furthermore, the index value of the newly created normalized slot frame corresponding to "from 2019-Q2 to 2020-Q2" can be determined based on the reordering process to specify the relative order of the expression "from 2019-Q2 to 2020-Q2" with other words or expressions in the final generated normalized query. It should be understood that embodiments of this disclosure are not limited to the exemplary time-specific logic processes listed above, but may include any other time-specific logic processes.

[0060] It should be understood that the various processes in normalization process 410 discussed above are exemplary. Depending on the actual application requirements and design, normalization process 410 may include one or more of these processes, or any other processes that help to obtain a normalized slot framework.

[0061] Furthermore, although the above discussion has discussed the possibility of defining separate processing rules for each type of normalization process, these processing rules can also be provided through configuration file 412. Configuration file 412 may include one or more predefined processing rules, so that the normalization process at 410 can be performed at least based on configuration file 412. Optionally, configuration file 412 may include only predefined processing rules for a specific domain. For example, configuration file 412 may include predefined processing rules for expression completion processing for the e-commerce domain, predefined processing rules for time-specific logic processing for the e-commerce domain, etc. Taking the expression completion processing of the expression "price reduction" as an example, Table 3 shows the entries of the expression completion processing rules for the expression "price reduction" in configuration file 412.

[0062]

[0063] Table 3

[0064] In Table 3, "Value" indicates that the object being processed is "price reduction," "CanonicalValue" indicates that the alternative expression is "price change," "TimePeriod" indicates that the time metric for "price reduction" is days, "InferredComparison" indicates that the inferred comparison relationship is "less than 0," and "IsDecimal: true" indicates that the object is a decimal character. Using the expression completion rules in Table 3, the phrase "price reduction" can be completed using "price change less than 0," and the phrase "price reduction" will be replaced with the expression "price change less than 0" in the normalized slot framework. It should be understood that Table 3 is merely an example of entries in configuration file 412, and embodiments of this disclosure are not limited to any specific configuration file format and expression. Furthermore, configuration file 412 may include any other predetermined processing rules for any processing in the normalized processing at 410.

[0065] One or more normalized slot frames 402 can be obtained by normalizing one or more slot frames 402 at 410. The normalized slot frames 404 may have, for example, normalized word representations, implied information for completion, adjusted expression order, etc.

[0066] At 420, the normalized slot frames 404 can be concatenated to generate a normalized query 406. For example, one or more words corresponding to the normalized slot frames 404 can be concatenated into a normalized query. At 420, these words can be concatenated in the order indicated by the index value of each normalized slot frame. Optionally, the word concatenation can also be performed with reference to the order of these words in the initial query 402, the length of these words, and any other information. Furthermore, optionally, if the initial query includes a portion of words that were not extracted into slot frames, these words can also be added to the normalized query during concatenation. For example, suppose the initial query is "mobile phones with sales growth exceeding 50% year-on-year," and the natural language understanding process has extracted slot frames for the words "sales," "year-on-year," "growth," and "exceeding 50%," but not for the word "mobile phone." Accordingly, through the normalization process at 410, only the normalized slot frames corresponding to "sales," "year-on-year," "growth," and "exceeding 50%" are obtained. Therefore, at position 420, the words in the normalized slot frame corresponding to "sales volume", "year-on-year", "growth" and "more than 50%" can be concatenated with the word "mobile phone" to form normalized query 406, where the order of the word "mobile phone" in normalized query 406 can correspond to its position order in the initial query.

[0067] Taking the initial query "mobile phones with sales growth exceeding 50% year-on-year" as an example, through... Figure 3 Process 300 and Figure 4 In process 400, the rewritten normalized query can be obtained, for example, "mobile phones with a sales growth rate > 0.5 from 2019-Q2 to 2020-Q2". The expression "from 2019-Q2 to 2020-Q2" in the normalized query is a normalized representation and replacement of "year-on-year" in the initial query, and its order is placed before the word "sales". The expression "growth rate" in the normalized query is a completion of the expression "growth" in the initial query. The expression ">0.5" in the normalized query can be a transformation of "50%" in the initial query during natural language understanding.

[0068] According to embodiments of this disclosure, normalized queries in natural language can be further converted into logical expressions through constituent syntactic analysis.

[0069] In one implementation, embodiments of this disclosure can employ any known language available for logical expressions. For example, using the λ-DCS language, a logical expression as shown in Table 4 can be generated for the query "Apple iPhones released this year".

[0070]

[0071] Table 4

[0072] It should be understood that logical expressions in any other format can be generated for other languages.

[0073] In one implementation, predefined specific operators can be used in the logical expressions to improve their accuracy and efficiency. For example, for the query "Apple iPhones released this year", the logical expressions shown in Table 5 can be generated.

[0074]

[0075] Table 5

[0076] The logical expressions in Table 5 employ several predefined operators. The operator `tounary(.)` represents the object being processed, and its return type is the unary. The operator `constraint(.)` imposes a constraint on the unary, and its return type is also unary. The operator `conjunction(X,and,Y)` performs a set operation on X and Y, and its return type is the same as that of X and Y. The operator `tobinary(.)` represents a binary relation, and its return type is also binary. The operator `toconstraint(.)` represents a constraint, and its return type is constraint. For example, `toconstraint(tobinary(release date),2020)` means using "release date is 2020" as a constraint. It should be understood that the above operators are merely exemplary, and any other types of operators can be predefined.

[0077] Figure 5 A flowchart of an exemplary method 500 for query semantic analysis in knowledge base question answering, according to an embodiment, is shown.

[0078] At position 510, the initial query can be obtained.

[0079] At 520, natural language understanding can be performed on the initial query to extract one or more slot frames from the initial query.

[0080] At point 530, a normalized query corresponding to the initial query can be generated based at least on one or more slot frames.

[0081] At position 540, component syntactic analysis can be performed on the normalized query to generate a logical expression corresponding to the normalized query.

[0082] In one implementation, the natural language understanding may include at least one of the following: time information extraction, named entity recognition, negation expression recognition, customized natural language understanding, and rule-based expression transformation.

[0083] In one implementation, generating a normalized query may include: performing normalization processing on the one or more slot frames to obtain one or more normalized slot frames; and generating the normalized query by at least concatenating the one or more normalized slot frames.

[0084] Generating the normalized query may include concatenating one or more words corresponding to the one or more normalized slot frames with at least a portion of the words in the initial query to form the normalized query.

[0085] The normalization process may include at least one of the following: reordering, expression completion, time normalization, and time-specific logic processing.

[0086] The normalization process can be performed based on at least one or more predefined processing rules.

[0087] The normalization process may be performed at least based on a configuration file, which includes one or more predefined processing rules for a specific domain.

[0088] In one implementation, the natural language understanding can be performed through a statistical model.

[0089] In one implementation, the constituent syntactic analysis may be performed by a CFG analyzer.

[0090] In one implementation, method 500 may further include: converting the logical expression into a structured query that can be applied to a knowledge base.

[0091] It should be understood that method 500 may also include any steps / processes for query semantic analysis in knowledge base question answering according to the embodiments of this disclosure described above.

[0092] Figure 6 An exemplary apparatus 600 for query semantic analysis in knowledge base question answering, according to an embodiment, is shown.

[0093] The apparatus 600 may include: an initial query acquisition module 610 for acquiring an initial query; a natural language understanding module 620 for performing natural language understanding on the initial query to extract one or more slot frames from the initial query; a normalized query generation module 630 for generating a normalized query corresponding to the initial query based at least on the one or more slot frames; and a constituent syntactic analysis module 640 for performing constituent syntactic analysis on the normalized query to generate a logical expression corresponding to the normalized query.

[0094] In one implementation, the natural language understanding may include at least one of the following: time information extraction, named entity recognition, negation expression recognition, customized natural language understanding, and rule-based expression transformation.

[0095] The normalized query generation module 630 can be used to: perform normalization processing on the one or more slot frames to obtain one or more normalized slot frames; and generate the normalized query by at least concatenating the one or more normalized slot frames.

[0096] Generating the normalized query may include concatenating one or more words corresponding to the one or more normalized slot frames with at least a portion of the words in the initial query to form the normalized query.

[0097] The normalization process may include at least one of the following: reordering, expression completion, time normalization, and time-specific logic processing.

[0098] The normalization process can be performed based on at least one or more predefined processing rules.

[0099] The normalization process may be performed at least based on a configuration file, which includes one or more predefined processing rules for a specific domain.

[0100] In one implementation, the natural language understanding can be performed through a statistical model.

[0101] In one implementation, the constituent syntactic analysis may be performed by a CFG analyzer.

[0102] In addition, the apparatus 600 may also include any other modules that perform the steps of the method for query semantic analysis in knowledge base question answering according to the above embodiments of the present disclosure.

[0103] Figure 7 An exemplary apparatus 700 for query semantic analysis in knowledge base question answering is shown according to an embodiment.

[0104] The apparatus 700 may include: at least one processor 710; and a memory 720 storing computer-executable instructions. When the computer-executable instructions are executed, the at least one processor 710 may: obtain an initial query; perform natural language understanding on the initial query to extract one or more slot frames from the initial query; generate a normalized query corresponding to the initial query based at least on the one or more slot frames; and perform componential syntactic analysis on the normalized query to generate a logical expression corresponding to the normalized query. Furthermore, the processor 710 may also perform any other steps / processes of the method for query semantic analysis in knowledge base question answering according to the above embodiments of this disclosure.

[0105] Embodiments of this disclosure can be implemented in a non-transitory computer-readable medium. This non-transitory computer-readable medium may include instructions that, when executed, cause one or more processors to perform any operation of the method for query semantic analysis in knowledge base question answering according to the embodiments of this disclosure described above.

[0106] It should be understood that all operations in the methods described above are merely exemplary, and this disclosure is not limited to any operation in the methods or the order of such operations, but should cover all other equivalent transformations under the same or similar concept.

[0107] It should also be understood that all modules in the apparatus described above can be implemented in various ways. These modules can be implemented as hardware, software, or a combination thereof. Furthermore, any of these modules can be further functionally divided into sub-modules or combined together.

[0108] Processors have been described in conjunction with various devices and methods. These processors can be implemented using electronic hardware, computer software, or any combination thereof. Whether these processors are implemented as hardware or software will depend on the specific application and the overall design constraints imposed on the system. As an example, the processors, any portions of processors, or any combinations of processors given in this disclosure can be implemented as microprocessors, microcontrollers, digital signal processors (DSPs), field-programmable gate arrays (FPGAs), programmable logic devices (PLDs), state machines, gate logic, discrete hardware circuits, and other suitable processing units configured to perform the various functions described in this disclosure. The functionality of the processors, any portions of processors, or any combinations of processors given in this disclosure can be implemented as software executed by a microprocessor, microcontroller, DSP, or other suitable platform.

[0109] Software should be broadly considered as representing instructions, instruction sets, code, code segments, program code, programs, subroutines, software modules, applications, software applications, software packages, routines, subroutines, objects, running threads, procedures, functions, etc. Software may reside on a computer-readable medium. Computer-readable media may include, for example, memory, which may be, for example, magnetic storage devices (e.g., hard disks, floppy disks, magnetic stripes), optical disks, smart cards, flash memory devices, random access memory (RAM), read-only memory (ROM), programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), registers, or removable disks. Although memory is shown as separate from the processor in several aspects set forth in this disclosure, memory may also reside within the processor (e.g., in caches or registers).

[0110] The above description is provided to enable any person skilled in the art to implement the various aspects described herein. Various modifications to these aspects will be apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects. Therefore, the claims are not intended to be limited to the aspects shown herein. All structural and functional equivalents of the elements of the various aspects described in this disclosure that are known or about to be known to those skilled in the art shall be covered by the claims.

Claims

1. A method for query semantic analysis in knowledge base question answering, comprising: obtaining an initial query; performing natural language understanding on the initial query to extract one or more slot frames from the initial query; generating a normalized query corresponding to the initial query based on at least the one or more slot frames; and performing constituent syntax analysis on the normalized query to generate a logical form corresponding to the normalized query. The natural language understanding comprises at least one of:

2. The method of claim 1, wherein, time information extraction, named entity recognition, negation expression recognition, customized natural language understanding, and rule-based expression conversion. The generating the normalized query comprises:

3. The method of claim 1, wherein, performing normalization processing on the one or more slot frames to obtain one or more normalized slot frames; and generating the normalized query by at least concatenating the one or more normalized slot frames. The generating the normalized query comprises:

4. The method of claim 3, wherein, concatenating one or more words corresponding to the one or more normalized slot frames with at least a portion of words in the initial query into the normalized query. The normalization processing comprises at least one of:

5. The method of claim 3, wherein, reordering processing, expression completion processing, time normalization processing, and time-specific logic processing. 6.The method of claim 3, wherein the normalization processing is performed based on at least one or more predetermined processing rules. 7.The method of claim 3, wherein the normalization processing is performed based on at least a configuration file comprising one or more predetermined processing rules for a specific domain. 8.The method of claim 1, wherein the natural language understanding is performed by a statistical model. 9.The method of claim 1, wherein the constituent syntax analysis is performed by a context-free grammar (CFG) parser. 10.The method of claim 1, further comprising: converting the logical form into a structured query applicable to a knowledge base. 11.An apparatus for query semantic analysis in knowledge base question answering, comprising: an initial query obtaining module configured to obtain an initial query; a natural language understanding module configured to perform natural language understanding on the initial query to extract one or more slot frames from the initial query; a normalized query generating module configured to generate a normalized query corresponding to the initial query based on at least the one or more slot frames; and a constituent syntax analysis module configured to perform constituent syntax analysis on the normalized query to generate a logical form corresponding to the normalized query. The natural language understanding comprises at least one of: time information extraction, named entity recognition, negation expression recognition, customized natural language understanding, and rule-based expression conversion.

12. The apparatus of claim 11, wherein, The normalized query generating module is configured to: perform normalization processing on the one or more slot frames to obtain one or more normalized slot frames; and 13. The apparatus of claim 11, wherein, generate the normalized query by at least concatenating the one or more normalized slot frames. The generating the normalized query comprises: ​ 14. The apparatus of claim 13, wherein, ​ one or more terms corresponding to the one or more canonical slot frames are concatenated with at least a portion of the terms in the initial query into the canonical query.

15. The apparatus of claim 13, wherein, The normalization processing includes at least one of: reordering processing, expression completion processing, temporal normalization processing, and time-specific logic processing.

16. The apparatus of claim 13, wherein, The normalization processing is performed based at least on one or more predetermined processing rules.

17. The apparatus of claim 13, wherein, The normalization processing is performed based at least on a configuration file including one or more predetermined processing rules for a particular domain.

18. The apparatus of claim 11, wherein, The natural language understanding is performed by a statistical model.

19. The apparatus of claim 11, wherein, The constituent syntax analysis is performed by a context-free grammar (CFG) parser.

20. An apparatus for query semantic analysis in a knowledge base question answering, comprising: at least one processor; and a memory storing computer-executable instructions that, when executed, cause the at least one processor to: obtain an initial query, perform natural language understanding on the initial query to extract one or more slot frames from the initial query, generate a canonical query corresponding to the initial query based at least on the one or more slot frames, and perform constituent syntax analysis on the canonical query to generate a logical form corresponding to the canonical query. ​

Citation Information

Patent Citations

  • A method and a device for acquiring information

    CN109947920A

  • Intelligent question and answer management system based on natural language processing

    CN110287305A

  • Question and answer processing method and device, computer device and storage medium

    CN110334179A

  • Semantic parsing of natural language query

    CN110727839A