A semantic understanding method, device, apparatus and storage medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HISENSE GRP HLDG CO LTD
- Filing Date
- 2022-08-30
- Publication Date
- 2026-08-07
AI Technical Summary
[0004]然而,重新采集数据训练语义理解模型并部署,对研发和部署分离的智慧城市应用系统来说,其响应速度较慢,且人力需求的较大
Smart Images

Figure CN117669577B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of artificial intelligence technology, and in particular to a semantic understanding method, apparatus, device and storage medium. Background Technology
[0002] In smart city application systems, the system deployment is required to be private, that is, the products and systems developed by the R&D team need to be independently deployed on the customer's on-site government office network, with on-site support provided by operation and maintenance personnel, while the R&D personnel work remotely, that is, the R&D and deployment and operation and maintenance are separated.
[0003] In urban data question answering, new user interaction content and keywords often emerge that semantic understanding models cannot support. To address this issue, related technologies retrain semantic understanding models to support these new user interaction content and keywords.
[0004] However, for smart city application systems where research and development and deployment are separated, the response speed is slow and the manpower requirements are large. Summary of the Invention
[0005] This application provides a semantic understanding method, apparatus, device, and storage medium to improve the response speed of smart city application systems and reduce human development.
[0006] On the one hand, embodiments of this application provide a semantic understanding method, including:
[0007] Extract the keywords to be replaced from the interactive text to be identified, and obtain the target scene corresponding to the keywords to be replaced;
[0008] If the merge learning table contains the target scene, then the target replacement word corresponding to the target scene is obtained from the merge learning table. The merge learning table includes at least one set of associated scenes and corresponding replacement words. The interactive text expression form corresponding to each scene in the set of associated scenes is the same.
[0009] The target replacement word is used to replace the keyword to be replaced to obtain the target interactive text, and the target interactive text is semantically understood to obtain preliminary semantic understanding results;
[0010] Using the keywords to be replaced and the target scenario, the preliminary semantic understanding result is adjusted to obtain the target semantic understanding result.
[0011] In this embodiment, scenarios with the same interactive text expression are merged to obtain a set of related scenarios. This set of related scenarios, along with the corresponding replacement words, is stored in a merge learning table. Therefore, for new user interaction content, only the corresponding scenario needs to be configured in the merge learning table to achieve semantic understanding of the new user interaction content, without needing to re-collect data, train the semantic understanding model, and deploy it, thereby improving response speed and reducing manpower requirements. Secondly, after replacing the keywords to be replaced in the interactive text to be identified with preset content, semantic understanding and semantic recovery are performed, achieving semantic understanding of various scenarios with the same interactive text expression, thus improving generalization ability.
[0012] Optional, also includes:
[0013] Extract the target operation method from the interactive text to be identified;
[0014] If the merge learning table does not contain the target scenario, then the target replacement scenario that supports the target operation method and the target replacement word corresponding to the target replacement scenario are obtained from the object operation method table. The object operation method table includes at least one set of associated scenarios and corresponding replacement words and object operation methods.
[0015] In this embodiment of the application, for new text interaction content that is not configured in the merge learning table, the object operation method table can be searched based on the object operation methods in the text interaction content to obtain the target replacement scenarios that support the object operation methods and the target replacement words corresponding to the target replacement scenarios, thereby achieving semantic understanding and improving the applicability of semantic understanding.
[0016] Optionally, extracting the keywords to be replaced from the interactive text to be identified includes:
[0017] The interactive text to be identified is matched with keywords in the text library to obtain matching keywords;
[0018] Based on the matching keywords, the interactive text to be identified is segmented to obtain the text splitting result;
[0019] If the syntactic structure of the text splitting result satisfies the preset syntactic judgment conditions, then the matching keyword is used as the keyword to be replaced.
[0020] In this embodiment, the interactive text to be identified is segmented based on matching keywords, and the text segmentation results are compared with preset syntax. Only after the syntax judgment conditions are met are the matching keywords used as replacement keywords, thus avoiding semantic destruction and improving the accuracy of keyword matching.
[0021] Optionally, adjusting the preliminary semantic understanding result using the keyword to be replaced and the target scene to obtain the target semantic understanding result includes:
[0022] The target replacement word in the preliminary semantic understanding result is replaced with the keyword to be replaced, and the original scene corresponding to the target replacement word in the preliminary semantic understanding result is replaced with the target scene to obtain the preliminary adjustment result;
[0023] Based on the keywords to be replaced, the object operation methods in the preliminary adjustment results are checked to obtain the target semantic understanding results.
[0024] In this embodiment, the keywords to be replaced in the interactive text to be identified and the target scene are used to perform semantic recovery on the preliminary semantic understanding results, and then the results after semantic recovery are further verified, thereby improving the accuracy of semantic understanding.
[0025] Optionally, the step of verifying the object operation method in the preliminary adjustment result based on the keyword to be replaced to obtain the target semantic understanding result includes:
[0026] If the object operation method in the preliminary adjustment result matches the keyword to be replaced, then the preliminary adjustment result will be used as the target semantic understanding result.
[0027] If the object operation method in the preliminary adjustment result does not match the keyword to be replaced, then the prompt message indicating a semantic understanding error will be used as the target semantic understanding result.
[0028] In this embodiment of the application, when verifying the results after semantic recovery, the results that pass the verification are directly output, and the results that fail the verification are prompted with a message indicating that the speech understanding is wrong and the content of the error, thereby enhancing the intelligence and accuracy of semantic understanding.
[0029] Optionally, before extracting the keywords to be replaced from the interactive text to be identified, the method further includes:
[0030] Obtain training corpora corresponding to multiple scenarios;
[0031] Based on the interactive text expression forms corresponding to the training corpus, the training corpus is merged and learned to obtain at least one set of related scenarios and interactive text data corresponding to each set of related scenarios.
[0032] Based on the interactive text data of one scenario in each set of associated scenarios, determine the replacement word corresponding to each set of associated scenarios;
[0033] Based on the at least one set of related scenarios and the corresponding replacement words, the merging learning table is constructed.
[0034] In this embodiment, before performing semantic understanding on the interactive text, a merge learning process is performed on the training corpus. Multiple scenarios with the same interactive text expression are merged into a set of related scenarios, and the replacement words corresponding to the set of related scenarios are determined. Then, a merge learning table is constructed based on the obtained set of related scenarios and the corresponding replacement words, so that keyword replacement can be performed based on the merge learning table to achieve semantic understanding and improve the generalization ability of semantic understanding.
[0035] Optional, also includes:
[0036] Based on the interactive text data of a scenario in each associated scenario set, determine the object operation method corresponding to each associated scenario set;
[0037] Based on the at least one set of associated scenarios and the corresponding replacement words and object operation methods, construct the object operation method table.
[0038] In this embodiment, an object operation method table is constructed, which includes a set of associated scenarios, replacement words, and object operation methods. Therefore, during the semantic understanding process, if no replacement word for the corresponding scenario is obtained from the merge learning table, the replacement word can be obtained from the object operation method table based on the object operation methods, thereby improving the applicability and accuracy of semantic understanding.
[0039] Optional, also includes:
[0040] Retain the interactive text data for one scenario within each set of associated scenarios;
[0041] A semantic understanding model is trained based on the retained interactive text data. The semantic understanding model is used to perform semantic understanding on the target interactive text and obtain preliminary semantic understanding results.
[0042] In this embodiment, interactive text data from one scenario in the associated scenario set is used to train the semantic understanding model, which avoids data duplication and reduces the workload of model training.
[0043] On one hand, embodiments of this application provide a semantic understanding apparatus, the apparatus comprising:
[0044] The acquisition module is used to extract the keywords to be replaced from the interactive text to be identified, and to obtain the target scene corresponding to the keywords to be replaced;
[0045] The query module is used to obtain the target replacement word corresponding to the target scene from the merge learning table if the target scene is contained in the merge learning table. The merge learning table includes at least one set of related scenes and corresponding replacement words. The interactive text expression form corresponding to each scene in the set of related scenes is the same.
[0046] The semantic understanding module is used to replace the keyword to be replaced with the target replacement word to obtain the target interactive text, and to perform semantic understanding on the target interactive text to obtain preliminary semantic understanding results;
[0047] The semantic recovery module is used to adjust the preliminary semantic understanding result using the keyword to be replaced and the target scene to obtain the target semantic understanding result.
[0048] Optionally, the acquisition module is further configured to:
[0049] Extract the target operation method from the interactive text to be identified;
[0050] The query module is also used for:
[0051] If the merge learning table does not contain the target scenario, then the target replacement scenario that supports the target operation method and the target replacement word corresponding to the target replacement scenario are obtained from the object operation method table. The object operation method table includes at least one set of associated scenarios and corresponding replacement words and object operation methods.
[0052] Optionally, the acquisition module is specifically used for:
[0053] The interactive text to be identified is matched with keywords in the text library to obtain matching keywords;
[0054] Based on the matching keywords, the interactive text to be identified is segmented to obtain the text splitting result;
[0055] If the syntactic structure of the text splitting result satisfies the preset syntactic judgment conditions, then the matching keyword is used as the keyword to be replaced.
[0056] Optionally, the semantic recovery module is specifically used for:
[0057] The target replacement word in the preliminary semantic understanding result is replaced with the keyword to be replaced, and the original scene corresponding to the target replacement word in the preliminary semantic understanding result is replaced with the target scene to obtain the preliminary adjustment result;
[0058] Based on the keywords to be replaced, the object operation methods in the preliminary adjustment results are checked to obtain the target semantic understanding results.
[0059] Optionally, the semantic recovery module is specifically used for:
[0060] If the object operation method in the preliminary adjustment result matches the keyword to be replaced, then the preliminary adjustment result will be used as the target semantic understanding result.
[0061] If the object operation method in the preliminary adjustment result does not match the keyword to be replaced, then the prompt message indicating a semantic understanding error will be used as the target semantic understanding result.
[0062] Optionally, the acquisition module is further configured to:
[0063] Obtain training corpora corresponding to multiple scenarios;
[0064] Based on the interactive text expression forms corresponding to the training corpus, the training corpus is merged and learned to obtain at least one set of related scenarios and interactive text data corresponding to each set of related scenarios.
[0065] Based on the interactive text data of one scenario in each set of associated scenarios, determine the replacement word corresponding to each set of associated scenarios;
[0066] Based on the at least one set of related scenarios and the corresponding replacement words, the merging learning table is constructed.
[0067] Optionally, the acquisition module is further configured to:
[0068] Based on the interactive text data of a scenario in each associated scenario set, determine the object operation method corresponding to each associated scenario set;
[0069] Based on the at least one set of associated scenarios and the corresponding replacement words and object operation methods, construct the object operation method table.
[0070] Optionally, the acquisition module is further configured to:
[0071] Retain the interactive text data for one scenario within each set of associated scenarios;
[0072] A semantic understanding model is trained based on the retained interactive text data. The semantic understanding model is used to perform semantic understanding on the target interactive text and obtain preliminary semantic understanding results.
[0073] On one hand, embodiments of this application provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the semantic understanding method described above.
[0074] On one hand, embodiments of this application provide a computer-readable storage medium storing a computer program executable by a computer device, which, when run on the computer device, causes the computer device to perform the steps of the semantic understanding method described above. Attached Figure Description
[0075] Figure 1 A system architecture diagram provided for an embodiment of this application;
[0076] Figure 2 A flowchart illustrating a semantic understanding method provided in this application embodiment. Figure 1 ;
[0077] Figure 3 A flowchart illustrating a method for extracting keywords to be replaced, provided in an embodiment of this application;
[0078] Figure 4 This is a schematic diagram of a preliminary semantic understanding adjustment method provided in an embodiment of this application;
[0079] Figure 5 A schematic diagram illustrating a method for constructing a merge learning table provided in an embodiment of this application;
[0080] Figure 6 This application provides a schematic diagram of a method for constructing an object operation method table.
[0081] Figure 7 This application provides a schematic diagram illustrating the process of training a semantic understanding model.
[0082] Figure 8 A flowchart of a semantic understanding method provided in this application embodiment Figure 2 ;
[0083] Figure 9 This is a schematic diagram of the structure of a semantic understanding device provided in an embodiment of this application;
[0084] Figure 10 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0085] To make the objectives, technical solutions, and beneficial effects of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0086] refer to Figure 1 This is a system architecture diagram applicable to the embodiments of this application. The system architecture includes at least a terminal device 101 and a smart city application system 102. The number of terminal devices 101 can be one or more.
[0087] The terminal device 101 has smart city applications pre-installed, including client applications, web applications, and mini-program applications. The terminal device 101 can be a smartphone, tablet, laptop, desktop computer, smart home appliance, smart voice interaction device, smart vehicle device, etc., but is not limited to these.
[0088] The smart city application system 102 is the backend server for smart city applications. The smart city application system 102 can be a standalone physical server, a server cluster composed of multiple physical servers, or a distributed system. It can also be a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. The terminal device 101 and the smart city application system 102 can be directly or indirectly connected via wired or wireless communication; this application does not impose any restrictions on this connection.
[0089] Terminal device 101, in response to a business operation triggered in a smart city application, obtains the interactive text to be recognized. It then sends the interactive text to the smart city application system 102. The smart city application system 102 performs semantic understanding on the interactive text to obtain a target semantic understanding result, and then executes subsequent business processes based on the target semantic understanding result to obtain a business processing result. Finally, it sends the business processing result back to the terminal device.
[0090] based on Figure 1 The system architecture diagram shown in this application illustrates the flow of a semantic understanding method. Figure 2 As shown, the process of this method is executed by a computer device, which can be... Figure 1 The smart city application system shown includes the following steps:
[0091] Step 201: Extract the keywords to be replaced from the interactive text to be identified, and obtain the target scene corresponding to the keywords to be replaced.
[0092] Specifically, the interactive text to be recognized can be text manually entered by the user, or it can be the text obtained by recognizing the audio recording of the user's voice interaction using a speech recognition algorithm. The interactive text to be recognized corresponds to the user's actual needs, and can be a sentence or a paragraph. The keywords to be replaced can be text objects such as indicator names, file names, organization names, and personnel names.
[0093] For example, when a user needs to check per capita disposable income, the interactive text to be identified is "Check how much per capita disposable income has increased." The keyword to be replaced, "average employee salary," is extracted from the interactive text, and then the target scenario corresponding to the keyword, "daily management - economic field," is obtained.
[0094] Step 202: If the merged learning table contains the target scene, then obtain the target replacement word corresponding to the target scene from the merged learning table.
[0095] Specifically, the merge learning table includes at least one set of associated scenarios and corresponding replacement words. Each scenario in the associated scenario set has the same interactive text expression format. Each associated scenario set includes multiple associated scenarios, and multiple associated scenarios correspond to one replacement word. The merge learning table is pre-trained and supports periodic or dynamic updates.
[0096] If the target scenario is found in the merge learning table, the replacement words corresponding to the set of related scenarios in the merge learning table that contain the target scenario will be used as the target replacement words for the target scenario.
[0097] For example, the keyword to be replaced, "average employee salary," is extracted from the interactive text to be identified, along with the target scenario "daily management - economic field" corresponding to the keyword. Then, the trained merge learning table is queried based on the target scenario "daily management - economic field." Assuming that the set of associated scenarios A in the merge learning table contains the target scenario "daily management - economic field," then the replacement word "air quality index" corresponding to the set of associated scenarios A is used as the target replacement word for the target scenario.
[0098] Step 203: Replace the keyword to be replaced with the target replacement word to obtain the target interactive text, and perform semantic understanding on the target interactive text to obtain preliminary semantic understanding results.
[0099] Specifically, the target interactive text is input into a trained semantic understanding model, which then performs semantic understanding on the target interactive text to obtain preliminary semantic understanding results.
[0100] Step 204: Using the keywords to be replaced and the target scenario, adjust the preliminary semantic understanding results to obtain the target semantic understanding results.
[0101] Specifically, since the preliminary semantic understanding result is obtained based on the target replacement word, it does not match the user's actual semantic meaning. Therefore, after obtaining the preliminary semantic understanding result, it is necessary to adjust it using the keyword to be replaced and the target scenario to obtain a target semantic understanding result that matches the user's actual semantic meaning. Further business processes can then be executed based on the target semantic understanding result, such as operating on the relevant database or retrieving policies and documents related to the user's needs and returning them to the user.
[0102] For example, the interactive text to be identified is "View how much per capita disposable income has increased." The keyword to be replaced, "average employee wage," is extracted from the interactive text, and then the target scenario corresponding to the keyword, "daily management - economic field," is obtained.
[0103] Based on the target scenario "Daily Management - Economic Sector", query the trained merge learning table. Assuming that the associated scenario set A of the merge learning table contains the target scenario "Daily Management - Economic Sector", then the replacement word "Air Quality Index" corresponding to the associated scenario set A will be used as the target replacement word for the target scenario.
[0104] Next, the target replacement term "air quality index" is used to replace the keyword "average employee wage" to obtain the target interactive text. Semantic understanding of the target interactive text is then performed to obtain preliminary semantic understanding results. The preliminary semantic understanding results are then adjusted using the keyword "average employee wage" to be replaced and the target scenario "daily management - economic field" to obtain the final target semantic understanding result.
[0105] In this embodiment, scenarios with the same interactive text expression are merged to obtain a set of related scenarios. This set of related scenarios, along with the corresponding replacement words, is stored in a merge learning table. Therefore, for new user interaction content, only the corresponding scenario needs to be configured in the merge learning table to achieve semantic understanding of the new user interaction content, without needing to re-collect data, train the semantic understanding model, and deploy it, thereby improving response speed and reducing manpower requirements. Secondly, after replacing the keywords to be replaced in the interactive text to be identified with preset content, semantic understanding and semantic recovery are performed, achieving semantic understanding of various scenarios with the same interactive text expression, thus improving generalization ability.
[0106] In some embodiments, in addition to extracting the keywords to be replaced from the interactive text to be identified, target operation methods can also be extracted from the interactive text to be identified. The target operation methods characterize the operation capabilities supported by the text object corresponding to the keywords to be replaced. For example, indicator classes support operation capabilities such as query, comparison, trend, ranking, maximum and minimum values, similar, year-on-year and month-on-month comparison, average, number, and range; file types support operation capabilities such as view, open, copy, send, and modify.
[0107] If the merged learning table does not contain the target scenario, then the target replacement scenario that supports the target operation method and the target replacement word corresponding to the target replacement scenario are obtained from the object operation method table. The object operation method table includes at least one set of associated scenarios and the corresponding replacement word and object operation method.
[0108] Specifically, when the merge learning table does not contain the target scene, it indicates that the keyword to be replaced in the text to be identified is a newly appearing proper noun, and that the keyword to be replaced and its corresponding target scene were not involved in the training or configuration of the merge learning table and the object operation method table. Therefore, the target scene cannot be found in either the merge learning table or the object operation method table, and in this case, it is necessary to use the target operation method extracted from the interactive text to be identified.
[0109] In practical applications, after extracting the target operation method from the interactive text to be recognized, the target operation method is validated for reasonableness. If validation is successful, the target replacement scenarios supporting the target operation method and the corresponding target replacement words are retrieved from the object operation method table. There may be one or more target replacement scenarios supporting the target operation method. The target replacement words are then used to replace the keywords to be replaced, obtaining the target interactive text. Semantic understanding is then performed on the target interactive text to obtain preliminary semantic understanding results. Finally, the preliminary semantic understanding results are adjusted using the keywords to be replaced and the target scenarios to obtain the final target semantic understanding result.
[0110] For example, the interactive text to be identified is "View how much per capita disposable income has increased". The keywords to be replaced, "average employee salary", and the target operation method "query" are extracted from the interactive text. Then, the target scenario corresponding to the keywords to be replaced, "daily management - economic field", is obtained.
[0111] Based on the target scenario "Daily Management - Economic Sector", query the trained merge learning table. Assuming the merge learning table does not store the target scenario "Daily Management - Economic Sector", retrieve the target replacement scenario "Daily Management - Technology Sector" that supports the target operation method "Query" from the object operation method table, as well as the target replacement term "Cloud Computing Service Industry Revenue" corresponding to the target replacement scenario.
[0112] Then, the target replacement term "revenue from cloud computing services" is used to replace the keyword "average employee wage" to obtain the target interactive text. Semantic understanding of the target interactive text is then performed to obtain preliminary semantic understanding results. The preliminary semantic understanding results are then adjusted using the keyword "average employee wage" to be replaced and the target scenario "daily management - economic field" to obtain the final target semantic understanding result.
[0113] In this embodiment of the application, for new text interaction content that is not configured in the merge learning table, the object operation method table can be searched based on the object operation methods in the text interaction content to obtain the target replacement scenarios that support the object operation methods and the target replacement words corresponding to the target replacement scenarios, thereby achieving semantic understanding and improving the applicability of semantic understanding.
[0114] In some embodiments, this application employs at least the following methods to extract keywords to be replaced from the interactive text to be identified, such as... Figure 3 As shown, it includes the following steps:
[0115] Step 301: Match the interactive text to be recognized with the keywords in the text library to obtain the matching keywords.
[0116] Specifically, the text library includes an indicator database and a policy document database. The indicator database contains information related to various indicators, and the policy document database contains information related to various types of documents. The text library supports regular or dynamic updates.
[0117] For example, the structure of the smart city indicator database is shown in Table 1 below:
[0118] Table 1.
[0119]
[0120] The structure of the policy document database for smart cities is shown in Table 2 below:
[0121] Table 2.
[0122]
[0123] The interactive text to be identified, “How much has per capita disposable income increased?”, was matched with the two databases mentioned above, and the matching keywords were “per capita disposable income” and “per capita disposable income growth”.
[0124] Step 302: Based on the matching keywords, perform word segmentation on the interactive text to be identified to obtain the text segmentation results.
[0125] Step 303: If the syntactic structure of the text splitting result satisfies the preset syntactic judgment conditions, then the matching keyword is taken as the keyword to be replaced.
[0126] Specifically, for each matching keyword, the matching keyword is regarded as a whole, and the interactive text to be recognized is tokenized and syntactically judged according to its word nature. If the syntactic structure of the text splitting result meets the preset syntactic judgment conditions, it indicates that the syntactic structure of the text splitting result is reasonable.
[0127] For example, for the interactive text to be recognized "Check how much the per capita disposable income has increased?", when the matching keyword is "per capita disposable income", the interactive text to be recognized is split into:
[0128] 1. "Check" (verb) "per capita disposable income" (keyword) "increase" (verb) "already" (auxiliary word) "how much" (pronoun);
[0129] When the matching keyword is "per capita disposable income increase", the interactive text to be recognized is split into:
[0130] 2. "Check" (verb) "per capita disposable income increase" (keyword) "already" (auxiliary word) "how much" (pronoun);
[0131] Based on the pre - installed syntactic library, syntactic judgments are made on the above two splitting results, and it is found that the syntactic structure of splitting result 1 is reasonable, while the syntactic structure of splitting result 2 is unreasonable.
[0132] In the embodiments of the present application, the interactive text to be recognized is tokenized based on the matching keyword, and the text splitting result is compared with the preset syntax. Only when the syntactic judgment conditions are met, the matching keyword is used as the keyword to be replaced, avoiding the situation of being semantically damaged and improving the accuracy of keyword matching.
[0133] In some embodiments, the present application at least adopts the following method to adjust the preliminary semantic understanding result to obtain the target semantic understanding result, as Figure 4 shown, including the following steps:
[0134] Step 401: Replace the target replacement word in the preliminary semantic understanding result with the keyword to be replaced, and replace the original scene corresponding to the target replacement word in the preliminary semantic understanding result with the target scene, to obtain the preliminary adjustment result.
[0135] Specifically, the format of the preliminary semantic understanding result can be set according to actual needs.
[0136] For example, the present application conducts semantic understanding on the target interactive text, and the obtained preliminary semantic understanding result is:
[0137]
[0138] The target replacement term "air quality index" in the preliminary semantic understanding results was replaced with the keyword "per capita disposable income," and the original scenario "daily management - ecological and environmental protection" corresponding to the target replacement term "air quality index" in the preliminary semantic understanding results was replaced with the target scenario "daily management - economic field." The preliminary adjustment results are as follows:
[0139]
[0140] Step 402: Based on the preliminary adjustment results of the keyword to be replaced, check the object operation methods to obtain the target semantic understanding results.
[0141] Specifically, if the object manipulation method in the preliminary adjustment result matches the keyword to be replaced, then the preliminary adjustment result is taken as the target semantic understanding result. If the object manipulation method in the preliminary adjustment result does not match the keyword to be replaced, then a prompt message indicating a semantic understanding error is taken as the target semantic understanding result.
[0142] If the object manipulation methods in the preliminary adjustment results match the keyword to be replaced, it means the keyword to be replaced supports the object manipulation methods in the preliminary adjustment results. Therefore, the preliminary adjustment results are returned as the final target semantic understanding results. If the object manipulation methods in the preliminary adjustment results do not match the keyword to be replaced, it means the keyword to be replaced does not support the object manipulation methods in the preliminary adjustment results. In this case, a semantic understanding error message should be returned.
[0143] For example, if the keyword to be replaced is set to "per capita disposable income", and the object operation method in the preliminary adjustment result is "month-on-month comparison", then since "per capita disposable income" has the "month-on-month comparison" property, the keyword to be replaced in the preliminary adjustment result, "per capita disposable income", matches the object operation method "month-on-month comparison". Therefore, the preliminary adjustment result is directly returned as the final target semantic understanding result.
[0144] The keyword to be replaced is set to "accumulated accidents," and the object operation method in the initial adjustment result is set to "month-on-month comparison." Since the current result of "accumulated accidents" is the cumulative value of the current period, and the original value already includes the value of the previous month, it does not have the ability to obtain a month-on-month comparison. Therefore, the keyword to be replaced in the initial adjustment result, "accumulated accidents," does not match the object operation method "month-on-month comparison," and the prompt message "accumulated accidents do not have a month-on-month comparison capability" is returned.
[0145] In this embodiment, the target keywords and the target scene in the interactive text to be identified are used to perform semantic recovery on the preliminary semantic understanding results. The recovered results are then further verified, thereby improving the accuracy of semantic understanding. When verifying the recovered results, results that pass the verification are directly output; results that fail the verification are indicated with a message indicating a speech comprehension error and the content of the error, thus enhancing the intelligence and accuracy of semantic understanding.
[0146] In some embodiments, before extracting the keywords to be replaced from the interactive text to be identified, it is necessary to obtain a merge learning table, an object operation method table, and a semantic understanding model through training or configuration.
[0147] First, we will introduce the process of obtaining the merged learning table, such as... Figure 5 As shown, it includes the following steps:
[0148] Step 501: Obtain training corpora corresponding to multiple scenarios.
[0149] Specifically, the process involves exhaustively enumerating all or part of the keyword-related interactive texts (also known as user statements) in the text library, then labeling the obtained interactive texts to obtain training corpus. Upon receiving the interactive texts, the text library of the smart city is extracted, and the interactive texts are merged and learned to obtain a merged learning table containing similar statements. After completing the merged learning table, based on the interactive texts, for scenarios with corresponding relationships, only the full set of statements for that specific scenario is retained.
[0150] Step 502: Based on the interactive text expression forms corresponding to the training corpus, perform merge learning on the training corpus to obtain at least one set of related scenarios and the interactive text data corresponding to each set of related scenarios.
[0151] Specifically, the training corpus is merged for learning, which means extracting a text library and merging interactive texts with consistent interactive text expressions (user statements) to obtain at least one set of related scenarios, with each set of related scenarios having a consistent interactive text expression.
[0152] Step 503: Based on the interactive text data of one scenario in each associated scenario set, determine the replacement word corresponding to each associated scenario set.
[0153] Specifically, each set of associated scenarios includes multiple associated scenarios. Since the interactive text expression form corresponding to each set of associated scenarios is consistent, it is possible to retain only the interactive text data under one scenario in the set of associated scenarios, and then determine the replacement words corresponding to the corresponding set of associated scenarios based on the interactive text data under this one scenario.
[0154] Step 504: Construct a merge learning table based on at least one set of related scenarios and the corresponding replacement words.
[0155] Specifically, at least one set of related scenarios and interactive text with consistent expression are saved to obtain a merged learning table. The merged learning table supports manual configuration.
[0156] In this embodiment, before performing semantic understanding on the interactive text, merge learning is performed on the training corpus. Multiple scenarios with similar interactive text expressions are grouped into a set of related scenarios, and the corresponding replacement words for each related scenario set are determined. A merge learning table is then constructed based on the obtained set of related scenarios and the corresponding replacement words. This table is used for subsequent keyword replacement to achieve semantic understanding and improve the generalization ability of semantic understanding. The merge learning table supports manual configuration; if the model's learning ability is insufficient, manual modification can compensate for the model's deficiencies, thereby improving the model's accuracy.
[0157] This application embodiment further explains the acquisition of the object operation method table, such as... Figure 6 As shown, it includes the following steps:
[0158] Step 601: Based on the interactive text data of one scene in each associated scene set, determine the object operation method corresponding to each associated scene set.
[0159] Specifically, in addition to learning by merging the training corpus, it is also necessary to learn object manipulation methods. Based on the part-of-speech tags of the interactive text data in a particular scenario from the associated scenario set, object manipulation methods are extracted from the interactive text data. There can be one or more object manipulation methods.
[0160] Step 602: Based on at least one set of associated scenarios and the corresponding replacement words and object operation methods, construct an object operation method table.
[0161] Specifically, at least one set of associated scenarios, corresponding replacement words, and object operation methods are associated and saved to obtain an object operation method table. The object operation method table supports manual configuration.
[0162] In this embodiment, an object operation method table is constructed, which includes a set of associated scenarios, replacement words, and object operation methods. Therefore, during the semantic understanding process, if no replacement word for the corresponding scenario is obtained from the merge learning table, the replacement word can be obtained from the object operation method table based on the object operation methods, thereby improving the applicability and accuracy of semantic understanding.
[0163] The process of training the semantic understanding model in the embodiments of this application is as follows: Figure 7 As shown, it includes the following steps:
[0164] Step 701: Retain the interactive text data of one scene in each associated scene set.
[0165] Specifically, since the interactive text expression form is consistent for each set of associated scenarios, it is possible to retain only the interactive text data for one scenario in the set of associated scenarios.
[0166] Step 702: Train a semantic understanding model based on the retained interactive text data.
[0167] Semantic understanding models can be single models or combined models. A single semantic understanding model can be trained by using interactive text data from multiple scenarios, or a single model can be trained using interactive text data from each scenario, and then the multiple single models can be combined to obtain a combined semantic understanding model.
[0168] After training is complete, the trained semantic understanding model is deployed. Once deployed on the online system, the model proactively adapts to new data and provides operational configuration capabilities to avoid retraining the model every time the data changes.
[0169] In the application embodiment, interactive text data from one scenario in the associated scenario set is used to train the semantic understanding model, which avoids data duplication and reduces the workload of model training.
[0170] To better explain the embodiments of this application, a semantic understanding method provided by the embodiments of this application is described below in conjunction with a specific implementation scenario. The process of this method can be as follows: Figure 1 The execution of the smart city application system shown includes a training phase and a prediction phase, such as... Figure 8 As shown:
[0171] Step 801: Enumerate all or part of the interactive texts of keywords in the text library, and then annotate them to form training corpus.
[0172] Step 802: Combine the smart city scenario intent database to perform merge learning on the training corpus and construct a merge learning table.
[0173] Step 803: Learn object operation methods from the merged interactive text to obtain an object operation method table.
[0174] Step 804: Input the merged interactive text into a single or combined model for training.
[0175] Step 805 yields a pre-trained single or combined semantic understanding algorithm model.
[0176] Step 806: Extract the keywords to be replaced and the target operation method based on the interactive text input by the user.
[0177] Step 807: Obtain the target scenario corresponding to the keyword to be replaced from the smart city scenario intent library.
[0178] Step 808: Determine whether the object operation method table contains the target scenario. If yes, proceed to step 809; otherwise, proceed to step 810.
[0179] Step 809: Obtain the target replacement word corresponding to the target scene from the merge learning table, and then proceed to step 811.
[0180] Step 810: Obtain the target replacement scenarios that support the target operation methods and the target replacement words corresponding to the target replacement scenarios from the object operation method table.
[0181] Step 811: Replace the keyword to be replaced with the target replacement keyword to obtain the target interactive text;
[0182] Step 812: Use a semantic understanding algorithm model to perform semantic understanding on the target interactive text and obtain preliminary semantic understanding results.
[0183] Step 813: Perform intent recovery on the preliminary semantic understanding results to obtain the target semantic understanding results.
[0184] If the object operation method in the preliminary semantic understanding result matches the keyword to be replaced, the preliminary semantic understanding result is output as the final semantic understanding result; if the object operation method in the preliminary semantic understanding result does not match the keyword to be replaced, a prompt message indicating a semantic understanding error is output.
[0185] Step 814: Execute subsequent business processes based on the target semantic understanding results.
[0186] In this embodiment, scenarios with the same interactive text expression are merged to obtain a set of related scenarios. This set of related scenarios, along with their corresponding replacement words, is stored in a merge learning table. Therefore, for new user interaction content, only the corresponding scenario needs to be configured in the merge learning table to achieve semantic understanding of the new user interaction content, without needing to re-collect data, train the semantic understanding model, and deploy it, thereby improving response speed and reducing manpower requirements. Secondly, after replacing the keywords to be replaced in the interactive text to be identified with preset content, semantic understanding and semantic recovery are performed, achieving semantic understanding of various scenarios with the same interactive text expression, thus improving generalization ability. For new text interaction content not configured in the merge learning table, the object operation method table can be searched based on the object operation methods in the text interaction content to obtain the target replacement scenarios supporting the object operation methods, as well as the target replacement words corresponding to the target replacement scenarios, thereby achieving semantic understanding and improving the applicability of semantic understanding.
[0187] Based on the same technical concept, embodiments of this application provide a semantic understanding device, such as... Figure 9 As shown, the device 900 includes:
[0188] The acquisition module 901 is used to extract the keyword to be replaced from the interactive text to be identified, and to obtain the target scene corresponding to the keyword to be replaced;
[0189] The query module 902 is used to obtain the target replacement word corresponding to the target scene from the merge learning table if the target scene is contained in the merge learning table. The merge learning table includes at least one set of related scenes and corresponding replacement words. The interactive text expression form corresponding to each scene in the set of related scenes is the same.
[0190] The semantic understanding module 903 is used to replace the keyword to be replaced with the target replacement word to obtain the target interactive text, and to perform semantic understanding on the target interactive text to obtain a preliminary semantic understanding result;
[0191] The semantic recovery module 904 is used to adjust the preliminary semantic understanding result using the keyword to be replaced and the target scene to obtain the target semantic understanding result.
[0192] Optionally, the acquisition module is further configured to:
[0193] Extract the target operation method from the interactive text to be identified;
[0194] The query module is also used for:
[0195] If the merge learning table does not contain the target scenario, then the target replacement scenario that supports the target operation method and the target replacement word corresponding to the target replacement scenario are obtained from the object operation method table. The object operation method table includes at least one set of associated scenarios and corresponding replacement words and object operation methods.
[0196] Optionally, the acquisition module is specifically used for:
[0197] The interactive text to be identified is matched with keywords in the text library to obtain matching keywords;
[0198] Based on the matching keywords, the interactive text to be identified is segmented to obtain the text splitting result;
[0199] If the syntactic structure of the text splitting result satisfies the preset syntactic judgment conditions, then the matching keyword is used as the keyword to be replaced.
[0200] Optionally, the semantic recovery module is specifically used for:
[0201] The target replacement word in the preliminary semantic understanding result is replaced with the keyword to be replaced, and the original scene corresponding to the target replacement word in the preliminary semantic understanding result is replaced with the target scene to obtain the preliminary adjustment result;
[0202] Based on the keywords to be replaced, the object operation methods in the preliminary adjustment results are checked to obtain the target semantic understanding results.
[0203] Optionally, the semantic recovery module is specifically used for:
[0204] If the object operation method in the preliminary adjustment result matches the keyword to be replaced, then the preliminary adjustment result will be used as the target semantic understanding result.
[0205] If the object operation method in the preliminary adjustment result does not match the keyword to be replaced, then the prompt message indicating a semantic understanding error will be used as the target semantic understanding result.
[0206] Optionally, the acquisition module is further configured to:
[0207] Obtain training corpora corresponding to multiple scenarios;
[0208] Based on the interactive text expression forms corresponding to the training corpus, the training corpus is merged and learned to obtain at least one set of related scenarios and interactive text data corresponding to each set of related scenarios.
[0209] Based on the interactive text data of one scenario in each set of associated scenarios, determine the replacement word corresponding to each set of associated scenarios;
[0210] Based on the at least one set of related scenarios and the corresponding replacement words, the merging learning table is constructed.
[0211] Optionally, the acquisition module is further configured to:
[0212] Based on the interactive text data of a scenario in each associated scenario set, determine the object operation method corresponding to each associated scenario set;
[0213] Based on the at least one set of associated scenarios and the corresponding replacement words and object operation methods, construct the object operation method table.
[0214] Optionally, the acquisition module is further configured to:
[0215] Retain the interactive text data for one scenario within each set of associated scenarios;
[0216] A semantic understanding model is trained based on the retained interactive text data. The semantic understanding model is used to perform semantic understanding on the target interactive text and obtain preliminary semantic understanding results.
[0217] In this embodiment, scenarios with the same interactive text expression are merged to obtain a set of related scenarios. This set of related scenarios, along with the corresponding replacement words, is stored in a merge learning table. Therefore, for new user interaction content, only the corresponding scenario needs to be configured in the merge learning table to achieve semantic understanding of the new user interaction content, without needing to re-collect data, train the semantic understanding model, and deploy it, thereby improving response speed and reducing manpower requirements. Secondly, after replacing the keywords to be replaced in the interactive text to be identified with preset content, semantic understanding and semantic recovery are performed, achieving semantic understanding of various scenarios with the same interactive text expression, thus improving generalization ability.
[0218] Based on the same technical concept, embodiments of this application provide a computer device, which may be a terminal or a server, such as... Figure 10 The embodiment includes at least one processor 1001 and a memory 1002 connected to the at least one processor. The specific connection medium between the processor 1001 and the memory 1002 is not limited in this embodiment. Figure 10 Taking the connection between processor 1001 and memory 1002 via a bus as an example, the bus can be divided into address bus, data bus, control bus, etc.
[0219] In this embodiment of the application, the memory 1002 stores instructions that can be executed by at least one processor 1001. By executing the instructions stored in the memory 1002, at least one processor 1001 can perform the steps included in the semantic understanding method described above.
[0220] The processor 1001 is the control center of the computer device, capable of connecting various parts of the computer device via various interfaces and lines. It performs semantic understanding by running or executing instructions stored in the memory 1002 and accessing data stored in the memory 1002. Optionally, the processor 1001 may include one or more processing units. The processor 1001 may integrate an application processor and a modem processor. The application processor primarily handles the operating system, user interface, and applications, while the modem processor primarily handles wireless communication. It is understood that the modem processor may not be integrated into the processor 1001. In some embodiments, the processor 1001 and the memory 1002 may be implemented on the same chip; in other embodiments, they may be implemented on separate chips.
[0221] The processor 1001 can be a general-purpose processor, such as a central processing unit (CPU), digital signal processor, application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component, capable of implementing or executing the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly manifested as being executed by a hardware processor, or executed by a combination of hardware and software modules within the processor.
[0222] Memory 1002, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. Memory 1002 may include at least one type of storage medium, such as flash memory, hard disk, multimedia card, card-type memory, random access memory (RAM), static random access memory (SRAM), programmable read-only memory (PROM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), magnetic memory, magnetic disk, optical disk, etc. Memory 1002 can be any other medium capable of carrying or storing desired program code in the form of instructions or data structures that can be accessed by a computer, but is not limited thereto. In the embodiments of this application, memory 1002 can also be a circuit or any other device capable of implementing storage functions for storing program instructions and / or data.
[0223] Based on the same inventive concept, embodiments of this application provide a computer-readable storage medium storing a computer program executable by a computer device, which, when run on the computer device, causes the computer device to perform the steps of the semantic understanding method described above.
[0224] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0225] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0226] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0227] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0228] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A semantic understanding method, characterized in that, include: Extract the keywords to be replaced from the interactive text to be identified, and obtain the target scene corresponding to the keywords to be replaced; If the merge learning table contains the target scene, then the target replacement word corresponding to the target scene is obtained from the merge learning table. The merge learning table includes at least one set of associated scenes and corresponding replacement words. The interactive text expression form corresponding to each scene in the set of associated scenes is the same. The target replacement word is used to replace the keyword to be replaced to obtain the target interactive text, and the target interactive text is semantically understood to obtain preliminary semantic understanding results; Using the keywords to be replaced and the target scenario, the preliminary semantic understanding result is adjusted to obtain the target semantic understanding result; The method further includes: Extract the target operation method from the interactive text to be identified; If the merge learning table does not contain the target scenario, then the target replacement scenario that supports the target operation method and the target replacement word corresponding to the target replacement scenario are obtained from the object operation method table. The object operation method table includes at least one set of associated scenarios and corresponding replacement words and object operation methods.
2. The method as described in claim 1, characterized in that, The extraction of keywords to be replaced from the interactive text to be identified includes: The interactive text to be identified is matched with keywords in the text library to obtain matching keywords; Based on the matching keywords, the interactive text to be identified is segmented to obtain the text splitting result; If the syntactic structure of the text splitting result satisfies the preset syntactic judgment conditions, then the matching keyword is used as the keyword to be replaced.
3. The method as described in claim 1, characterized in that, The step of adjusting the preliminary semantic understanding result using the keywords to be replaced and the target scene to obtain the target semantic understanding result includes: The target replacement word in the preliminary semantic understanding result is replaced with the keyword to be replaced, and the original scene corresponding to the target replacement word in the preliminary semantic understanding result is replaced with the target scene to obtain the preliminary adjustment result; Based on the keywords to be replaced, the object operation methods in the preliminary adjustment results are checked to obtain the target semantic understanding results.
4. The method as described in claim 3, characterized in that, The method of verifying the object operation results in the preliminary adjustment results based on the keywords to be replaced, and obtaining the target semantic understanding results, includes: If the object operation method in the preliminary adjustment result matches the keyword to be replaced, then the preliminary adjustment result will be used as the target semantic understanding result. If the object operation method in the preliminary adjustment result does not match the keyword to be replaced, then the prompt message indicating a semantic understanding error will be used as the target semantic understanding result.
5. The method as described in claim 1, characterized in that, Before extracting the keywords to be replaced from the interactive text to be identified, the process also includes: Obtain training corpora corresponding to multiple scenarios; Based on the interactive text expression forms corresponding to the training corpus, the training corpus is merged and learned to obtain at least one set of related scenarios and interactive text data corresponding to each set of related scenarios. Based on the interactive text data of one scenario in each set of associated scenarios, determine the replacement word corresponding to each set of associated scenarios; Based on the at least one set of related scenarios and the corresponding replacement words, the merging learning table is constructed.
6. The method as described in claim 5, characterized in that, Also includes: Based on the interactive text data of a scenario in each associated scenario set, determine the object operation method corresponding to each associated scenario set; Based on the at least one set of associated scenarios and the corresponding replacement words and object operation methods, construct the object operation method table.
7. The method as described in claim 5, characterized in that, Also includes: Retain the interactive text data for one scenario within each set of associated scenarios; A semantic understanding model is trained based on the retained interactive text data. The semantic understanding model is used to perform semantic understanding on the target interactive text and obtain preliminary semantic understanding results.
8. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the method according to any one of claims 1 to 7.
9. A computer-readable storage medium, characterized in that, It stores a computer program executable by a computer device, which, when run on the computer device, causes the computer device to perform the steps of any one of claims 1 to 7.
Citation Information
Patent Citations
Text error correction method and device, electronic equipment and storage medium
CN112580324A