Semantic parsing method, device, electronic device and readable storage medium

Generating a specified sentence model for semantic analysis through synonym extension solves the problem that semantic analysis methods in the prior art cannot iterate quickly and support vertical fields, achieving high accuracy and flexibility.

CN113761932BActive Publication Date: 2025-05-16BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110195061.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-02-20
Publication Date
2025-05-16
Estimated Expiration
2041-02-20

AI Technical Summary

Technical Problem

Existing semantic analytic methods cannot iterate quickly when intent slot parsing errors, and cannot quickly support specific vertical fields or quickly change the parsing results as demand changes.

Method used

By loading the pre-built library of intention modules, obtaining the initial sentence model, determining feature words, and generating specified sentence model through synonyms extensions, performing semantic analytical matching to achieve rapid iteration and vertical domain support.

Benefits of technology

The accuracy and generalization ability of the semantic analysis device are realized, allowing flexible analysis of semantics, especially in the intention analysis of vertical fields, to quickly complete the requirements iteration and fix the semantic analysis problem.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113761932B_ABST
    Figure CN113761932B_ABST
Patent Text Reader

Abstract

The present disclosure provides a semantic parsing method, including receiving a speech sent by a user. The speech is parsed to obtain the semantics to be recognized contained in the speech. The semantics to be recognized are then matched with at least one specified sentence template to obtain a matching result, each of which contains at least one feature word and a synonym of the feature word, and the feature word and the synonym of the feature word represent the user's intention. Finally, the user's intention corresponding to the speech is determined based on the matching result. The present disclosure also provides a semantic parsing device, an electronic device and a computer-readable storage medium thereof.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and more specifically, to a semantic parsing method, device, electronic device, and readable storage medium. Background Art

[0002] With the rapid development of artificial intelligence, automatic control, communication and computer technology, smart speakers have become common household appliances. A major highlight of smart speakers is that they can realize voice dialogue, which covers multiple fields, such as home control, alarm clock, music, etc. For each specific field, the cloud needs to parse the specific intent and slot value of the user's instructions to the speaker.

[0003] In the process of realizing the concept of the present disclosure, the inventors found that there are at least the following problems in the related technology: the main methods for parsing intent slot values ​​include algorithm model training methods, which use a large amount of corpus and the corresponding deep learning model framework to train a model that can identify intent slots. When the voice emitted by the user is transmitted to the cloud, the cloud is responsible for converting the semantics contained in the user's voice into the format required by the model (generally in vector form) and passing it into the model for decoding, and finally obtaining the user's semantic intent and slot. However, the semantic parsing method implemented by model training cannot achieve rapid iteration when the semantic parsing engine parses the intent incorrectly. At the same time, it is impossible to quickly support specific vertical fields, nor can it quickly change the parsing results as needs change (such as modifying intent). Summary of the invention

[0004] In view of this, the present disclosure provides a semantic parsing method and device.

[0005] One aspect of the present disclosure provides a semantic parsing method, including: receiving a voice sent by a user; parsing the voice to obtain semantics to be recognized contained in the voice; matching the semantics to be recognized with at least one specified sentence template to obtain matching results, each of the specified sentence templates containing at least one feature word and a synonym of the feature word, the feature word and the synonym of the feature word representing the user's intention; and determining the user's intention corresponding to the voice based on the matching results.

[0006] According to an embodiment of the present disclosure, before matching the semantics to be identified with at least one designated sentence template to obtain matching results, each designated sentence template includes at least one feature word and a synonym of the feature word, and the feature word and the synonym of the feature word represent the user intention, the method includes: loading a pre-built intention module library, the intention module library includes at least one intention module; obtaining at least one initial sentence template for each of the intention modules; determining at least one feature word for each of the initial sentence templates; performing synonym expansion on each of the feature words through a pre-built synonym set to obtain a designated sentence template corresponding to each of the initial sentence templates, the designated sentence template includes at least one feature word and a synonym of the feature word, and the feature word and the synonym of the feature word represent the user intention.

[0007] According to an embodiment of the present disclosure, the semantics to be identified are matched with at least one designated sentence pattern to obtain matching results, each designated sentence pattern contains at least one feature word and a synonym of the feature word, and the feature word and the synonym of the feature word represent the user intention, including: parsing the semantics to be identified to obtain at least one semantic entity; determining the semantic content corresponding to each semantic entity; matching each semantic content with a feature word of at least one designated sentence pattern and a synonym of the feature word to obtain matching results, each designated sentence pattern contains at least one feature word and a synonym of the feature word, and the feature word and the synonym of the feature word represent the user intention.

[0008] According to an embodiment of the present disclosure, determining the user intention corresponding to the speech based on the matching result includes: detecting the matching result, the matching result including the feature word for which the semantic match to be identified is successful or a synonym of the feature word; obtaining a designated sentence pattern corresponding to the feature word or a designated sentence pattern corresponding to a synonym of the feature word; and determining the user intention corresponding to the designated sentence pattern.

[0009] According to an embodiment of the present disclosure, determining the user intention corresponding to the voice based on the matching result further includes: detecting the matching result, where the matching result is a matching failure; and sending information requesting the user to resend the voice.

[0010] According to an embodiment of the present disclosure, the method further includes parsing the semantics to be recognized to obtain semantic logic; matching the semantic logic with the specified sentence template to obtain a matching result.

[0011] According to an embodiment of the present disclosure, the matching method is regular matching.

[0012] Another aspect of the present disclosure provides a semantic parsing device, including: a receiving module, used to receive a voice sent by a user; a parsing module, used to parse the voice to obtain the semantics to be recognized contained in the voice; a matching module, used to match the semantics to be recognized with at least one specified sentence template respectively to obtain a matching result, each of the specified sentence templates contains at least one feature word and a synonym of the feature word, and the feature word and the synonym of the feature word represent the user intention; a determination module, used to determine the user intention corresponding to the voice based on the matching result.

[0013] Another aspect of the present disclosure provides an electronic device, comprising one or more processors; and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any one of the above claims.

[0014] Another aspect of the present disclosure provides a computer-readable storage medium storing computer-executable instructions, which are used to implement the above method when executed.

[0015] According to the embodiments of the present disclosure, by performing synonym expansion on the feature words of the sentence model, the semantic parsing device has both accuracy and corresponding generalization ability, thus solving the technical problem of how to perform user semantic parsing. It realizes more flexible semantic parsing, especially intent parsing for specific vertical fields. It can also complete the iteration of semantic parsing requirements more quickly, speeding up the iteration of semantic parsing products. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The above and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:

[0017] Figure 1 An exemplary system architecture to which the semantic parsing method and apparatus of the present disclosure can be applied is schematically shown;

[0018] Figure 2 A flowchart of a semantic parsing method according to an embodiment of the present disclosure is schematically shown;

[0019] Figure 3A A flowchart of a semantic parsing method according to another embodiment of the present disclosure is schematically shown;

[0020] Figure 3B The structure diagram of the intent module library according to the embodiment of the present disclosure is schematically shown;

[0021] Figure 3C A flowchart of a semantic parsing method according to another embodiment of the present disclosure is schematically shown;

[0022] Figure 3D A flowchart of a semantic parsing method according to another embodiment of the present disclosure is schematically shown;

[0023] Figure 3E A flowchart of a semantic parsing method according to another embodiment of the present disclosure is schematically shown;

[0024] Figure 4 A block diagram schematically shows a semantic parsing device according to an embodiment of the present disclosure; and

[0025] Figure 5 A block diagram of an electronic device suitable for implementing a semantic parsing apparatus according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION

[0026] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.

[0027] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.

[0028] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification, and should not be interpreted in an idealized or overly rigid manner.

[0029] In the case of using expressions such as "at least one of A, B, and C, etc.", it should generally be interpreted in accordance with the meaning of the expression generally understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.). In the case of using expressions such as "at least one of A, B, or C, etc.", it should generally be interpreted in accordance with the meaning of the expression generally understood by those skilled in the art (for example, "a system having at least one of A, B, or C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).

[0030] The embodiments of the present disclosure provide a semantic parsing method and device. The method includes receiving a speech sent by a user, parsing the speech, and obtaining the semantics to be recognized contained in the speech. The semantics to be recognized are then matched with at least one specified sentence template to obtain a matching result, each of which contains at least one feature word and a synonym of the feature word, and the feature word and the synonym of the feature word represent the user's intention. Finally, the user's intention corresponding to the speech is determined based on the matching result.

[0031] Figure 1 The exemplary system architecture 100 to which the semantic parsing method and apparatus according to the embodiment of the present disclosure can be applied is schematically shown. It should be noted that: Figure 1 What is shown is merely an example of a system architecture to which the embodiments of the present disclosure can be applied, in order to help those skilled in the art understand the technical content of the present disclosure, but it does not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios.

[0032] like Figure 1 As shown, the system architecture 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired and / or wireless communication links, etc.

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

[0034] The terminal devices 101 , 102 , and 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.

[0035] The server 105 may be a server that provides various services, such as a background management server (only an example) that provides support for websites browsed by users using the terminal devices 101, 102, and 103. The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.

[0036] It should be noted that the semantic parsing method provided in the embodiment of the present disclosure can generally be executed by the server 105. Accordingly, the semantic parsing device provided in the embodiment of the present disclosure can generally be set in the server 105. The semantic parsing method provided in the embodiment of the present disclosure can also be executed by a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105. Accordingly, the semantic parsing device provided in the embodiment of the present disclosure can also be set in a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105. Alternatively, the semantic parsing method provided in the embodiment of the present disclosure can also be executed by the terminal devices 101, 102, or 103, or can also be executed by other terminal devices different from the terminal devices 101, 102, or 103. Accordingly, the semantic parsing device provided in the embodiment of the present disclosure can also be set in the terminal devices 101, 102, or 103, or in other terminal devices different from the terminal devices 101, 102, or 103.

[0037] For example, the semantics to be recognized can be received by any one of the terminal devices 101, 102, or 103 (for example, the terminal device 101, but not limited thereto), or imported into the terminal device 101 by an external device. Then, the terminal device 101 can locally execute the semantic parsing method provided by the embodiment of the present disclosure, or send the semantics to be recognized to other terminal devices, servers, or server clusters, and the semantic parsing method provided by the embodiment of the present disclosure can be executed by the other terminal devices, servers, or server clusters that receive the semantics to be recognized.

[0038] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to the implementation requirements.

[0039] Figure 2The flowchart of the semantic parsing method according to the embodiment of the present disclosure is schematically shown.

[0040] like Figure 2 As shown, the method includes operations S201 to S204.

[0041] In operation S201, a voice sent by a user is received.

[0042] In operation S202, the speech is parsed to obtain the semantics to be recognized contained in the speech.

[0043] In operation S203, the semantics to be identified are matched with at least one designated sentence pattern to obtain matching results, each designated sentence pattern includes at least one feature word and a synonym of the feature word, and the feature word and the synonym of the feature word represent the user intention.

[0044] In operation S204, the user intention corresponding to the speech is determined according to the matching result.

[0045] Typically, users send operating instructions to smart home appliances through voice. After receiving the voice, the smart home appliances parse the intent contained in the voice through sentence templates. Among them, sentence templates are generally considered to be set in advance. In order to improve the accuracy of recognition, developers often set multiple similar sentence templates to be stored in the server for use in semantic analysis. At the same time, storing a large number of sentence templates will lead to a decrease in the operating capacity of the system.

[0046] In the disclosed embodiment, for multiple similar sentence patterns, a synonym expansion method is used to expand the feature words in the initial sentence pattern, so as to expand a sentence pattern so that a sentence pattern can contain multiple similar meanings. After expansion, each sentence pattern has a high generalization ability and can parse complex semantics more accurately.

[0047] Specifically, the semantics to be recognized contained in the user's voice is matched with the expanded designated sentence pattern by matching with regular expressions. If the match is successful, the intention instruction corresponding to the designated sentence pattern is determined, and the intention instruction is sent to the target device, so that the target device executes the intention instruction.

[0048] At the same time, when there is a new intent that needs to be parsed, a new intent sentence template can be added directly. When the semantic expression needs to add a new mapping relationship or modify the mapping relationship, a sentence template can also be added directly. When there is a new synonym expression that needs to be supported, the corresponding synonym can be directly enriched. In this way, intent parsing or iteration can be quickly achieved by adding sentence templates.

[0049] Through the disclosed embodiments, by expanding the synonyms of the feature words of the sentence template, the semantic parsing device has both accuracy and corresponding generalization capabilities, and realizes more flexible semantic parsing, especially intent parsing for specific vertical fields. The strategy of semantic parsing through sentence templates can complete the iteration of semantic parsing requirements more quickly, and can quickly and specifically repair existing online semantic parsing problems, speed up the iteration of semantic parsing products, and further flexibly parse semantics to facilitate the processing of subsequent business.

[0050] Reference below Figure 3A to Figure 3E , combined with specific embodiments Figure 2 The method shown is further explained.

[0051] Figure 3A The flowchart of a semantic parsing method according to another embodiment of the present disclosure is schematically shown.

[0052] like Figure 3A As shown, before matching the semantics to be identified with at least one designated sentence template to obtain matching results, each designated sentence template contains at least one feature word and a synonym of the feature word, and the feature word and the synonym of the feature word represent the user's intention, the method includes operations S301 to S304.

[0053] In operation S301, a pre-built intent module library is loaded, where the intent module library includes at least one intent module.

[0054] In operation S302, at least one initial sentence template of each intention module is obtained.

[0055] In operation S303, at least one characteristic word of each initial sentence template is determined.

[0056] In operation S304, each feature word is synonymously expanded using a pre-constructed synonym set to obtain a designated sentence template corresponding to each initial sentence template, wherein the designated sentence template includes at least one feature word and a synonym of the feature word, and the feature word and the synonym of the feature word represent the user's intention.

[0057] Combination Figure 3B , Figure 3B The structural diagram of the intention module library according to an embodiment of the present disclosure is schematically shown.

[0058] like Figure 3BAs shown, the semantic parsing method provided by the present disclosure performs semantic parsing through an intention module library. The intention module library includes multiple intention modules, and each intention module contains multiple sentence models corresponding to the same intention, referred to as sentence models. Each sentence model contains feature words and synonyms of the feature words, that is, any intention module contains a sentence model after synonym expansion. Before performing semantic parsing, the initial sentence model contained in each intention module is synonym expanded, which improves the accuracy and generalization ability of semantic parsing.

[0059] It should be noted that the initial sentence template of each intent module in the intent module library is set by the developer. During the setting process, the initial sentence template is usually set according to the rule that an intent module contains sentence templates of multiple semantic logics.

[0060] Taking setting the temperature of an air conditioner as an example, the embodiments of the present disclosure are further explained.

[0061] When building an intent module library, you first need to determine the specific intent of the requirement. For example, define "set_temperature(inttemp)" as the intent to set the temperature to temp degrees, that is, the instruction to set the temperature. Then, improve the sentence model. The sentence model for setting the temperature includes but is not limited to the following:

[0062] Initial sentence template 1: "^{Set}{temperature}{to}{temp}{degrees}?$";

[0063] Initial sentence model 2: "^{temperature}{set}{to}{temp}{degrees}?$";

[0064] Initial sentence template 3: “^{temperature}{open}{temp}{degree}?{temperature}$”.

[0065] The above three initial sentence templates all express the intention of setting the temperature. The specific temperature value is in temp. The initial sentence template can be increased as the product demand increases. Technical personnel in this field can increase the form of the initial sentence template according to demand. As long as it meets the product requirements, it can be added. This disclosure does not limit the setting method of the initial sentence template.

[0066] In order to increase the generalization ability of semantic parsing and the matching speed, and to avoid the problem of slowing down the parsing speed due to unlimited addition of sentence patterns, before parsing the semantics, the initial sentence pattern is expanded with synonyms. In each initial sentence pattern, the content in "{}" identifies the feature word, and each feature word is expanded with synonyms. Specifically, "{set}" is expanded to synonyms such as "set|set|adjust"; "{for}" is expanded to synonyms such as "to|for|to|into". After the initial sentence pattern is expanded with synonyms, the entire sentence pattern has a certain generalization ability, which enables it to more accurately match different user semantics.

[0067] Furthermore, after the initial sentence pattern is synonymously expanded, the designated sentence pattern corresponding to each initial sentence pattern is obtained. For example, after the initial sentence pattern "^{set}{temperature}{to}{temp}{degrees}?$" is synonymously expanded, the designated sentence pattern "^(set|set|adjust)(temperature|heat)(to|to|to)(\d+)(degrees|°)?$" is obtained.

[0068] During the semantic parsing process, if a semantic parsing error occurs, the sentence template in the intent module library can be modified directly. Or when a new intent parsing needs to be added, a new intent module and its corresponding synonym extended sentence template can be directly added to the intent module library. Compared with the common speech recognition model, the semantic parsing process can be quickly adjusted by modifying the sentence template without considering adding a new iterative parsing model or collecting expectations to retrain the model, thus shortening the semantic parsing cycle.

[0069] In the actual semantic recognition process, the voice commands issued by users often contain very specific requirements. Therefore, the semantic analysis results need to be more accurate in specific vertical fields. At the same time, it is also necessary to ensure that the semantic analysis of the intent of a specific vertical field can be supplemented in a timely manner, or the semantic analysis strategy can be modified at any time according to the semantic analysis results.

[0070] Figure 3C The flowchart of a semantic parsing method according to another embodiment of the present disclosure is schematically shown.

[0071] like Figure 3C As shown, the semantics to be identified are matched with at least one designated sentence template to obtain matching results, each designated sentence template includes at least one feature word and a synonym of the feature word, and the feature word and the synonym of the feature word represent the user intention, including operations S305 to S307.

[0072] In operation S305, the semantics to be recognized is parsed to obtain at least one semantic entity.

[0073] In operation S306 , the semantic content corresponding to each semantic entity is determined.

[0074] In operation S307, each semantic content is matched with a feature word and a synonym of the feature word of at least one specified sentence pattern to obtain a matching result. Each specified sentence pattern contains at least one feature word and a synonym of the feature word, and the feature word and the synonym of the feature word represent the user's intention.

[0075] In the disclosed embodiment, the semantics to be identified are matched with the specified sentence template, specifically, the semantic entities contained in the semantics to be identified are matched with the characteristic words and synonyms of the characteristic words in the specified sentence template. Generally, the semantic entities include but are not limited to people, time, place, object, event, etc.

[0076] The following still takes setting the temperature as an example to further explain the embodiments of the present disclosure.

[0077] When the user inputs a voice containing the semantics "adjust the temperature to 30 degrees.", the semantics are parsed, and the semantic content corresponding to the semantic entity is obtained as follows: the object of execution is temperature, and the event of execution is adjustment to 30 degrees. The semantic content is further matched with the feature words and their synonyms to obtain a matching result. The matching result obtained is a successful match with the specified sentence pattern "^(set|set|adjust)(temperature|heat)(to|to|to)(\d+)(degree|°)?$".

[0078] Through the embodiments of the present disclosure, the semantic content contained in the semantics to be identified is specifically matched with the feature words and their synonyms, so as to achieve accurate matching of the keywords contained in the semantics to be identified and improve the matching capability.

[0079] It should be noted that the matching process also includes the matching of semantic logic. Specifically, the semantic parsing method also includes parsing the semantics to be recognized to obtain the semantic logic. The semantic logic is further matched with the specified sentence pattern to obtain a matching result. Since the feature words can only contain specific execution objects and execution events, and cannot contain the application scenarios of the execution instructions, the semantic logic needs to be matched. For example, the semantics contained in the specific voice sent to the smart device is "adjust the air conditioning mode to the cooling mode and then to the sleep mode after one hour." The current air conditioning mode is the default automatic mode. If only the feature words are parsed and matched, the intention parsed by the smart device may be "adjust the air conditioning model to the sleep mode and then to the cooling mode after one hour." The instruction executed is to adjust the air conditioning mode from the automatic mode to the sleep mode, and after one hour, adjust the sleep mode to the cooling mode. Without considering the semantic logic, the semantic parsing process may cause the user's intention to be misidentified.

[0080] Figure 3D The flowchart of a semantic parsing method according to another embodiment of the present disclosure is schematically shown.

[0081] like Figure 3D As shown, according to the matching result, determining the user intention corresponding to the voice includes operations S308 to S310.

[0082] In operation S308, the matching result is detected, and the matching result includes all the feature words or synonyms of the feature words that have successfully matched the semantics to be identified.

[0083] In operation S309, a designated sentence pattern corresponding to the feature word or a designated sentence pattern corresponding to a synonym of the feature word is obtained.

[0084] In operation S310, a user intention corresponding to a specified sentence pattern is determined.

[0085] In the disclosed embodiment, the intent and sentence template exist in the form of a key-value pair, where the key value is the intent, such as "set_temperature(int temp)", and the value is the sentence template. After successfully matching a feature word or its synonym, the specified sentence template corresponding to the feature word or its synonym is obtained. According to the stored key-value pair, the intent corresponding to the sentence template is determined, and the corresponding instruction is issued.

[0086] Figure 3E The flowchart of a semantic parsing method according to another embodiment of the present disclosure is schematically shown.

[0087] like Figure 3E As shown, determining the user intention corresponding to the voice according to the matching result also includes operations S311 to S312.

[0088] In operation S311, the matching result is detected, and the matching result is a matching failure;

[0089] In operation S312, information requesting the user to resend the voice is transmitted.

[0090] In the disclosed embodiment, the specific situation of the matching failure is that the voice sent by the user is not clear, which makes the received voice wrong, resulting in the parsed semantics to be recognized being wrong, or the wrong semantics to be recognized being parsed, etc. Therefore, in the matching process, the semantics to be recognized cannot be matched with the sentence template in the intention module library. In the case of a matching failure, the device can send a message to the user requesting the voice to be resent, so as to receive the user's voice again and further perform correct semantic parsing. Through the disclosed embodiment, the fault tolerance rate of the semantic parsing process is increased, and the accuracy of semantic parsing is improved.

[0091] Figure 4 A block diagram of a semantic parsing device according to an embodiment of the present disclosure is schematically shown.

[0092] like Figure 4 As shown, the semantic parsing device 400 includes:

[0093] The receiving module 410 is used to receive the voice sent by the user;

[0094] The parsing module 420 is used to parse the speech to obtain the semantics to be recognized contained in the speech;

[0095] A matching module 430 is used to match the semantics to be identified with at least one designated sentence pattern to obtain a matching result, each designated sentence pattern includes at least one feature word and a synonym of the feature word, and the feature word and the synonym of the feature word represent the user's intention;

[0096] The determination module 440 is used to determine the user intention corresponding to the speech according to the matching result.

[0097] According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits, or at least part of the functions of any one of them can be implemented in one module. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be split into multiple modules for implementation. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be at least partially implemented as hardware circuits, such as field programmable gate arrays (FPGAs), programmable logic arrays (PLAs), systems on chips, systems on substrates, systems on packages, application specific integrated circuits (ASICs), or can be implemented by hardware or firmware in any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware, and firmware, or in any appropriate combination of any of them. Alternatively, according to the embodiments of the present invention, one or more of the modules, submodules, units, and subunits can be at least partially implemented as computer program modules, and when the computer program modules are run, the corresponding functions can be performed.

[0098] For example, any multiple of the receiving module 410, the parsing module 420, the matching module 430, and the determining module 440 can be combined in one module / unit / subunit for implementation, or any one of the modules / units / subunits can be split into multiple modules / units / subunits. Alternatively, at least part of the functions of one or more of these modules / units / subunits can be combined with at least part of the functions of other modules / units / subunits and implemented in one module / unit / subunit. According to an embodiment of the present disclosure, at least one of the receiving module 410, the parsing module 420, the matching module 430, and the determining module 440 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or by any one of the three implementation methods of software, hardware, and firmware or by a suitable combination of any of them. Alternatively, at least one of the receiving module 410 , the parsing module 420 , the matching module 430 , and the determining module 440 may be at least partially implemented as a computer program module, and when the computer program module is executed, a corresponding function may be performed.

[0099] It should be noted that the semantic parsing device part in the embodiment of the present disclosure corresponds to the semantic parsing method part in the embodiment of the present disclosure. The description of the semantic parsing device part specifically refers to the semantic parsing method part, which will not be repeated here.

[0100] Figure 5 A block diagram of an electronic device suitable for implementing the method described above according to an embodiment of the present disclosure is schematically shown. Figure 5 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0101] like Figure 5 As shown, the electronic device 500 according to an embodiment of the present disclosure includes a processor 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage part 508 to a random access memory (RAM) 503. The processor 501 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 501 may also include an onboard memory for caching purposes. The processor 501 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.

[0102] In RAM 503, various programs and data required for the operation of system 500 are stored. Processor 501, ROM 502 and RAM 503 are connected to each other through bus 504. Processor 501 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 502 and / or RAM 503. It should be noted that the program can also be stored in one or more memories other than ROM 502 and RAM 503. Processor 501 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.

[0103] According to an embodiment of the present disclosure, the system 500 may further include an input / output (I / O) interface 505, which is also connected to the bus 504. The system 500 may further include one or more of the following components connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed, so that a computer program read therefrom is installed into the storage section 508 as needed.

[0104] According to an embodiment of the present disclosure, the method flow according to an embodiment of the present disclosure can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 509, and / or installed from the removable medium 511. When the computer program is executed by the processor 501, the above-mentioned functions defined in the system of the embodiment of the present disclosure are executed. According to an embodiment of the present disclosure, the system, equipment, device, module, unit, etc. described above can be implemented by a computer program module.

[0105] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.

[0106] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium. For example, it may include, but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, apparatus, or device.

[0107] For example, according to an embodiment of the present disclosure, the computer-readable storage medium may include the ROM 502 and / or the RAM 503 described above and / or one or more memories other than the ROM 502 and the RAM 503 .

[0108] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0109] It will be appreciated by those skilled in the art that the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways, even if such combinations and / or combinations are not explicitly described in the present disclosure. In particular, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways without departing from the spirit and teachings of the present disclosure. All of these combinations and / or combinations fall within the scope of the present disclosure.

[0110] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. The scope of the present disclosure is defined by the attached claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.

Claims

1. A semantic parsing method, comprising: Receive voice messages sent by users; Parsing the speech to obtain semantic information to be recognized contained in the speech; Loading a pre-built intent module library, wherein the intent module library includes at least one intent module; Acquire at least one initial sentence template of each of the intention modules, wherein the initial sentence template is set based on the demand intention and in accordance with the rules of sentence templates of multiple semantic logics included in the intention module; Determining at least one characteristic word of each of the initial sentence patterns; Through the pre-constructed synonym set, each of the characteristic words is synonym-expanded to obtain a designated sentence template corresponding to each of the initial sentence templates; Matching the semantics to be identified with at least one designated sentence template respectively to obtain a matching result, wherein each designated sentence template includes at least one feature word and a synonym of the feature word, and the feature word and the synonym of the feature word represent the user intention; Determining the user intention corresponding to the voice according to the matching result; The step of matching the semantics to be identified with at least one specified sentence template to obtain a matching result includes: Parsing the semantics to be recognized to obtain semantic logic and at least one semantic entity; Determining the semantic content corresponding to each of the semantic entities; Matching each of the semantic contents with a feature word of at least one of the specified sentence patterns and a synonym of the feature word, and matching the semantic logic with at least one of the specified sentence patterns to obtain the matching result; Each of the designated sentence patterns is obtained by performing synonym expansion on the content identification feature words of the initial sentence pattern.

2. The method according to claim 1, wherein: Determining the user intention corresponding to the voice according to the matching result includes: Detecting the matching result, wherein the matching result includes the feature word that successfully matches the semantics to be identified or a synonym of the feature word; Obtaining a designated sentence template corresponding to the feature word or a designated sentence template corresponding to a synonym of the feature word; Determine the user intention corresponding to the specified sentence template.

3. The method according to claim 1, wherein: The determining, according to the matching result, the user intention corresponding to the voice further includes: Detecting the matching result, where the matching result is a matching failure; Sends a message requesting the user to resend the voice message.

4. The method according to claim 1, wherein: The matching method is regular matching.

5. A semantic parsing device, comprising: A receiving module, used for receiving voice sent by the user; A parsing module, used to parse the speech to obtain the semantics to be recognized contained in the speech; A loading module, used to load a pre-built intent module library, wherein the intent module library includes at least one intent module; An acquisition module, used for acquiring at least one initial sentence template of each of the intention modules, wherein the initial sentence template is set based on the demand intention and in accordance with the rules of sentence templates of multiple semantic logics included in the intention module; A feature word determination module, used to determine at least one feature word of each of the initial sentence templates; An expansion module, used to perform synonym expansion on each of the characteristic words through a pre-built synonym set to obtain a designated sentence template corresponding to each of the initial sentence templates; A matching module, used for matching the semantics to be identified with at least one designated sentence template to obtain a matching result, each designated sentence template comprising at least one feature word and a synonym of the feature word, wherein the feature word and the synonym of the feature word represent the user's intention; A determination module, used to determine the user intention corresponding to the voice according to the matching result; The step of matching the semantics to be identified with at least one specified sentence template to obtain a matching result includes: Parsing the semantics to be recognized to obtain semantic logic and at least one semantic entity; Determining the semantic content corresponding to each of the semantic entities; Matching each of the semantic contents with a feature word of at least one of the specified sentence patterns and a synonym of the feature word, and matching the semantic logic with at least one of the specified sentence patterns to obtain the matching result; Each of the designated sentence patterns is obtained by performing synonym expansion on the content identification feature words of the initial sentence pattern.

6. An electronic device comprising: one or more processors; a memory for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 4.

7. A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, enables the processor to implement the method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • A speech recognition method and apparatus

    CN109192209A

  • Command recognition method based on keywords and Word2Vec

    CN110991180A