Clause-based Semantic Parsing

By identifying independent clauses from the target statement and iteratively converting them into logical representations, the problem of insufficient accuracy of the machine learning model in complex statement analysis is solved, and a more efficient semantic analysis effect is achieved.

CN114091430BActive Publication Date: 2025-07-18MICROSOFT TECHNOLOGY LICENSING LLC
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010609575.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-06-29
Publication Date
2025-07-18
Estimated Expiration
2040-06-29

AI Technical Summary

Technical Problem

During semantic analysis, due to the limitations of the training corpus, existing machine learning models are difficult to effectively process statements with complex structures, resulting in insufficient parsing accuracy.

Method used

By determining clauses with independent semantics from the target statement and iteratively transforming based on the logical representation of the clause, the logical representation of the target statement is generated, and the joint training of the identification model and the logical representation analytical model is used to achieve more accurate semantic analysis.

Benefits of technology

It improves the accuracy of semantic analysis of complex structural statements, reduces dependence on additional training corpus, and improves the effect of semantic analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114091430B_ABST
    Figure CN114091430B_ABST
Patent Text Reader

Abstract

According to an implementation of the present disclosure, a clause-based semantic parsing scheme is provided. In this scheme, a first clause with independent semantics is determined from a target statement. Based on a first logical representation corresponding to the semantics of the first clause, the target statement is converted into a first intermediate statement. Subsequently, at least one logical representation corresponding to at least part of the semantics of the first intermediate statement is determined. The first logical representation obtained above and the at least one logical representation can be used to determine a target logical representation corresponding to the semantics of the target statement. Thus, more accurate semantic parsing can be achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0001] In recent years, artificial intelligence technology has developed rapidly and has been widely applied to various aspects of people's lives. As a research hotspot of artificial intelligence technology, semantic parsing of natural language (also known as semantic recognition) is one of the basic technologies for various artificial intelligence application scenarios. Semantic parsing technology interprets natural language as a logical representation that can be understood by machines, thereby supporting computers to perform corresponding subsequent operations. For example, intelligent voice assistants rely on semantic parsing technology to understand questions or instructions asked by users through natural language.

[0002] In addition to traditional grammar-based semantic parsing, some solutions can implement semantic parsing through machine learning models. However, due to the limitations of training corpora, it is difficult to guarantee the accuracy of semantic parsing performed by current machine learning models. Summary of the Invention

[0003] According to an implementation of the present disclosure, a clause-based semantic parsing solution is provided. In this solution, a first clause with independent semantics is determined from a target statement. Based on a first logical representation corresponding to the semantics of the first clause, the target statement is converted into a first intermediate statement. Subsequently, at least one logical representation corresponding to at least part of the semantics of the first intermediate statement is determined. The first logical representation and the at least one logical representation obtained above can be used to determine a target logical representation corresponding to the semantics of the target statement. Thus, more accurate semantic parsing can be achieved.

[0004] The Summary of the Invention section is provided to introduce the identification of concepts in a simplified form, which will be further described in the Detailed Description below. The Summary of the Invention section is not intended to identify the key features or main features of the claimed subject matter, nor is it intended to limit the scope of the claimed subject matter. Brief Description of the Drawings

[0005] Figure 1 A block diagram showing a computing environment in which multiple implementations of the present disclosure can be implemented;

[0006] Figure 2 A flowchart showing the process of semantic parsing according to some implementations of the present disclosure;

[0007] Figure 3 A schematic diagram showing clause-based semantic parsing according to some implementations of the present disclosure; and

[0008] Figure 4 A flowchart showing the process of determining at least one logical representation according to some implementations of the present disclosure;

[0009] Figure 5A flowchart showing a process of a training corpus of a production clause recognition model according to some implementations of the present disclosure.

[0010] In these figures, the same or similar reference signs are used to denote the same or similar elements. Detailed implementation

[0011] The present disclosure will now be described with reference to several example implementations. It should be understood that these implementations are described only to enable those of ordinary skill in the art to better understand and thus implement the present disclosure, rather than to imply any limitation on the scope of the present disclosure.

[0012] As used herein, the term "comprising" and its variants are to be construed as open-ended terms meaning "including but not limited to". The term "based on" is to be construed as "at least partially based on". The terms "one implementation" and "an implementation" are to be construed as "at least one implementation". The term "another implementation" is to be construed as "at least one other implementation". The terms "first", "second", etc. may refer to different or the same objects. There may be other explicit and implicit definitions hereinafter.

[0013] As discussed above, some solutions can implement semantic parsing through a machine learning model. Due to the limitations of the training corpus, traditionally, machine learning models can generally only perform better semantic parsing on input sentences with a similar structure to the training corpus, and it is difficult to effectively parse sentences with complex structures.

[0014] According to an implementation of the present disclosure, a solution for super-resolution image reconstruction is proposed. In this solution, a first clause with independent semantics is determined from a target sentence. Based on a first logical representation corresponding to the semantics of the first clause, the target sentence is converted into a first intermediate sentence. Subsequently, at least one logical representation corresponding to at least part of the semantics of the first intermediate sentence is determined. The first logical representation and the at least one logical representation obtained above can be used to determine a target logical representation corresponding to the semantics of the target sentence. Thus, the defects that the existing semantic parsing model has limited training data and is difficult to process sentences with complex structures can be overcome, and more accurate semantic parsing can be achieved.

[0015] The following further describes various example implementations of this solution in detail with reference to the accompanying drawings.

[0016] Figure 1 A block diagram of a computing environment 100 in which multiple implementations of the present disclosure can be implemented is shown. It should be understood that Figure 1 The computing environment 100 shown is merely exemplary and should not constitute any limitation on the functions and scope of the implementations described in the present disclosure. As Figure 1As shown, the computing environment 100 includes a computing device 102 in the form of a general-purpose computing device. The components of the computing device 102 may include, but are not limited to, one or more processors or processing units 110, a memory 120, a storage device 130, one or more communication units 140, one or more input devices 150, and one or more output devices 160.

[0017] In some implementations, the computing device 102 may be implemented as various user terminals or service terminals. The service terminal may be a server, a large computing device, etc. provided by various service providers. The user terminal is, for example, any type of mobile terminal, fixed terminal, or portable terminal, including mobile phones, multimedia computers, multimedia tablets, Internet nodes, communicators, desktop computers, laptop computers, notebook computers, netbook computers, tablet computers, personal communication system (PCS) devices, personal navigation devices, personal digital assistants (PDAs), audio / video players, digital cameras / cameras, positioning devices, television receivers, radio broadcast receivers, e-book devices, gaming devices, or any combination thereof, including accessories and peripherals of these devices or any combination thereof. It is also foreseeable that the computing device 102 can support any type of user interface (such as a "wearable" circuit, etc.).

[0018] The processing unit 110 may be an actual or virtual processor and is capable of performing various processes according to the programs stored in the memory 120. In a multi-processor system, multiple processing units execute computer-executable instructions in parallel to improve the parallel processing ability of the computing device 102. The processing unit 110 may also be referred to as a central processing unit (CPU), a microprocessor, a controller, or a microcontroller.

[0019] The computing device 102 generally includes multiple computer storage media. Such media may be any accessible media available to the computing device 102, including but not limited to volatile and non-volatile media, removable and non-removable media. The memory 120 may be a volatile memory (such as registers, caches, random access memory (RAM)), a non-volatile memory (such as read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory), or some combination thereof. The memory 120 may include a semantic parsing module 122, and these program modules are configured to perform the functions of various implementations described herein. The semantic parsing module 122 may be accessed and run by the processing unit 110 to implement the corresponding functions. The storage device 130 may be a removable or non-removable medium and may include a machine-readable medium that can be used to store information and / or data and can be accessed within the computing device 102.

[0020] The functions of the components of computing device 102 can be implemented with a single computing cluster or multiple computing machines that are capable of communicating via a communication connection. Thus, computing device 102 can operate in a networked environment using a logical connection to one or more other servers, personal computers (PCs), or another general network node. Computing device 102 can also communicate, as needed, with one or more external devices (not shown) via communication unit 140, such as database 170, other storage devices, servers, display devices, etc., communicate with one or more devices that enable a user to interact with computing device 102, or communicate with any device that enables computing device 102 to communicate with one or more other computing devices (e.g., network card, modem, etc.). Such communication can be performed via an input / output (I / O) interface (not shown).

[0021] Input device 150 can be one or more of various input devices, such as a mouse, keyboard, trackball, voice input device, camera, etc. Output device 160 can be one or more output devices, such as a display, speaker, printer, etc.

[0022] Computing device 102 can be used for clause-based semantic parsing. To perform semantic parsing, computing device 102 can obtain target statement 104. In some implementations, computing device 102 can receive target statement 104 via input device 150. Depending on the specific scenario, different types of input devices 150 can be used to receive target statement 104.

[0023] Alternatively, target statement 104 can be input by the user via a different device from computing device 102. Subsequently, target statement 104 can be sent to communication unit 140 of computing device 102 via a wired or wireless network.

[0024] Alternatively, target statement 104 can also be data stored in storage device 130 inside computing device 102. Exemplarily, target statement 104 can be output by other modules running on computing device 102. For example, target statement 104 can be the result of voice recognition of voice data input by the user by a voice recognition module running on computing device 102.

[0025] In Figure 1 the example, target statement 104 is the statement “How many rivers run through the states bordering Colorado?” written in English. It should be understood that target statement 104 can be written in any language, and the present disclosure is not intended to be limited thereto.

[0026] The target statement 104 is used as the input to the semantic parsing module 122. The processing unit 110 of the computing device 102 is capable of running the semantic parsing module 122 to generate a target logical representation 106 “count(river(traverse_2(state(next_to_2(stateid(‘colorado’))))))” corresponding to the semantics of the target statement 104.

[0027] It should be understood that the target logical representation 106 can be represented in a computer - understandable language (rather than natural language), and the specific example of the above - mentioned target logical representation 106 is only illustrative. As needed, the target logical representation 106 can also take any appropriate form, such as a functional query language, a PROLOG query language, an SQL query language, a SPARQL query language, or a Lambda - DCS query language, etc. The present disclosure is not intended to limit the specific form of the target logical representation 106.

[0028] In some implementations, the semantic parsing module 122 can provide the target logical representation 106 as the input to other modules running on the computing device 102, so that the computing device 102 performs additional actions. For example, based on the target logical representation 106, other functional modules running on the computing device 102 can obtain the answer corresponding to the target logical representation 106 and provide the answer to the output module 106. The output module 106 can provide the answer to the user in any appropriate form.

[0029] Alternatively, the semantic parsing module 122 can also send the target logical representation 106 to a device different from the computing device 102 via a wired or wireless network, so that the device performs additional actions. For example, when the target statement 104 is a command statement associated with a control device, the target logical representation 106 can cause the device to perform the actions corresponding to the command statement.

[0030] Examples of implementing clause - based semantic parsing in the semantic parsing module 122 will be discussed in detail below.

[0031] Example process

[0032] Figure 2 A flowchart of a semantic parsing process 200 according to some implementations of the present disclosure is shown. The process 200 can be implemented by the computing device 102, for example, it can be implemented in the semantic parsing module 122 of the computing device 102.

[0033] As Figure 2As shown, in 202, computing device 102 determines a first clause with independent semantics from target statement 104. Herein, target statement 104 refers to a statement represented in natural language. As discussed above, target statement 104 may be input by a user or generated by other modules, etc. It should be understood that computing device 102 may obtain target statement 104 to be parsed in any suitable manner, and the present disclosure is not intended to be limited thereto.

[0034] The following will be described in conjunction with Figure 3 the examples of Figure 2 the process discussed in Figure 3 FIG. 300 is a schematic diagram of clause-based semantic parsing according to some implementations of the present disclosure. As Figure 3 shown, computing device 102 may determine a first clause 302 "the states bordering Colorado" with independent semantics from target statement 104.

[0035] In some implementations, computing device 102 may use a machine learning model to determine first clause 302 from target statement 104. For example, computing device 102 may input target statement 104 into a clause recognition model to obtain the start position and end position of first clause 302 with independent semantics in target statement 104.

[0036] For example, for Figure 3 the example of

[0037] the clause recognition model may output, for example, the start position of first clause 302 as the word order of the word "the" in target statement 104 (e.g., 6), and the end position as the word order of the word "Colorado" in target statement 104 (e.g., 9). Alternatively, the start position may also be the character order of the starting letter "t" of the word "the" in the target statement, and the end position is the character order of the ending letter "o" in the word "Colorado" in the target statement.

[0038] It should be understood that the start position and end position are only for uniquely identifying first clause 302 from target statement 104, and any suitable position information may be used to indicate the start position and end position or identify the position of first clause 302 in target statement 104, and the present disclosure is not intended to be limited thereto.

[0038] In some implementations, the clause recognition model may be trained based on a plurality of training statements and the position information of independent clauses with independent semantics in each training statement. Similar to the output of the clause recognition model, the position information may indicate the start position and end position of the independent clause in the training statement. The objective function of the clause recognition model may be expressed as:

[0039]

[0040] Among them, φ represents the parameters of the clause recognition model, represents the training data set, s represents an independent clause, x represents a training sentence, and p(s|x) represents the conditional probability of determining s from x.

[0041] In some implementations, the position information of the independent clause can be labeled manually, for example. Alternatively, the position information can also be generated based on the basic training data used to train the logical representation parsing model. The basic training data only includes the original sentence and the corresponding logical representation, without the position information of the independent clause. The process of determining the position information based on the basic training data will be described in detail below in combination with the training process of the model.

[0042] At 204, the computing device 102 converts the target sentence into a first intermediate sentence based on the first logical representation corresponding to the semantics of the first clause. Specifically, the computing device 102 can first determine the first logical representation corresponding to the semantics of the first clause.

[0043] In some implementations, the computing device 102 can also use a machine learning model to determine the first logical representation. It should be understood that the computing device 102 can use any appropriate logical representation parsing model to generate the first logical representation.

[0044] Exemplarily, the sequence-to-sequence semantic parsing model proposed by Dong and Lapata in 2016 can be used to generate the first logical representation, and this model includes an encoder and a decoder. It should be understood that an existing appropriate training set can be used to train this model so that the model can generate a logical representation corresponding to the semantics of the sentence.

[0045] In Figure 3 example, the first clause 104 is converted into the corresponding first logical representation 304 “state(next_to_2(stateid(‘colorado’)))”.

[0046] Subsequently, the computing device 102 can also determine the simplified representation corresponding to the first logical representation. Exemplarily, the syntax-directed transformation algorithm proposed by Aho and Ullman in 1969 can be used to determine the simplified representation of the first logical representation. In Figure 3 example, according to this transformation method, the first clause 302 “the states bordering Colorado” can be represented as the simplified representation 310 “$state$”. It should be understood that any other appropriate method for determining the simplified representation can also be used, and the present disclosure is not intended to limit this.

[0047] Further, the computing device 102 may replace the first clause in the target statement with a simplified representation of the first logical representation to obtain an intermediate statement. In Figure 3 the example, after replacing the first clause 302 in the target statement 104 with the simplified representation 310, the intermediate statement 306 “How many rivers run through $state$” can be obtained.

[0048] At 206, the computing device 102 determines at least one logical representation corresponding to at least a part of the semantics of the first intermediate statement.

[0049] The following will describe the detailed process of 206 in conjunction with Figure 4 to describe the detailed process of 206, Figure 4 FIG. 400 is a flowchart showing a process of determining at least one logical representation according to some implementations of the present disclosure.

[0050] As Figure 4 shown, at 402, the computing device 102 may determine whether the first intermediate statement includes a second clause having an independent semantics. Continuing to refer to Figure 3 the example, the computing device 102 may use a clause recognition model to continue processing the first intermediate statement 306 to determine whether the first intermediate statement 306 further includes a second clause having an independent semantics.

[0051] In response to determining at 402 that the first intermediate statement does not include a second clause having an independent semantics, the process 400 proceeds to block 410. At 410, the computing device 102 may determine a logical representation corresponding to the semantics of the first intermediate statement as at least one logical representation. Specifically, the computing device 102 may use the logical representation parsing model discussed above to generate a logical representation corresponding to the semantics of the first intermediate statement.

[0052] Conversely, if it is determined at 402 that the first intermediate statement includes a second clause having an independent semantics, the process 400 proceeds to block 404. At 404, the computing device 102 may convert the first intermediate statement into a second intermediate statement based on a second logical representation corresponding to the semantics of the second clause.

[0053] In Figure 3 the example, the computing device 102 may, for example, use a clause recognition model to determine that the first intermediate statement 306 further includes a second clause 308 “rivers run through $state$” having an independent semantics.

[0054] Similar to the steps discussed with reference 204, computing device 102 may determine a second logical representation 312 "river(traverse_2($state$))" corresponding to the semantics of the second clause 308. Computing device 102 may determine a simplified representation 316 "$river$" of the second logical representation 312. Subsequently, computing device 102 may replace the second clause 308 in the first intermediate statement 306 with the simplified representation 316 to obtain a second intermediate statement 314.

[0055] At 406, computing device 102 may determine a third logical representation corresponding to at least part of the semantics of the second intermediate statement.

[0056] Specifically, computing device 102 may refer to the steps of 402, 404, and 410 to generate a third logical representation corresponding to at least part of the semantics of the second intermediate statement. That is, computing device 102 may iteratively determine whether the generated second intermediate statement still includes a clause with independent semantics. If it includes a clause with independent semantics, computing device 102 may iteratively execute methods 402 - 406 to sequentially parse out the logical representation corresponding to the clause with independent semantics. On the contrary, after several iterations of parsing, if the generated intermediate statement no longer includes a clause with independent semantics, computing device 102 may generate a logical representation corresponding to all the semantics of this intermediate statement and terminate the iteration.

[0057] Continuing Figure 3 the example, computing device 102 may use a clause generation model to determine that the second intermediate statement 314 no longer includes a clause with independent semantics. Accordingly, computing device 102 may generate a third logical representation 318 "count($river$)" corresponding to all the semantics of the second intermediate statement 314 and terminate the iterative parsing process.

[0058] At 408, computing device 102 may determine at least one logical representation based at least on the second logical representation and the third logical representation. Specifically, computing device 102 may use the second logical representation and at least one third logical representation obtained by iterative parsing as at least one logical representation corresponding to at least part of the semantics of the first intermediate statement.

[0059] Taking Figure 3 as an example, computing device 102 may determine that at least one logical representation corresponding to at least part of the semantics of the first intermediate statement 306 includes: the second logical representation 312 and the third logical representation 318.

[0060] At 208, the computing device 102 determines a target logical representation corresponding to the semantics of the target statement based on the first logical representation and at least one logical representation. Specifically, the computing device 102 can determine the target logical representation by combining the first logical representation and at least one logical representation.

[0061] Exemplarily, in the case of using a simplified representation to replace the corresponding logical representation, the computing device 102 can sequentially use the logical representation to replace the simplified representation to obtain a logical representation corresponding to the semantics of the target statement.

[0062] For Figure 3 the example, the computing device 102 can use the first logical representation 304, the second logical representation 312, and the third logical representation 318 to generate the target logical representation. Specifically, the computing device 102 can use the first logical representation 304 to replace the simplified representation 310 in the second logical representation 312 to obtain the logical representation "river(traverse_2(state(next_to_2(stateid('colorado')))))". Subsequently, the computing device 102 can use this logical representation to replace the simplified representation 316 corresponding to the second logical representation 312 in the third logical representation 318, thereby obtaining the target logical representation as: count(river(traverse_2(state(next_to_2(stateid('colorado')))))).

[0063] Based on the manner discussed above, the implementation of the present disclosure can iteratively parse the logical representations of the clauses included in the target statement, thereby converting a complex target statement into a combination of logical representations of multiple simple clauses. Since the training corpus of the current semantic parsing model is usually limited, these semantic parsing models often have difficulty processing statements with complex grammatical structures. Through the clause-based semantic parsing method of the present disclosure, the embodiments of the present disclosure can effectively process statements with complex structures without relying on additional training corpus, thereby improving the accuracy of semantic parsing.

[0064] Training of the model

[0065] As discussed above, the present disclosure can use a clause recognition model to recognize clauses with independent semantics from the target statement and use a logical representation parsing model to determine the logical representation corresponding to the semantics of the clause. The training processes of the clause recognition model and the logical representation parsing model will be discussed in detail below.

[0066] In some implementations, the clause recognition model and the logic parsing model can be trained independently. It should be understood that the corpus for training the logic parsing model is easily obtainable, and the logic parsing model can be trained using existing appropriate training corpora. In contrast, there is currently no publicly available training corpus for the clause recognition model.

[0067] On the one hand, as discussed above, the training corpus for training the clause recognition model can be produced using artificial standards. However, such an approach requires a large amount of human input, and the amount of data in the obtained training corpus is usually limited. This will greatly affect the accuracy of the model.

[0068] According to some implementations of the present disclosure, the existing corpus for training the logic parsing model can be used to produce the training corpus for training the clause recognition model. The following will be combined with Figure 5 to describe the flowchart of process 500 for producing the training corpus of the clause recognition model according to some implementations of the present disclosure.

[0069] In some implementations, process 500 can be implemented by computing device 102. It should be understood that process 500 for producing the training corpus can also be executed by a device different from computing device 102. For ease of description, process 500 will be described below in conjunction with computing device 102.

[0070] As Figure 5 shown, at 502, computing device 102 can determine the statement logic representation corresponding to the training statement. For example, the existing training data set for training the logic representation parsing model can be represented as which includes multiple training instances (x, y), where x represents the training statement and y represents the corresponding statement logic representation. Computing device 102 can obtain the training statement x and the corresponding statement logic representation y from the training data set

[0071] At 504, computing device 102 can determine the clause logic representation of the candidate clauses in the training statement. Specifically, computing device 102 can, for example, traverse the start position and end position in the training statement to determine the corresponding candidate clauses. Subsequently, computing device 102 can, for example, use the existing trained logic representation parsing model to determine the clause logic representation of the candidate clauses.

[0072] At 506, computing device 102 can determine whether the statement logic representation includes the clause logic representation. In some implementations, for simplicity, if it is determined at 506 that the statement logic representation includes the clause logic representation, computing device 102 can directly determine the candidate clause as an independent clause.

[0073] ​Alternatively, since there may be multiple candidate clauses in the training statement whose clause logical representations are included in the statement logical representation, computing device 102 may perform additional steps to determine whether a candidate clause can be used as an independent clause with an independent semantics.

[0074] Specifically, if it is determined at 506 that the statement logical representation includes a clause logical representation, process 500 may proceed to 508. At 508, computing device 102 may convert the training statement into an intermediate training statement based on the clause logical representation.

[0075] It should be understood that the process of 204 may be referred to for converting the training statement into an intermediate training statement. Specifically, computing device 102 may first determine a simplified representation of the clause logical representation and use this simplified representation to replace the candidate clause in the training statement to obtain the intermediate training statement.

[0076] At 510, computing device 102 may determine a first intermediate logical representation of the intermediate training statement. Specifically, computing device 102 may utilize an existing trained logical representation parsing model to determine the first intermediate logical representation of the intermediate training statement. For example, the first intermediate logical representation may be expressed as:

[0077]

[0078] where z0 represents an existing trained logical representation parsing model, z0() represents using the parsing model to process the statement in the parentheses, s represents the candidate clause, d(z0(s)) represents the simplified representation of the clause logical representation of the candidate clause, x represents the training statement, represents replacing s with d(z0(s)) in x.

[0079] At 512, computing device 102 may convert the statement logical representation into a second intermediate logical representation based on the clause logical representation. Specifically, computing device 102 may use the simplified representation of the clause logical representation to replace the clause logical representation in the statement logical representation, thereby obtaining the second intermediate logical representation. For example, the second intermediate logical representation may be expressed as:

[0080]

[0081] where y represents the statement logical representation, represents replacing z0(s) with d(z0(s)) in y.

[0082] At 514, computing device 102 may determine the difference between the first intermediate logical representation and the second intermediate logical representation. For example, computing device 102 may determine the edit distance between the first logical representation and the second logical representation as the difference.

[0083] At 516, the computing device 102 may determine a candidate clause as an independent clause based on the difference. In some implementations, when the computing device 102 determines that the difference is less than a threshold, it may determine the candidate clause as a clause with independent semantics. Alternatively, the computing device 102 may select a predetermined number of candidate clauses with the smallest difference determined from the training statements as clauses with independent semantics.

[0084] Based on the methods discussed above, implementations of the present disclosure may utilize an existing training corpus for training a logical representation parsing model to generate a training corpus for training a clause recognition model. Through an automated corpus generation process, the cost of manual annotation can be significantly reduced, and the accuracy of the clause recognition model can be improved.

[0085] It can be seen that in the process of creating a training corpus for training a clause recognition model, a logical representation parsing model is also utilized. It should be understood that this logical representation parsing model may be the same as or different from the logical representation parsing model used in the process of generating the logical representation of clauses in the reference Figure 2 process.

[0086] In some implementations, the logical representation parsing model for generating the logical representation of clauses may be based on the logical representation parsing model used for creating the training corpus (for convenience of distinction, referred to as the initial logical representation parsing model). It should be understood that the initial logical representation parsing model may be trained based on an existing training data set.

[0087] However, since the existing training data set usually does not include intermediate statements obtained by replacing clauses with simplified representations, such an initial logical representation parsing model may not perform well when processing intermediate statements.

[0088] Furthermore, after obtaining the clause recognition model, the computing device 102 may, for example, convert the initial training data set into a new training data set which includes a plurality of training instances (x′, y′), where x′ and y′ can be expressed as:

[0089]

[0090]

[0091] For the definitions of the elements in formulas (4) and (5), see the descriptions in formulas (2) and (3), which will not be elaborated here.

[0092] The computing device 102 may utilize the new training data set to train the initial logical representation parsing model so that the trained logical representation parsing model can well parse intermediate statements including simplified representations.

[0093] The methods of independently training the clause recognition model and the logical representation parsing model have been introduced above. In some implementations, the clause recognition model and the logical representation parsing model can also be jointly trained based on the same training dataset.

[0094] Exemplarily, a reparameterization method can be adopted to jointly train the clause recognition model and the logical representation parsing model. For example, the Gumble-Softmax method can be used to approximate the clauses with independent semantics of the discrete hidden variables, so as to realize the joint training of the clause recognition model and the logical representation parsing model.

[0095] Alternatively, a policy gradient method can also be adopted to jointly train the clause recognition model and the logical representation parsing model. Specifically, Monte Carlo sampling can be used to sample the output of the clause recognition model to obtain the corresponding clauses. Subsequently, the method of using the simplified representation of the logical representation to replace the clauses discussed above can be used to replace the statements to obtain the clauses and the replaced statements, and the logical representation parsing model can be used to process them respectively to obtain the corresponding two logical representations. During the training process, the training objective is to make the combination of the two logical representations close to the logical representation truth value corresponding to the training statement.

[0096] It should be understood that the above joint training methods are only adaptable, and other appropriate joint training methods can also be designed according to needs.

[0097] Example implementation

[0098] Some example implementations of the present disclosure are listed below.

[0099] In a first aspect, the present disclosure provides a computer-implemented method, including: determining a first clause with independent semantics from a target statement; converting the target statement into a first intermediate statement based on a first logical representation corresponding to the semantics of the first clause; determining at least one logical representation corresponding to at least part of the semantics of the first intermediate statement; and determining a target logical representation corresponding to the semantics of the target statement based on the first logical representation and the at least one logical representation.

[0100] In some implementations, determining at least one logical representation includes: if it is determined that the first intermediate statement includes a second clause with independent semantics,

[0101] converting the first intermediate statement into a second intermediate statement based on a second logical representation corresponding to the semantics of the second clause; and determining a third logical representation corresponding to at least part of the semantics of the second intermediate statement; and determining at least one logical representation based on at least the second logical representation and the third logical representation.

[0102] In some implementations, determining the first clause includes: identifying the first clause from the target statement by using a clause identification model, where the clause identification model is trained based on multiple training statements and the position information of independent clauses with independent semantics in each training statement.

[0103] In some implementations, the position information indicates the start position and the end position of the independent clause in the training statement.

[0104] In some implementations, the method further includes: determining a statement logic representation corresponding to the training statement; determining a clause logic representation of a candidate clause in the training statement; and

[0105] if it is determined that the statement logic representation includes the clause logic representation, determining the candidate clause as an independent clause.

[0106] In some implementations, the method further includes: determining a statement logic representation corresponding to the training statement; determining a clause logic representation of a candidate clause in the training statement; and if it is determined that the statement logic representation includes the clause logic representation, based on the clause logic representation, converting the training statement into an intermediate training statement; determining a first intermediate logic representation of the intermediate training statement; based on the clause logic representation, converting the statement logic representation into a second intermediate logic representation; and based on the difference between the first intermediate logic representation and the second intermediate logic representation, determining the candidate clause as an independent clause.

[0107] In some implementations, the first logic representation is determined by using a logic representation parsing model, and the clause identification model and the logic representation parsing model are jointly trained based on the same training data set.

[0108] In some implementations, converting the target statement into an intermediate statement includes: replacing the first clause in the target statement with a simplified representation of the first logic representation to obtain the intermediate statement.

[0109] In some implementations, determining the target logic representation of the target statement includes: combining the first logic representation and at least one logic representation to determine the target logic representation.

[0110] In a second aspect, a device is provided. The device includes: a processing unit; and a memory coupled to the processing unit and containing instructions stored thereon, the instructions, when executed by the processing unit, cause the device to perform actions, the actions including: determining a first clause with independent semantics from the target statement; based on a first logic representation corresponding to the semantics of the first clause, converting the target statement into a first intermediate statement; determining at least one logic representation corresponding to at least part of the semantics of the first intermediate statement; and based on the first logic representation and the at least one logic representation, determining a target logic representation corresponding to the semantics of the target statement.

[0111] In some implementations, determining at least one logical representation includes: if it is determined that a first intermediate statement includes a second clause with independent semantics, converting the first intermediate statement into a second intermediate statement based on a second logical representation corresponding to the semantics of the second clause; and determining a third logical representation corresponding to at least part of the semantics of the second intermediate statement; and determining at least one logical representation based at least on the second logical representation and the third logical representation.

[0112] In some implementations, determining a first clause includes: identifying the first clause from a target statement by using a clause identification model, where the clause identification model is trained based on a plurality of training statements and position information of independent clauses with independent semantics in each training statement.

[0113] In some implementations, the position information indicates the start position and the end position of an independent clause in a training statement.

[0114] In some implementations, the action further includes: determining a statement logical representation corresponding to a training statement; determining a clause logical representation of a candidate clause in the training statement; and if it is determined that the statement logical representation includes the clause logical representation, determining the candidate clause as an independent clause.

[0115] In some implementations, the action further includes: determining a statement logical representation corresponding to a training statement; determining a clause logical representation of a candidate clause in the training statement; and if it is determined that the statement logical representation includes the clause logical representation, converting the training statement into an intermediate training statement based on the clause logical representation; determining a first intermediate logical representation of the intermediate training statement; converting the statement logical representation into a second intermediate logical representation based on the clause logical representation; and determining the candidate clause as an independent clause based on the difference between the first intermediate logical representation and the second intermediate logical representation.

[0116] In some implementations, the first logical representation is determined by using a logical representation parsing model, and the clause identification model and the logical representation parsing model are jointly trained based on the same training data set.

[0117] In some implementations, converting a target statement into an intermediate statement includes: replacing a first clause in the target statement with a simplified representation of the first logical representation to obtain the intermediate statement.

[0118] In some implementations, determining a target logical representation of a target statement includes: combining the first logical representation and at least one logical representation to determine the target logical representation.

[0119] In a third aspect, a computer program product is provided. The computer program product is tangibly stored in a non-transitory computer storage medium and includes machine-executable instructions that, when executed by a device, cause the device to perform actions, the actions including: determining a first clause having independent semantics from a target statement; converting the target statement into a first intermediate statement based on a first logical representation corresponding to the semantics of the first clause; determining at least one logical representation corresponding to at least part of the semantics of the first intermediate statement; and determining a target logical representation corresponding to the semantics of the target statement based on the first logical representation and the at least one logical representation.

[0120] In some implementations, determining the at least one logical representation includes: if it is determined that the first intermediate statement includes a second clause having independent semantics, converting the first intermediate statement into a second intermediate statement based on a second logical representation corresponding to the semantics of the second clause; and determining a third logical representation corresponding to at least part of the semantics of the second intermediate statement; and determining the at least one logical representation based at least on the second logical representation and the third logical representation.

[0121] In some implementations, determining the first clause includes: identifying the first clause from the target statement using a clause identification model, where the clause identification model is trained based on a plurality of training statements and position information of independent clauses having independent semantics in each training statement.

[0122] In some implementations, the position information indicates the starting position and the ending position of the independent clause in the training statement.

[0123] In some implementations, the actions further include: determining a statement logical representation corresponding to the training statement; determining a clause logical representation of a candidate clause in the training statement; and if it is determined that the statement logical representation includes the clause logical representation, determining the candidate clause as an independent clause.

[0124] In some implementations, the actions further include: determining a statement logical representation corresponding to the training statement; determining a clause logical representation of a candidate clause in the training statement; and if it is determined that the statement logical representation includes the clause logical representation, converting the training statement into an intermediate training statement based on the clause logical representation; determining a first intermediate logical representation of the intermediate training statement; converting the statement logical representation into a second intermediate logical representation based on the clause logical representation; and determining the candidate clause as an independent clause based on the difference between the first intermediate logical representation and the second intermediate logical representation.

[0125] In some implementations, the first logical representation is determined using a logical representation parsing model, and the clause identification model and the logical representation parsing model are jointly trained based on the same training data set.

[0126] In some implementations, converting a target statement into an intermediate statement includes: replacing a first clause in the target statement with a simplified representation of a first logical representation to obtain the intermediate statement.

[0127] In some implementations, determining a target logical representation of a target statement includes: combining a first logical representation and at least one logical representation to determine the target logical representation.

[0128] The functions described above in this disclosure can be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that can be used include: Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), Systems on Chip (SOCs), Complex Programmable Logic Devices (CPLDs), and so on.

[0129] The program code for implementing the methods of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a dedicated computer, or other programmable data processing devices, such that when the program codes are executed by the processor or controller, the functions / operations specified in the flowchart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, executed partially on the machine and partially on a remote machine as an independent software package, or executed entirely on a remote machine or server.

[0130] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media would include electrical connections based on one or more wires, portable computer disks, hard disks, Random Access Memory (RAM), Read Only Memory (ROM), Erasable Programmable Read Only Memory (EPROM or Flash Memory), optical fibers, portable compact disc read only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0131] In addition, although the operations are depicted in a particular order, this should be understood as requiring that the operations be performed in the particular order shown or in sequential order, or that all illustrated operations be performed to achieve the desired result. In certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the present disclosure. Certain features that are described in the context of separate implementations may also be implemented in combination in a single implementation. Conversely, the various features that are described in the context of a single implementation may also be implemented separately or in any suitable sub-combination in multiple implementations.

[0132] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.

Claims

1. A computer - implemented method for clause - based semantic parsing, comprising: Determining a first clause with independent semantics from a target statement; Converting the target statement into a first intermediate statement based on a first logical representation corresponding to the semantics of the first clause, the first intermediate statement including the first logical representation; Determining at least one logical representation corresponding to at least part of the semantics of the first intermediate statement; If it is determined that the first intermediate statement includes a second clause with independent semantics, Converting the first intermediate statement into a second intermediate statement based on a second logical representation corresponding to the semantics of the second clause; and Determining a third logical representation corresponding to at least part of the semantics of the second intermediate statement; And Determining the at least one logical representation based at least on the second logical representation and the third logical representation; And Determining a target logical representation corresponding to the semantics of the target statement based on the first logical representation and the at least one logical representation.

2. The method according to claim 1, wherein determining the first clause comprises: Identifying a first clause from the target statement using a clause recognition model, wherein the clause recognition model is trained based on a plurality of training statements and position information of independent clauses with independent semantics in each training statement.

3. The method according to claim 2, wherein the position information indicates a start position and an end position of the independent clause in the training statement.

4. The method according to claim 2, further comprising: Determining a statement logical representation corresponding to the training statement; Determining a clause logical representation of a candidate clause in the training statement; And If it is determined that the statement logical representation includes the clause logical representation, determining the candidate clause as the independent clause.

5. The method according to claim 2, further comprising: Determining a statement logical representation corresponding to the training statement; Determining a clause logical representation of a candidate clause in the training statement; And If it is determined that the statement logical representation includes the clause logical representation, Converting the training statement into an intermediate training statement based on the clause logical representation; Determining a first intermediate logical representation of the intermediate training statement; Converting the statement logical representation into a second intermediate logical representation based on the clause logical representation; And Determining the candidate clause as the independent clause based on a difference between the first intermediate logical representation and the second intermediate logical representation.

6. The method according to claim 2, wherein the first logical representation is determined using a logical representation parsing model, and the clause recognition model and the logical representation parsing model are jointly trained based on the same training data set.

7. The method according to claim 1, wherein converting the target statement into a first intermediate statement comprises: Replacing the first clause in the target statement with a simplified representation of the first logical representation to obtain the first intermediate statement.

8. The method according to claim 1, wherein determining the target logical representation of the target statement comprises: Combine the first logical representation and the at least one logical representation to determine the target logical representation.

9. An apparatus for clause-based semantic parsing, comprising: A processing unit; And A memory, coupled to the processing unit and containing instructions stored thereon, the instructions, when executed by the processing unit, cause the apparatus to perform actions, the actions including: Determine a first clause with independent semantics from a target statement; Based on a first logical representation corresponding to the semantics of the first clause, convert the target statement into a first intermediate statement, the first intermediate statement including the first logical representation; Determine at least one logical representation corresponding to at least part of the semantics of the first intermediate statement, If it is determined that the first intermediate statement includes a second clause with independent semantics, Based on a second logical representation corresponding to the semantics of the second clause, convert the first intermediate statement into a second intermediate statement; and Determine a third logical representation corresponding to at least part of the semantics of the second intermediate statement; and Determine the at least one logical representation based at least on the second logical representation and the third logical representation; and Based on the first logical representation and the at least one logical representation, determine a target logical representation corresponding to the semantics of the target statement.

10. The apparatus according to claim 9, wherein determining the first clause includes: Identify a first clause from the target statement using a clause identification model, wherein the clause identification model is trained based on a plurality of training statements and position information of independent clauses with independent semantics in each training statement.

11. The apparatus according to claim 10, wherein the position information indicates a start position and an end position of the independent clause in the training statement.

12. The apparatus according to claim 10, the actions further including: Determine a statement logical representation corresponding to the training statement; Determine a clause logical representation of a candidate clause in the training statement; And If it is determined that the statement logical representation includes the clause logical representation, determine the candidate clause as the independent clause.

13. The apparatus according to claim 10, the actions further including: Determine a statement logical representation corresponding to the training statement; Determine a clause logical representation of a candidate clause in the training statement; And If it is determined that the statement logical representation includes the clause logical representation, Based on the clause logical representation, convert the training statement into an intermediate training statement; Determine a first intermediate logical representation of the intermediate training statement; Based on the clause logical representation, convert the statement logical representation into a second intermediate logical representation; And Based on the difference between the first intermediate logical representation and the second intermediate logical representation, determine the candidate clause as the independent clause.

14. The apparatus according to claim 10, wherein the first logical representation is determined using a logical representation parsing model, and the clause identification model and the logical representation parsing model are jointly trained based on the same training dataset.

15. The apparatus according to claim 9, wherein converting the target statement into a first intermediate statement comprises: Replacing a first clause in the target statement with a simplified representation of the first logical representation to obtain the first intermediate statement.

16. The apparatus according to claim 9, wherein determining a target logical representation of the target statement comprises: Combining the first logical representation and the at least one logical representation to determine the target logical representation.

17. A computer program product tangibly stored in a non-transitory computer storage medium and comprising machine-executable instructions that, when executed by a device, cause the device to perform operations, the operations comprising: Determining a first clause having independent semantics from a target statement; Based on a first logical representation corresponding to the semantics of the first clause, converting the target statement into a first intermediate statement, the first intermediate statement comprising the first logical representation; Determining at least one logical representation corresponding to at least part of the semantics of the first intermediate statement, if it is determined that the first intermediate statement comprises a second clause having independent semantics, Based on a second logical representation corresponding to the semantics of the second clause, converting the first intermediate statement into a second intermediate statement; and Determining a third logical representation corresponding to at least part of the semantics of the second intermediate statement; And Determining the at least one logical representation based at least on the second logical representation and the third logical representation; And Based on the first logical representation and the at least one logical representation, determining a target logical representation corresponding to the semantics of the target statement.

Citation Information

Patent Citations

  • Smart home linear sequential logic protocol generation method and device

    CN110705316A

  • System for semantic interpretation

    US20150331850A1