Multi-language semantic analysis method and device, electronic equipment and storage medium

Through the pre -configured word slot relationship table and the use of the offline semantic analysis module of the source language, the problem of high complexity of the existing multi -language semantic analysis system has been solved, and efficient and accurate multi -language semantic analysis is realized.

CN119378557APending Publication Date: 2025-01-28APOLLO INTELLIGENT CONNECTIVITY (BEIJING) TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411320043.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-20
Publication Date
2025-01-28

AI Technical Summary

Technical Problem

Existing multilingual semantic analysis systems need to configure independent semantic analysis modules for each language, resulting in high system complexity and difficulty in achieving the accuracy and efficiency of semantic analysis.

Method used

Through the pre -configured word groove relationship table, the user request is divided into words and rewritten, and the offline semantic analysis module of the source language is used for semantic analysis modules to achieve the reuse of multi -language semantic analysis.

Benefits of technology

Effectively improve the accuracy and efficiency of semantic analysis, reduce the complexity of the system, and achieve multi -language replication of the offline semantic analysis module of the source voice.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119378557A_ABST
    Figure CN119378557A_ABST
Patent Text Reader

Abstract

The invention provides a multi-language semantic analysis method and device, electronic equipment and a storage medium, and relates to the technical fields of voice technologies, semantic analysis, automatic driving and the like. The specific implementation scheme is as follows: acquiring a user request; the user request is expressed by a target language; performing word segmentation on the user request based on a word slot relation table pre-configured in the current time period to obtain a plurality of first segmented words; the word slot relation table comprises a plurality of first words and second words corresponding to the first words, the first words are expressed by adopting a target language, and the second words are expressed by adopting a source language; and performing offline semantic analysis on the user request by adopting an offline semantic analysis module of a source language based on the plurality of first segmented words and the word slot relation table. According to the technology disclosed by the invention, the accuracy and the analysis efficiency of semantic analysis can be effectively ensured; and meanwhile, the reusability of the offline semantic analysis module of the source voice can be effectively improved, so that the complexity of the system can be effectively reduced.
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, specifically to technical fields such as speech technology, semantic analysis, and autonomous driving, and in particular to a multi-language semantic analysis method, device, electronic device, and storage medium. Background Art

[0002] In the prior art, many systems can support multi-language response services. For example, in-vehicle systems can support multiple languages ​​such as Chinese and English.

[0003] When using a system that supports multilingual services, such as an in-vehicle system, it is necessary to perform semantic analysis on queries in different languages, and then respond based on the results of the semantic analysis. Usually, different semantic analysis modules need to be configured for different languages ​​to perform semantic analysis. Summary of the invention

[0004] The present disclosure provides a multi-language semantic parsing method, device, electronic device and storage medium.

[0005] According to one aspect of the present disclosure, a multi-language semantic parsing method is provided, comprising:

[0006] Obtaining a user request; wherein the user request is expressed in a target language;

[0007] Based on the word-slot relationship table preconfigured in the current time period, the user request is segmented to obtain a plurality of first segmented words; the word-slot relationship table includes a plurality of first words and a second word corresponding to each of the first words, each of the first words is expressed in a target language, and each of the second words is expressed in a source language;

[0008] Based on the multiple first word segmentations and the word-slot relationship table, an offline semantic parsing module of the source language is used to perform offline semantic parsing on the user request.

[0009] According to another aspect of the present disclosure, a multi-language semantic parsing device is provided, comprising:

[0010] An acquisition module, used to acquire a user request; the user request is expressed in a target language;

[0011] A word segmentation module, configured to segment the user request based on a word-slot relationship table preconfigured in the current time period to obtain a plurality of first word segments; the word-slot relationship table includes a plurality of first words and a second word corresponding to each of the first words, each of the first words is expressed in a target language, and each of the second words is expressed in a source language;

[0012] A parsing module is used to perform offline semantic parsing on the user request based on the multiple first word segmentations and the word-slot relationship table using an offline semantic parsing module of the source language.

[0013] According to another aspect of the present disclosure, there is provided an electronic device, comprising:

[0014] at least one processor; and

[0015] a memory communicatively connected to the at least one processor; wherein,

[0016] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method of any possible implementation manner and the aspects described above.

[0017] According to yet another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause the computer to execute the method of the above-mentioned aspect and any possible implementation manner.

[0018] According to yet another aspect of the present disclosure, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, the computer program implements the above-mentioned aspects and any possible implementation method.

[0019] According to the technology disclosed in the present invention, not only can the accuracy and efficiency of semantic parsing be effectively ensured, but also the reusability of the offline semantic parsing module of the source speech can be effectively improved, thereby effectively reducing the complexity of the system.

[0020] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.

[0022] Figure 1 is a schematic diagram according to a first embodiment of the present disclosure;

[0023] Figure 2 is a schematic diagram according to a second embodiment of the present disclosure;

[0024] Figure 3 is a schematic diagram according to a third embodiment of the present disclosure;

[0025] Figure 4 is a schematic diagram according to a fourth embodiment of the present disclosure;

[0026] Figure 5 is a schematic diagram according to a fifth embodiment of the present disclosure;

[0027] Figure 6 is a schematic diagram according to a sixth embodiment of the present disclosure;

[0028] Figure 7 The block diagram is a block diagram of an electronic device for implementing the method of the embodiment of the present disclosure. DETAILED DESCRIPTION

[0029] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0030] Obviously, the described embodiments are only part of the embodiments of the present disclosure, but not all of them. Based on the embodiments of the present disclosure, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present disclosure.

[0031] It should be noted that the terminal devices involved in the embodiments of the present disclosure may include but are not limited to mobile phones, personal digital assistants (PDAs), wireless handheld devices, tablet computers and other smart devices; display devices may include but are not limited to personal computers, televisions and other devices with display functions.

[0032] In addition, the term "and / or" in this article is only a description of the association relationship between the associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0033] Figure 1 is a schematic diagram according to the first embodiment of the present disclosure; Figure 1 As shown, this embodiment provides a multi-language semantic parsing method, which may specifically include the following steps:

[0034] S101, obtaining a user request; the user request is expressed in a target language;

[0035] S102, based on the word-slot relationship table pre-configured in the current time period, segment the user request to obtain a plurality of first segmented words; the word-slot relationship table includes a plurality of first words and a second word corresponding to each first word, each first word is expressed in a target language, and each second word is expressed in a source language;

[0036] S103: Based on the multiple first word segmentations and the word-slot relationship table, an offline semantic parsing module of the source language is used to perform offline semantic parsing on the user request.

[0037] The executor of the multi-language semantic parsing method of this embodiment may be a multi-language semantic parsing device, which may be applied in a system capable of supporting multiple languages, such as an in-vehicle system or a smart home system.

[0038] In the application scenario of this embodiment, user requests may include some control commands, which are independent of the network and can be parsed using an offline semantic parsing module. For example, in a car system, user requests may be commands related to turning on the air conditioner, opening the left front window, turning on music, etc., where turning on music may use a local music application (Application; App) in the car system to play music. In a smart home system, user requests may be commands related to turning on the air conditioner in the living room, turning on the bedroom lights, opening the curtains, etc.

[0039] The word slot relationship table in this embodiment is pre-configured for the current period, and the word slot relationship table includes the correspondence between words expressed in two languages. For example, the correspondence between the second word expressed in the source language and the first word expressed in the target language, that is, in the same correspondence, the second word expressed in the source language and the first word expressed in the target language have the same semantics. For example, the word slot relationship table expressed in Chinese and English may include open-open, air-conditioner-air-conditioner, etc.

[0040] In this embodiment, based on each word slot of the target language in the word slot relationship table, the user request can be segmented to obtain multiple first word segments. Finally, based on the word slot relationship table and the multiple first word segments, the user request can be offline semantically parsed using the offline semantic parsing module of the source language, and then the user request can be correctly responded to based on the result of the offline semantic parsing.

[0041] The multi-language semantic parsing method of this embodiment is not limited to the target language used. Regardless of the target language, based on the word slot relationship table between the target language and the source language, the technical solution of this embodiment can be used to use a set of offline semantic parsing modules of the source language to perform offline semantic parsing of user requests in multiple target languages. In the prior art, a set of semantic parsing systems is configured for each target language, and there is no reusability between semantic parsing systems of different languages, resulting in a very high system complexity.

[0042] The multi-language semantic parsing method of this embodiment, by adopting the above-mentioned technical scheme, can not only effectively ensure the accuracy and efficiency of semantic parsing; at the same time, an offline semantic parsing module of a source language can support the parsing of multiple target languages, which can effectively improve the reusability of the offline semantic parsing module of the source speech, and thus can effectively reduce the complexity of the system.

[0043] Figure 2 is a schematic diagram according to the second embodiment of the present disclosure; the multi-language semantic parsing method of this embodiment, in the above Figure 1 Based on the technical solutions of the illustrated embodiments, the technical solutions of the present disclosure are further described in more detail. Figure 2 As shown, the multi-language semantic parsing method of this embodiment may specifically include the following steps:

[0044] S201, obtaining a user request; the user request is expressed in a target language;

[0045] S202, based on the word-slot relationship table pre-configured in the current time period, segment the user request to obtain multiple first segmented words;

[0046] Specifically, in this embodiment, when segmenting the user request, it is necessary to refer to the word slot relationship table to ensure that the segment that hits the word slot relationship table is an independent first segmentation, and the remaining part, the continuous segment is a first segmentation, and a total of multiple first segmentations are obtained. In the specific implementation, it can include: first, based on the word slot relationship table, the segment of the second word in the user request that hits the word slot relationship is used as the first segmentation; then the user request is segmented based on the recognized first segmentation; finally, the segment that does not hit the word slot relationship table after the segment division is also used as the first segmentation, and a total of multiple first segmentations are obtained. For example, the user request is "I want to listen to the song of singer 1", and the word slot relationship table has the word slots of "want" and "listen". According to the above segmentation method, the segmented segments can be "I / want / listen / singer 1's song", where "want" and "listen" are the first segmentations that hit the word slot, and "I" and "singer 1's song" can be used as the first segmentations that do not hit the word slot relationship table, and finally a total of "I", "want", "listen", "singer 1's song" four segmentations are obtained.

[0047] S203: Based on the plurality of first word segmentations and the word-slot relationship table, detecting and determining that the user request needs to be parsed;

[0048] S204 rewrites the user request into a translation text expressed in the source language based on the plurality of first word segmentations and the word slot relationship table;

[0049] For example, specifically, the first word segment of the first word in the word-slot relationship in the user request can be rewritten into the corresponding second word of the source language in the word-slot relationship table to obtain the translation text corresponding to the user request.

[0050] For example, the user request is expressed in the target language as 123456; each number represents a word. The word slot relationship table includes the correspondence between A and 1, and the correspondence between C and 3. A and C are expressed in the source language, and 1 and 3 are expressed in the target language. At this time, 1 and 3 in the user request can be rewritten as A and C respectively, and the resulting translation text can be expressed as: A2C456.

[0051] S205: Using an offline semantic analysis module of the source language to perform semantic analysis on the translated text.

[0052] In this embodiment, before performing offline semantic analysis, it is necessary to first detect and determine whether the user request needs to be analyzed. During the specific detection, the detection can be performed based on the word slot relationship table and multiple first segmentations obtained by segmenting the user request, which can effectively filter out user requests that do not need to be analyzed, thereby improving the efficiency of semantic analysis.

[0053] In this embodiment, when performing offline semantic analysis on a user request, it is also necessary to refer to the word-slot relationship table to achieve accurate offline semantic analysis.

[0054] Steps S204-S205 of this embodiment are as described above. Figure 1 A specific implementation manner of step S103 of the illustrated embodiment, through which the user request can be accurately semantically parsed offline.

[0055] Specifically, in this embodiment, when step S203 is implemented, it may include the following steps:

[0056] (a1) calculating the weight of the user request based on the multiple first word segmentations and the word-slot relationship table;

[0057] For example, the word slot relationship table of this embodiment also includes the word slot type of each first word and the corresponding second word. For example, the word slot type may include core word slots, reverse word slots, and tone word slots, etc. Among them, the core word slot can be determined based on the intention, and may refer to the slot of the word that can clearly identify the intention. For example, it may include slots for words such as open, close, air conditioning, music, and lights that can identify actions and objects for action execution. The reverse word slot may include slots for words such as don't, prohibit, or stop that identify reverse intentions. The tone word slot may include slots for words such as help me, help, and hard work that identify the tone.

[0058] For example, when step (a1) is implemented, it may include the following steps:

[0059] (a2) based on the word-slot relationship table, obtaining the word-slot type of each first word segment;

[0060] (b2) obtaining a weight of each first participle based on the slot type of each first participle;

[0061] (c2) Based on the weights of the first participles, the weight of the user request is obtained.

[0062] Specifically, the implementation of step (b2) may include the following situations:

[0063] In the first case, if the first participle is a reverse word slot, the weight of the first participle is determined to be a first preset value;

[0064] In the second case, if the first participle is a modal particle slot, the weight of the first participle is determined to be a second preset value;

[0065] In the third case, if the first word segment is not a core word slot, a reverse word slot or other word slots of modal word operation, the weights of other word slots are determined based on the length of the user request, the length of the core word slot in the user request, the length of the reverse word slot and the length of the modal word slot.

[0066] For example, based on the length of the user request, the length of the core word slot in the user request, the length of the reverse word slot, and the length of the tone word slot, the following formula is used to determine the weights of other word slots:

[0067] (The length of the user request - the length of the core word slot - the length of the reverse word slot - the length of the tone word slot) / the length of the user request.

[0068] In actual application scenarios, a user request must include the core word slot, or may include only the core word slot, or may include, on the basis of the core word slot, a reverse word slot, and / or a tone word slot, and / or other word slots.

[0069] The first preset value and the second preset value of this embodiment can be set based on experience. For example, the first preset value can be set to 0.5, or can also be set to 0.49 or 0.51, and the second preset value can be set to 0.

[0070] In this embodiment, the weights of other word slots determined in this way are very reasonable and accurate, and thus the weights of user requests can be accurately determined.

[0071] For example, when step (c2) is implemented, the weight of the user request can be obtained by subtracting the weight of the first participle as the reverse word slot, the weight of the first participle as the modal word slot, and the weight of the first participle as other word slots in the user request from the total weight.

[0072] Alternatively, the weight of the user request in this embodiment can be expressed by the following formula: weight of the user request = 1 - weight of the reverse word slot - weight of the tone word slot - weight of other word slots. The total weight of this embodiment is 1.

[0073] (b1) detecting whether the weight requested by the user is greater than or equal to a pre-configured weight threshold; if so, executing step (c1); otherwise, if not, executing step (d1);

[0074] The weight threshold of this embodiment can be set according to experience or actual needs. For example, the weight threshold can be set to 0.8, 0.81 or 0.82, etc., which is not limited here.

[0075] (c1) In response to the weight being greater than or equal to the preconfigured weight threshold, it is determined that the user request needs to be parsed, and the process ends.

[0076] (d1) in response to the weight being less than a preconfigured weight threshold, determining that the user request does not need to be parsed; executing step (e1);

[0077] (e1) sending a message that does not require parsing the user request to the response module, so that the response module sends a message that cannot identify the user request to respond to the user.

[0078] The response module in this embodiment refers to a module in the system that responds to user requests.

[0079] That is to say, when the multi-language semantic parsing device of this embodiment detects and determines that the user request does not need to be parsed, it means that the information in the user request is incomplete, the substantive content cannot be parsed, and it is impossible to respond based on the parsing result, so in order to improve efficiency, no parsing is performed. At this time, the response module can directly respond to the user by failing to recognize the user request, which can effectively improve the response efficiency of user requests that do not need to be parsed.

[0080] By adopting the above-mentioned method of this embodiment, the weight of the first word segment in the user request can be accurately determined; and the weight of the user request can be accurately determined, and whether the user request needs to be parsed can be accurately detected.

[0081] The multi-language semantic parsing method of this embodiment only needs to configure a set of offline semantic parsing modules of the source language. The above-mentioned technical solution of this embodiment can support semantic parsing of multiple different target languages, avoid configuring multiple sets of offline semantic parsing modules of different languages, and effectively reduce the complexity of the system. Moreover, in this embodiment, based on the word-slot relationship table pre-configured in the current time period, it can effectively and accurately detect whether the current user request needs to be parsed, and when parsing is required, based on multiple first word segments and word-slot relationship tables, the user request is rewritten into a translation text expressed in the source language, and then the offline semantic parsing module of the source language is used to perform semantic parsing on the translation text, which can efficiently and accurately implement the parsing of the user request. The technical solution of this embodiment only needs to adapt the word-slot relationship table, and the offline semantic parsing module can be reused in multiple languages. The system is very streamlined and very practical.

[0082] For example, the technical solution of the embodiment of the present disclosure can be applied in an in-vehicle system. During the application of an autonomous driving vehicle, passengers who speak various languages ​​may be encountered. During the use of the in-vehicle system of the autonomous driving vehicle, it is necessary to support the use of various languages. Figure 1 and Figure 2 In the embodiment shown, only one set of source language offline semantic parsing modules can be configured in the vehicle system, and when a user request in the target language is received, the above-mentioned Figure 1 or Figure 2 The technical solution of the embodiment shown is to perform offline semantic analysis on the user request in the target language, and then respond based on the offline semantic analysis result, which can efficiently and accurately respond to the user request in any target language. The source language and target language of this embodiment are not limited here, and can be any language.

[0083] Similarly, the technical solution of this embodiment can also be applied in other scenarios, such as in the smart home system of a hotel, where customers who speak various languages ​​may also be encountered. Or it can also be applied in the self-service shopping guide system of a shopping mall, etc. No more examples are given here.

[0084] Figure 3 is a schematic diagram according to the third embodiment of the present disclosure; the multi-language semantic parsing method of this embodiment, in the above Figure 1 and Figure 2 Based on the technical solution of the embodiment shown, the configuration scheme of the word slot relationship table of the current time period of the present disclosure is further described in more detail, such as Figure 3 As shown, the following steps may be specifically included:

[0085] S301, collecting multiple source language requests expressed in the source language received within a preset time period before the current period and the usage frequency of each source language request;

[0086] The preset time period of this embodiment can be set according to experience or actual needs. For example, it can be a time length of one day, one week, or one month before the current time period, which is not limited here. The current time period of this embodiment can refer to the current day, the current week, or the current month, etc., which is not limited here.

[0087] S302, identifying the intent of each source language request among multiple source language requests;

[0088] For example, the intent of each source language request may include turning on the air conditioner, opening the window, turning on the light, etc.

[0089] S303: construct a word-slot relationship table for the current time period based on multiple source language requests, usage frequencies and intentions of each source language request.

[0090] Based on the above embodiments, it can be known that the word-slot relationship table includes the second word expressed in the source language, the first word expressed in the target language, and the word-slot types of the first word and the second word.

[0091] For example, based on multiple source language requests, the usage frequency and intent of each source language request, the word that hits the corresponding intent in each source language request can be used as the second word, and the corresponding word slot type is set to the core word slot. The reverse word in each source language request is also used as the second word, and the corresponding word slot type is set to the reverse word slot. The modal particle in each source language request is also used as the second word, and the corresponding word slot type is set to the modal particle slot, and so on. Then, each second word is translated into the first word expressed in the target language. Finally, based on each second word, the corresponding first word and the corresponding word slot type, a word slot relationship table for the current time period is constructed.

[0092] By adopting the technical solution of this embodiment, the word-slot relationship table of the current time period can be established accurately and efficiently.

[0093] Further optionally, in an embodiment of the present disclosure, when step S303 is specifically implemented, it may include the following steps:

[0094] (1) acquiring a plurality of second words and a word slot type of each second word based on the intent of each source language request in the plurality of source language requests;

[0095] (2) translating each second word into the first word, wherein the first word is expressed in the target language;

[0096] (3) Based on each second word, the corresponding first word and the corresponding word slot type, a word slot relationship table for the current time period is constructed.

[0097] Specifically, based on the intent of each of the identified multiple source language requests, words that match the intent can be selected from each source language request as the second word, and the word slot type can be marked as a core word slot; further, semantic understanding can be performed on each source language request, and if there are reverse words, they can also be extracted as the second word, and the word slot type can be marked as a reverse word slot. Furthermore, modal particles can be selected from multiple source language requests, extracted as the second word, and the word slot type can be marked as a modal particle slot.

[0098] This method can comprehensively and reasonably construct the word-slot relationship table of the current period.

[0099] Figure 4 is a schematic diagram according to the fourth embodiment of the present disclosure; the multi-language semantic parsing method of this embodiment, based on the technical solutions of the above embodiments, further describes the technical solutions of the present disclosure in more detail, such as Figure 4 As shown, the following steps may be specifically included:

[0100] S401, collecting multiple source language requests expressed in the source language received within a preset time period before the current period and the usage frequency of each source language request;

[0101] S402, identifying the intent of each source language request among multiple source language requests;

[0102] S403: grouping the multiple source language requests based on the intent of each source language request in the multiple source language requests;

[0103] S404: for each intent group and the usage frequency of each source language request, obtain the source language request with the highest usage frequency from the corresponding group as the target source language request corresponding to the intent;

[0104] S405, based on the preset word slots, segment the target source language request of each intent to obtain a plurality of second words;

[0105] S406: based on each intention and a plurality of second words corresponding to each intention, mark the word slot type of each second word;

[0106] S407, translating each second word into a first word, wherein the first word is expressed in the target language;

[0107] S408: construct a word-slot relationship table for the current time period based on each second word, the corresponding first word, and the corresponding word-slot type.

[0108] Compared with the above Figure 3 In the embodiment shown, in order to obtain a more accurate word-slot relationship table, in this embodiment, the word-slot relationship table is constructed based only on the most frequently used source language request, that is, the target source language request. Generally, most users prefer to use the most concise language to express user requests, so generally, it can be considered that the target source language request of an intent is the most concise source language request of the intent within a preset time period before the current time period.

[0109] Specifically, the target source language request corresponding to each intent is segmented to obtain multiple second words. Then, each second word is compared to see if it matches the intent; if it matches the intent, the second word is marked as a core word slot; if the second word is a reverse word, the second word is marked as a reverse word slot; if the second word is an interjection, the second word is marked as an interjection word slot, and so on. Then, each second word is translated into the first word expressed in the target language. Finally, each second word and the corresponding first word, as well as the corresponding word slot type, are stored together in the word slot relationship table to obtain a constructed word slot relationship table.

[0110] Steps S403-S406 are a specific implementation method of "obtaining multiple second words and the word slot type of each second word based on the intention of each source language request in multiple source language requests" in the above embodiment, which can accurately and reasonably obtain multiple second words and the word slot type of each second word.

[0111] Steps S403-S408 are as above Figure 3 A specific implementation of S303 of the illustrated embodiment can efficiently, accurately and reasonably establish a word-slot relationship table for the current time period by adopting this method.

[0112] Figure 5 is a schematic diagram according to the fifth embodiment of the present disclosure; Figure 5 As shown, this embodiment provides a multi-language semantic parsing device 500, including:

[0113] The acquisition module 501 is used to acquire a user request; the user request is expressed in a target language;

[0114] A word segmentation module 502 is used to segment the user request based on a word-slot relationship table preconfigured in the current time period to obtain a plurality of first word segments; the word-slot relationship table includes a plurality of first words and a second word corresponding to each of the first words, each of the first words is expressed in a target language, and each of the second words is expressed in a source language;

[0115] The parsing module 503 is configured to perform offline semantic parsing on the user request based on the multiple first word segmentations and the word-slot relationship table by using an offline semantic parsing module of the source language.

[0116] The multi-language semantic parsing device 500 of this embodiment realizes the implementation principle and technical effect of multi-language semantic parsing by adopting the above-mentioned modules, which is the same as the implementation of the above-mentioned related method embodiments. For details, please refer to the records of the above-mentioned related method embodiments, which will not be repeated here.

[0117] Figure 6 is a schematic diagram according to the sixth embodiment of the present disclosure; Figure 6 As shown, this embodiment provides a multi-language semantic parsing device 600. Figure 5 Based on the technical solutions of the embodiments shown in the figure, the technical solutions of the present disclosure are further described in more detail. Figure 6 As shown, the multi-language semantic analysis device 600 of this embodiment includes the above Figure 5 The modules with the same name and function are shown as: acquisition module 601 , word segmentation module 602 and parsing module 603 .

[0118] like Figure 6 As shown, the multi-language semantic analysis device 600 of this embodiment further includes:

[0119] The detection module 604 is used to detect and determine that the user request needs to be parsed based on the multiple first word segmentations and the word-slot relationship table.

[0120] like Figure 6 As shown, the detection module 604 includes:

[0121] A calculation unit 6041, configured to calculate a weight of the user request based on the multiple first word segmentations and the word-slot relationship table;

[0122] A detection unit 6042 is used to detect whether the weight is greater than or equal to a preconfigured weight threshold;

[0123] The detection unit 6042 is further configured to determine that the user request needs to be parsed in response to the weight being greater than or equal to a preconfigured weight threshold.

[0124] Further optionally, if Figure 6 As shown, in one embodiment of the present disclosure, the multi-language semantic parsing device 600 further includes a sending module 605;

[0125] The detection unit 6042 is further configured to determine that the user request does not need to be parsed in response to the weight being less than a preconfigured weight threshold;

[0126] The sending module 605 is used to send a message that does not require parsing the user request to the response module, so that the response module can send a message that cannot identify the user request to respond to the user.

[0127] Further optionally, in one embodiment of the present disclosure, the computing unit 6041 is configured to:

[0128] Based on the word-slot relationship table, obtaining the word-slot type of each of the first word segmentations;

[0129] Based on the slot type of each of the first participles, obtaining a weight of each of the first participles;

[0130] Based on the weights of the first participles, the weight of the user request is obtained.

[0131] Further optionally, in one embodiment of the present disclosure, the computing unit 6041 is configured to:

[0132] If the first word segmentation is a reverse word slot, determining the weight of the first word segmentation to be a first preset value;

[0133] If the first participle is a modal particle slot, determining the weight of the first participle to be a second preset value; and / or

[0134] If the first word segment is not a core word slot, a reverse word slot or other word slots of modal word operations, the weights of the other word slots are determined based on the length of the user request, the length of the core word slot, the length of the reverse word slot and the length of the modal word slot in the user request.

[0135] Further optionally, in one embodiment of the present disclosure, the computing unit 6041, computing unit, is configured to:

[0136] Based on the length of the user request, the length of the core word slot in the user request, the length of the reverse word slot, and the length of the tone word slot, the weights of the other word slots are determined using the following formula:

[0137] (The length of the user request - the length of the core word slot - the length of the reverse word slot - the length of the tone word slot) / the length of the user request.

[0138] Further optionally, in one embodiment of the present disclosure, the computing unit 6041 is configured to:

[0139] The weight of the user request is obtained by subtracting the weight of the first participle as a reverse word slot, the weight of the first participle as a modal word slot, and the weight of the first participle as other word slots in the user request from the total weight.

[0140] Further optionally, if Figure 6 As shown, in one embodiment of the present disclosure, the parsing module 603 includes:

[0141] A translation unit 6031 is used to rewrite the user request into a translation text expressed in the source language based on the multiple first word segmentations and the word-slot relationship table;

[0142] The parsing unit 6032 is used to perform semantic parsing on the translation text using an offline semantic parsing module of the source language.

[0143] Further optionally, if Figure 6 As shown, in one embodiment of the present disclosure, the multi-language semantic parsing device 600 further includes:

[0144] A collection module 606 is used to collect multiple source language requests expressed in the source language received within a preset time period before the current period and the usage frequency of each source language request;

[0145] An identification module 607, used to identify the intent of each source language request among the multiple source language requests;

[0146] The construction module 608 is used to construct the word-slot relationship table of the current time period based on the multiple source language requests, the usage frequency and the intention of each source language request.

[0147] Further optionally, in one embodiment of the present disclosure, the construction module 608 is used to:

[0148] Based on the intent of each source language request in the multiple source language requests, acquiring a plurality of second words and a word slot type of each second word;

[0149] translating each of the second words into a first word, wherein the first word is expressed in the target language;

[0150] A word-slot relationship table for the current time period is constructed based on each of the second words, the corresponding first words, and the corresponding word-slot type.

[0151] Further optionally, in one embodiment of the present disclosure, the construction module 608 is used to:

[0152] grouping the multiple source language requests based on the intent of each source language request in the multiple source language requests;

[0153] For each intent group and the usage frequency of each source language request, obtaining the source language request with the highest usage frequency from the corresponding group as the target source language request corresponding to the intent;

[0154] Based on the preset word slots, the target source language request of each intent is segmented to obtain multiple second words;

[0155] Based on each of the intentions and a plurality of second words corresponding to each of the intentions, a slot type of each of the second words is marked.

[0156] Further optionally, in one embodiment of the present disclosure, the word segmentation module 602 is used to:

[0157] Based on the word-slot relationship table, taking a segment of the second word in the user request that hits the word-slot relationship as a first word segmentation;

[0158] Segmenting the user request based on the identified first segmentation word;

[0159] After the segments are divided, the segments that do not hit the word-slot relationship table are also used as first segmented words, and a total of the plurality of first segmented words are obtained.

[0160] The multi-language semantic parsing device 600 of this embodiment realizes the implementation principle and technical effect of multi-language semantic parsing by adopting the above-mentioned modules, which is the same as the implementation of the above-mentioned related method embodiments. For details, please refer to the records of the above-mentioned related method embodiments, which will not be repeated here.

[0161] In the technical solution disclosed herein, the acquisition, storage and application of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0162] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.

[0163] Figure 7 A schematic block diagram of an example electronic device 700 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0164] like Figure 7As shown, the device 700 includes a computing unit 701, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 702 or a computer program loaded from a storage unit 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the device 700 can also be stored. The computing unit 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0165] A number of components in the device 700 are connected to the I / O interface 705, including: an input unit 706, such as a keyboard, a mouse, etc.; an output unit 707, such as various types of displays, speakers, etc.; a storage unit 708, such as a disk, an optical disk, etc.; and a communication unit 709, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 709 allows the device 700 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0166] The computing unit 701 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 701 performs the various methods and processes described above, such as the above-mentioned methods of the present disclosure. For example, in some embodiments, the above-mentioned methods of the present disclosure may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 708. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 700 via ROM 702 and / or communication unit 709. When the computer program is loaded into RAM 703 and executed by the computing unit 701, one or more steps of the above-mentioned methods of the present disclosure described above may be performed. Alternatively, in other embodiments, the computing unit 701 may be configured to perform the above-mentioned methods of the present disclosure in any other appropriate manner (e.g., by means of firmware).

[0167] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0168] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0169] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, 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), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0170] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0171] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0172] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.

[0173] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0174] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A multi-language semantic parsing method, comprising: Get user request; The user request is expressed in the target language; Based on the word-slot relationship table preconfigured in the current time period, the user request is segmented to obtain a plurality of first segmented words; the word-slot relationship table includes a plurality of first words and a second word corresponding to each of the first words, each of the first words is expressed in a target language, and each of the second words is expressed in a source language; Based on the multiple first word segmentations and the word-slot relationship table, an offline semantic parsing module of the source language is used to perform offline semantic parsing on the user request.

2. The method according to claim 1, wherein: Before performing offline semantic parsing on the user request using the offline semantic parsing module of the source language based on the multiple first word segmentations and the word-slot relationship table, the method further includes: Based on the multiple first word segmentations and the word-slot relationship table, it is detected and determined that the user request needs to be parsed.

3. The method according to claim 2, wherein: Detecting and determining that the user request needs to be parsed based on the multiple first word segmentations and the word-slot relationship table includes: Calculating a weight of the user request based on the multiple first word segmentations and the word-slot relationship table; Detecting whether the weight is greater than or equal to a preconfigured weight threshold; In response to the weight being greater than or equal to a preconfigured weight threshold, it is determined that the user request needs to be parsed.

4. The method according to claim 3, wherein: The method further comprises: In response to the weight being less than a preconfigured weight threshold, determining that the user request does not need to be parsed; A message that does not require parsing the user request is sent to the response module, so that the response module can send a message that cannot identify the user request to respond to the user.

5. The method according to claim 3, wherein: The word slot relationship table also includes the word slot type of each of the first words and the corresponding second words; Calculating the weight of the user request based on the multiple first word segmentations and the word-slot relationship table includes: Based on the word-slot relationship table, obtaining the word-slot type of each of the first word segmentations; Based on the slot type of each of the first participles, obtaining a weight of each of the first participles; Based on the weights of the first participles, the weight of the user request is obtained.

6. The method according to claim 5, wherein: Based on the slot type of each of the first participles, obtaining the weight of each of the first participles includes: If the first word segmentation is a reverse word slot, determining the weight of the first word segmentation to be a first preset value; If the first participle is a modal particle slot, determining the weight of the first participle to be a second preset value; and / or If the first word segment is not a core word slot, a reverse word slot or other word slots of modal word operations, the weights of the other word slots are determined based on the length of the user request, the length of the core word slot, the length of the reverse word slot and the length of the modal word slot in the user request.

7. The method according to claim 6, wherein: Determining the weights of the other word slots based on the length of the user request, the length of the core word slot, the length of the reverse word slot, and the length of the tone word slot in the user request includes: Based on the length of the user request, the length of the core word slot in the user request, the length of the reverse word slot, and the length of the tone word slot, the weights of the other word slots are determined using the following formula: (The length of the user request - the length of the core word slot - the length of the reverse word slot - the length of the tone word slot) / the length of the user request.

8. The method according to claim 5, wherein: Obtaining the weight of the user request based on the weight of each of the first participles includes: The weight of the user request is obtained by subtracting the weight of the first participle as a reverse word slot, the weight of the first participle as a modal word slot, and the weight of the first participle as other word slots in the user request from the total weight.

9. The method according to claim 1, wherein: Based on the multiple first word segmentations and the word-slot relationship table, an offline semantic parsing module of the source language is used to perform offline semantic parsing on the user request, including: Based on the multiple first word segmentations and the word-slot relationship table, rewriting the user request into a translation text expressed in the source language; The offline semantic parsing module of the source language is used to perform semantic parsing on the translated text.

10. The method according to any one of claims 1 to 9, wherein: Before segmenting the user request based on the word-slot relationship table preconfigured in the current time period to obtain a plurality of first segmented words, the method further includes: Collecting multiple source language requests expressed in the source language received within a preset time period before the current time period and the usage frequency of each source language request; identifying the intent of each of the plurality of source language requests; A word-slot relationship table for the current time period is constructed based on the multiple source language requests, the usage frequency and the intention of each source language request.

11. The method according to claim 10, wherein: Based on the multiple source language requests, the usage frequency and the intention of each source language request, constructing the word slot relationship table of the current time period, including: Based on the intent of each source language request in the multiple source language requests, acquiring a plurality of second words and a word slot type of each second word; translating each of the second words into a first word, wherein the first word is expressed in the target language; A word-slot relationship table for the current time period is constructed based on each of the second words, the corresponding first words, and the corresponding word-slot type.

12. The method according to claim 10, wherein: Acquiring a plurality of second words and a word slot type of each of the second words based on the intent of each of the plurality of source language requests includes: grouping the multiple source language requests based on the intent of each source language request in the multiple source language requests; For each intent group and the usage frequency of each source language request, obtaining the source language request with the highest usage frequency from the corresponding group as the target source language request corresponding to the intent; Based on the preset word slots, the target source language request of each intent is segmented to obtain multiple second words; Based on each of the intentions and a plurality of second words corresponding to each of the intentions, a slot type of each of the second words is marked.

13. The method according to claim 1, wherein: Based on the word-slot relationship table preconfigured in the current time period, the user request is segmented, including: Based on the word-slot relationship table, taking a segment of the second word in the user request that hits the word-slot relationship as a first word segmentation; Segmenting the user request based on the identified first segmentation word; After the segments are divided, the segments that do not hit the word-slot relationship table are also used as first segmented words, and a total of the plurality of first segmented words are obtained.

14. A multi-language semantic parsing device, comprising: The acquisition module is used to obtain user requests; The user request is expressed in the target language; A word segmentation module, configured to segment the user request based on a word-slot relationship table preconfigured in the current time period to obtain a plurality of first word segments; the word-slot relationship table includes a plurality of first words and a second word corresponding to each of the first words, each of the first words is expressed in a target language, and each of the second words is expressed in a source language; A parsing module is used to perform offline semantic parsing on the user request based on the multiple first word segmentations and the word-slot relationship table using an offline semantic parsing module of the source language.

15. The device according to claim 14, wherein: The device also includes: A detection module is used to detect and determine the need to parse the user request based on the multiple first word segmentations and the word-slot relationship table.

16. The device according to claim 15, wherein: The detection module comprises: A calculation unit, configured to calculate a weight of the user request based on the plurality of first word segmentations and the word-slot relationship table; A detection unit, configured to detect whether the weight is greater than or equal to a preconfigured weight threshold; The detection unit is further configured to determine that the user request needs to be parsed in response to the weight being greater than or equal to a preconfigured weight threshold.

17. The device according to claim 16, wherein: The device also includes a sending module; The detection unit is further configured to determine that the user request does not need to be parsed in response to the weight being less than a preconfigured weight threshold; The sending module is used to send a message that does not require parsing the user request to the response module, so that the response module can send a message that cannot identify the user request to respond to the user.

18. The device according to claim 16, wherein: The computing unit is used for: Based on the word-slot relationship table, obtaining the word-slot type of each of the first word segmentations; Based on the slot type of each of the first participles, obtaining a weight of each of the first participles; Based on the weights of the first participles, the weight of the user request is obtained.

19. The device according to claim 18, wherein: The computing unit is used for: If the first word segmentation is a reverse word slot, determining the weight of the first word segmentation to be a first preset value; If the first participle is a modal particle slot, determining the weight of the first participle to be a second preset value; and / or If the first word segment is not a core word slot, a reverse word slot or other word slots of modal word operations, the weights of the other word slots are determined based on the length of the user request, the length of the core word slot, the length of the reverse word slot and the length of the modal word slot in the user request.

20. The device according to claim 19, wherein The computing unit is used for: Based on the length of the user request, the length of the core word slot in the user request, the length of the reverse word slot, and the length of the tone word slot, the weights of the other word slots are determined using the following formula: (The length of the user request - the length of the core word slot - the length of the reverse word slot - the length of the tone word slot) / the length of the user request.

21. The device according to claim 19, wherein The computing unit is used for: The weight of the user request is obtained by subtracting the weight of the first participle as a reverse word slot, the weight of the first participle as a modal word slot, and the weight of the first participle as other word slots in the user request from the total weight.

22. The device according to claim 14, wherein: The parsing module comprises: A translation unit, configured to rewrite the user request into a translation text expressed in the source language based on the plurality of first word segmentations and the word-slot relationship table; A parsing unit is used to perform semantic parsing on the translation text using an offline semantic parsing module of the source language.

23. The device according to any one of claims 14 to 22, wherein: The device also includes: A collection module, used to collect multiple source language requests expressed in the source language received within a preset time period before the current time period and the usage frequency of each source language request; an identification module, used for identifying the intent of each source language request among the multiple source language requests; A construction module is used to construct a word-slot relationship table for the current time period based on the multiple source language requests, the usage frequency and the intention of each source language request.

24. The device according to claim 23, wherein: The building blocks are used to: Based on the intent of each source language request in the multiple source language requests, acquiring a plurality of second words and a word slot type of each second word; translating each of the second words into a first word, wherein the first word is expressed in the target language; A word-slot relationship table for the current time period is constructed based on each of the second words, the corresponding first words, and the corresponding word-slot type.

25. The device according to claim 24, wherein: The building blocks are used to: grouping the multiple source language requests based on the intent of each source language request in the multiple source language requests; For each intent group and the usage frequency of each source language request, obtaining the source language request with the highest usage frequency from the corresponding group as the target source language request corresponding to the intent; Based on the preset word slots, the target source language request of each intent is segmented to obtain multiple second words; Based on each of the intentions and a plurality of second words corresponding to each of the intentions, a slot type of each of the second words is marked.

26. The method of claim 14, wherein: The word segmentation module is used to: Based on the word-slot relationship table, taking a segment of the second word in the user request that hits the word-slot relationship as a first word segmentation; Segmenting the user request based on the identified first segmentation word; After the segments are divided, the segments that do not hit the word-slot relationship table are also used as first segmented words, and a total of the plurality of first segmented words are obtained.

27. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 13.

28. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-13.

29. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 13.