Semantic analysis method, device, computer-readable storage medium, and electronic device

Through the intent slot identification and disambiguation model, combined with user information, the ambiguity problem of spoken query sentences in the question and answer system is solved, and the accuracy of the reply and the quality of service are improved.

CN111985249BActive Publication Date: 2024-10-08BEIKE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010915355.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-03
Publication Date
2024-10-08
Estimated Expiration
2040-09-03

AI Technical Summary

Technical Problem

Existing question and answer systems have ambiguities when processing colloquial query statements, are greatly affected by region and geographical location, and are difficult to accurately analyze user intentions, resulting in inaccurate responses.

Method used

By obtaining the query sentence input by the user, using the intention slot recognition model and the disambiguation model, extract the target intention slot information that represents the user's intention, and combine the user portrait and regional basic information to determine the confidence information, eliminate ambiguity, and improve the accuracy of analysis .

Benefits of technology

Effectively eliminate the ambiguity of spoken query statements, improve the accuracy of automatic responses of the question and answer system, enable service providers to obtain the true intentions of users, and improve service quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111985249B_ABST
    Figure CN111985249B_ABST
Patent Text Reader

Abstract

The disclosed embodiment discloses a semantic analysis method and device, wherein the method includes: matching the obtained query sentence with the sentences in the preset sentence library; determining whether there is a sentence matching the query sentence in the preset sentence library; if not, executing the following steps: inputting the query sentence into the intent slot recognition model to obtain a preset number of intent slot information; obtaining the associated information of the query sentence; inputting the query sentence, the associated information and the preset number of intent slot information into a pre-trained disambiguation model to obtain the confidence information corresponding to the intent slot information in the preset number of intent slot information; based on the confidence information, extracting the target intent slot information representing the intent of the user's query from the preset number of intent slot information. The disclosed embodiment can effectively eliminate the ambiguity generated by the query sentence, help improve the accuracy of the question-answering system's reply, and enable the service provider to accurately obtain the intent of the user's query.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a semantic analysis method, device, computer-readable storage medium, and electronic device. Background Art

[0002] At present, question-answering systems are used in many fields, that is, users send questions through text, voice, etc., and the system automatically analyzes and answers the questions. The results of question analysis can provide services to service providers and users. Service providers can optimize the question-answering system based on the analysis results and provide users with high-precision replies. Summary of the invention

[0003] Embodiments of the present disclosure provide a semantic analysis method, device, computer-readable storage medium, and electronic device.

[0004] An embodiment of the present disclosure provides a semantic analysis method, which includes: obtaining a query statement input by a user; matching the query statement with statements in a preset statement library; determining whether there is a statement in the preset statement library that matches the query statement; if not, executing the following steps: inputting the query statement into an intent slot recognition model to obtain a preset number of intent slot information; obtaining associated information of the query statement; inputting the query statement, the associated information and a preset number of intent slot information into a pre-trained disambiguation model to obtain confidence information corresponding to the intent slot information in the preset number of intent slot information; based on the confidence information, extracting target intent slot information representing the intent of the user's query from the preset number of intent slot information.

[0005] In some embodiments, the associated information includes at least one of the following: user portrait information of the user, basic regional information of the area related to the user, and classification information of the query statement, wherein the classification information is obtained based on a pre-trained classification model.

[0006] In some embodiments, the classification information includes at least one of the following: sentiment classification information, sentence classification information, and sentence label information, wherein the sentiment classification information is obtained based on a pre-trained sentiment analysis model, the sentence classification information is obtained based on a pre-trained sentence analysis model, and the sentence label information is obtained based on a pre-trained label extraction model.

[0007] In some embodiments, after extracting target intent slot information representing the intention of the user's inquiry from a preset number of intent slot information, the method further includes: generating semantic information of the inquiry statement based on the target intent slot information and associated information and outputting the semantic information.

[0008] In some embodiments, a query statement is input into an intent slot recognition model to obtain a preset number of intent slot information, including: inputting a query statement into an intent slot recognition model to obtain an intent slot information set, wherein the intent slot information in the intent slot information set corresponds to a score representing the accuracy of the intent slot information; based on the size of the score, extracting a preset number of intent slot information from the intent slot information set.

[0009] In some embodiments, matching a query statement with statements in a preset statement library includes: determining a sentence vector of the query statement; determining the similarity between the sentence vector of the query statement and the sentence vectors corresponding to the statements in the preset statement library; for each of the determined similarities, in response to determining that the similarity is greater than or equal to a preset similarity threshold, determining that the statement corresponding to the similarity matches the query statement.

[0010] In some embodiments, after determining whether there is a statement matching the query statement in the preset statement library, the method further includes: in response to determining that there is a statement matching the query statement in the preset statement library, outputting semantic information corresponding to the matching statement.

[0011] According to another aspect of an embodiment of the present disclosure, a semantic analysis device is provided, which includes: a first acquisition module, used to acquire a query statement input by a user; a matching module, used to match the query statement with statements in a preset statement library; a determination module, used to determine whether there is a statement matching the query statement in the preset statement library; an identification module, used to input the query statement into an intent slot recognition model to obtain a preset number of intent slot information if there is no statement matching the query statement; a second acquisition module, used to acquire associated information of the query statement; an ambiguity elimination module, used to input the query statement, associated information and a preset number of intent slot information into a pre-trained ambiguity elimination model to obtain confidence information corresponding to the intent slot information in the preset number of intent slot information; and an extraction module, used to extract target intent slot information representing the intent of the user's query from the preset number of intent slot information based on the confidence information.

[0012] In some embodiments, the associated information includes at least one of the following: user portrait information of the user, basic regional information of the area related to the user, and classification information of the query statement, wherein the classification information is obtained based on a pre-trained classification model.

[0013] In some embodiments, the classification information includes at least one of the following: sentiment classification information, sentence classification information, and sentence label information, wherein the sentiment classification information is obtained based on a pre-trained sentiment analysis model, the sentence classification information is obtained based on a pre-trained sentence analysis model, and the sentence label information is obtained based on a pre-trained label extraction model.

[0014] In some embodiments, the device further includes: a generation module for generating semantic information of the query statement based on the target intent slot information and the associated information and outputting the semantic information.

[0015] In some embodiments, the identification module includes: a recognition unit, used to input the query statement into the intent slot recognition model to obtain an intent slot information set, wherein the intent slot information in the intent slot information set corresponds to a score characterizing the accuracy of the intent slot information; an extraction unit, used to extract a preset number of intent slot information from the intent slot information set based on the size of the score.

[0016] In some embodiments, the matching module includes: a first determination unit, used to determine the sentence vector of the query statement; a second determination unit, used to determine the similarity between the sentence vector of the query statement and the sentence vector corresponding to the statement in the preset sentence library; a third determination unit, used to, for each of the determined similarities, in response to determining that the similarity is greater than or equal to a preset similarity threshold, determine that the statement corresponding to the similarity matches the query statement.

[0017] In some embodiments, the apparatus further comprises: an output module for outputting semantic information corresponding to the matching statement in response to determining that there is a statement matching the query statement in the preset statement library.

[0018] According to another aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and the computer program is used to execute the above-mentioned semantic analysis method.

[0019] According to another aspect of an embodiment of the present disclosure, an electronic device is provided, comprising: a processor; a memory for storing processor executable instructions; and a processor for reading executable instructions from the memory and executing the instructions to implement the above-mentioned semantic analysis method.

[0020] Based on the semantic analysis method, device, computer-readable storage medium and electronic device provided by the above-mentioned embodiments of the present disclosure, when there is no sentence matching the query sentence in the preset sentence library, the intent slot recognition model is used to obtain a preset number of intent slot information, and then the associated information of the query sentence is used to use the disambiguation model to determine the confidence information of each intent slot information, and according to the confidence information, the target intent slot information representing the intention of the user's query is extracted, so that the extracted target intent slot information can reflect the true intention of the user's query, effectively eliminate the ambiguity caused by the spoken query sentence, help improve the accuracy of the question and answer system's automatic reply to the user's question, and enable the service provider to accurately obtain the true intention of the user's query.

[0021] The technical solution of the present disclosure is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The above and other purposes, features and advantages of the present disclosure will become more apparent by describing the embodiments of the present disclosure in more detail in conjunction with the accompanying drawings. The accompanying drawings are used to provide a further understanding of the embodiments of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the present disclosure and do not constitute a limitation of the present disclosure. In the drawings, the same reference numerals generally represent the same components or steps.

[0023] Figure 1 is a system diagram to which the present disclosure is applicable.

[0024] Figure 2 It is a flowchart of a semantic analysis method provided by an exemplary embodiment of the present disclosure.

[0025] Figure 3 It is a flowchart of a semantic analysis method provided by another exemplary embodiment of the present disclosure.

[0026] Figure 4 It is a schematic diagram of using an ambiguity elimination model to determine confidence information and obtain the optimal result, provided by an exemplary embodiment of the present disclosure.

[0027] Figure 5 It is a flowchart of a semantic analysis method provided by yet another exemplary embodiment of the present disclosure.

[0028] Figure 6 It is a flowchart of a semantic analysis method provided by yet another exemplary embodiment of the present disclosure.

[0029] Figure 7 It is a structural diagram of a semantic analysis device provided by an exemplary embodiment of the present disclosure.

[0030] Figure 8 It is a structural diagram of a semantic analysis device provided by another exemplary embodiment of the present disclosure.

[0031] Fig. 9 is a structural diagram of an electronic device provided by an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION

[0032] Below, the exemplary embodiments according to the present disclosure will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all the embodiments of the present disclosure, and it should be understood that the present disclosure is not limited to the exemplary embodiments described here.

[0033] It should be noted that the relative arrangement of components and steps, the numerical expressions and numerical values ​​set forth in these embodiments do not limit the scope of the present disclosure unless specifically stated otherwise.

[0034] Those skilled in the art can understand that the terms "first" and "second" in the embodiments of the present disclosure are only used to distinguish different steps, devices or modules, etc., and neither represent any specific technical meaning nor indicate the necessary logical order between them.

[0035] It should also be understood that in the embodiments of the present disclosure, “plurality” may refer to two or more than two, and “at least one” may refer to one, two, or more than two.

[0036] It should also be understood that any component, data or structure mentioned in the embodiments of the present disclosure can generally be understood as one or more, unless explicitly limited or otherwise indicated in the context.

[0037] In addition, the term "and / or" in the present disclosure is only a description of the association relationship of associated objects, indicating that three relationships may exist. 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 the present disclosure generally indicates that the associated objects before and after are in an "or" relationship.

[0038] It should also be understood that the description of the various embodiments in the present disclosure focuses on the differences between the various embodiments, and the same or similar aspects thereof can be referenced to each other, and for the sake of brevity, they will not be described one by one.

[0039] At the same time, it should be understood that for the convenience of description, the sizes of the various parts shown in the drawings are not drawn according to the actual proportional relationship.

[0040] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the present disclosure, its application, or uses.

[0041] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered as part of the specification.

[0042] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.

[0043] The disclosed embodiments can be applied to electronic devices such as terminal devices, computer systems, servers, etc., which can operate with many other general or special computing system environments or configurations. Examples of well-known terminal devices, computing systems, environments and / or configurations suitable for use with electronic devices such as terminal devices, computer systems, servers, etc. include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, handheld or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, network personal computers, small computer systems, large computer systems, and distributed cloud computing technology environments including any of the above systems, etc.

[0044] Electronic devices such as terminal devices, computer systems, servers, etc. can be described in the general context of computer system executable instructions (such as program modules) executed by computer systems. Generally, program modules can include routines, programs, object programs, components, logic, data structures, etc., which perform specific tasks or implement specific abstract data types. Computer systems / servers can be implemented in a distributed cloud computing environment, where tasks are performed by remote processing devices linked through a communication network. In a distributed cloud computing environment, program modules can be located on local or remote computing system storage media including storage devices.

[0045] Application Overview

[0046] Since the user's query is more colloquial, the following problems may occur when parsing the query:

[0047] 1. The query statement is ambiguous:

[0048] For example, in spoken interactions, users' conversations are generally brief. For example, when a user asks about a house that costs 300,000 yuan, this sentence alone is very ambiguous. 300,000 yuan may refer to the total price of the house, or it may refer to one's own budget, or it may be the down payment for the house. The ambiguity is quite serious.

[0049] 2. Affected by region:

[0050] For example, when users search for taxes and down payments, the calculation of down payments and taxes in different regions is different due to the differences in local policies. If a user asks about a house worth 100,000 yuan in Beijing, it is more likely to be the unit price, but in a small county town it is more likely to be the down payment or budget.

[0051] 3. Ambiguity of geographical location:

[0052] For example, if a user searches for "I want a big house in xxx", this xxx may refer to a subway station or a business district. The different parsed intent will lead to very different decisions on the subsequent intelligent services provided.

[0053] Due to the above problems, the currently disclosed semantic parsing solutions need to be improved and optimized.

[0054] Exemplary Systems

[0055] Figure 1 An exemplary system architecture 100 is shown to which the semantic analysis method or semantic analysis device according to the embodiments of the present disclosure can be applied.

[0056] like Figure 1 As shown, the system architecture 100 may include a terminal device 101, a network 102 and a server 103. The network 102 is used to provide a medium for a communication link between the terminal device 101 and the server 103. The network 102 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0057] The user can use the terminal device 101 to interact with the server 103 through the network 102 to receive or send messages, etc. Various communication client applications can be installed on the terminal device 101, such as shopping applications, house transaction applications, search applications, web browser applications, instant messaging tools, etc.

[0058] The terminal device 101 can be various electronic devices, including but not limited to mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals, etc., and fixed terminals such as digital TVs, desktop computers, etc.

[0059] The server 103 may be a server that provides various services, such as a background statement analysis server that analyzes the query statement uploaded by the terminal device 101. The background statement analysis server may process the received query statement to obtain a processing result (such as intent slot information).

[0060] It should be noted that the semantic analysis method provided in the embodiments of the present disclosure can be executed by the server 103 or by the terminal device 101. Accordingly, the semantic analysis device can be set in the server 103 or in the terminal device 101.

[0061] It should be understood that Figure 1The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided as required. In the case where the query statement does not need to be obtained remotely, the above system architecture may not include a network, but only include a server or a terminal device.

[0062] Exemplary Methods

[0063] Figure 2 is a flowchart of a semantic analysis method provided by an exemplary embodiment of the present disclosure. This embodiment can be applied to electronic devices (such as Figure 1 On the terminal device 101 or server 103 shown in FIG. Figure 2 As shown, the method comprises the following steps:

[0064] Step 201: Obtain a query statement input by a user.

[0065] In this embodiment, the electronic device can obtain the query sentence input by the user locally or remotely. For example, when the electronic device is a terminal device, the query sentence (query) input by the user can be obtained locally; when the electronic device is a server, the query sentence input by the user can be obtained from the terminal device. The query sentence can be a text sentence directly input by the user, or a sentence after the voice input by the user is converted into text.

[0066] Step 202: Match the query statement with statements in a preset statement library.

[0067] In this embodiment, the electronic device can match the query statement with the statements in the preset statement library. The preset statement library is pre-set and includes a large number of statements. Usually, the statements in the preset statement library are standardized statements with specific meanings. For example, the query statement is "I want to buy a subway house near xxx, the ideal price is within 600", if there is a standardized statement "Ask xxx 5.5 million to 6.5 million houses" in the statement library, then the two match.

[0068] Generally, when performing sentence matching, the query sentence can be first segmented to obtain a word sequence. For example, the segmentation result for the above example can be: "I want to buy a house near the subway near xxx, and the ideal price is within 600. The electronic device can use the segmentation result to match the query sentence with the sentences in the preset sentence library according to various methods. For example, the query sentence can be compared with the sentences in the preset sentence library one by one by using existing neural network models, topic models and other methods. If the similarity between the query sentence and a certain sentence is greater than a preset similarity threshold, it is determined that the two are matched.

[0069] Step 203: Determine whether there is a sentence matching the query sentence in the preset sentence library.

[0070] In this embodiment, the electronic device can determine whether there is a sentence matching the query sentence in the preset sentence library. If not, step 204 to step 207 are executed.

[0071] Step 204, input the query statement into the intent slot recognition model to obtain a preset number of intent slot information.

[0072] In this embodiment, the electronic device can input the query statement into the intent slot recognition model to obtain a preset number of intent slot information. The intent slot information may include user intent information and slot information. The user intent information is used to characterize the main intent of the user's query, such as: the demand for buying a house, the demand for renting a house, etc. The slot information is used to characterize the relevant entity information included in the user's query statement. For example: geographical location, apartment type, area, room, price, down payment, budget, etc.

[0073] The intent slot recognition model can output multiple intent slot information, and the electronic device can select a preset number (for example, 5) of intent slot information from the multiple intent slot information. As an example, the query statement is "Which floor is the owner's house on? It is best if it is below the 10th floor. We can pay a maximum of 2.63 million yuan." The following 5 intent slot information can be output:

[0074] 1) Intent: House information; Slot: [Floor: 10-], [Total price: 2.63 million];

[0075] 2) Intent: House information; Slot: [Floor: 10-], [Down payment: 2.63 million];

[0076] 3) Intent: House information; Slot: [Floor: 10-], [Budget: 2.63 million];

[0077] 4) Intent: Owner information; Slot: [Floor: 10], [Total price: 2.63 million];

[0078] 5) Intent: Owner information; Slot: [Floor: 10-], [Down payment: 2.63 million].

[0079] Among them, 10- means less than 10.

[0080] The intent slot recognition model is used to characterize the correspondence between sentences and intent slot information. The intent slot recognition model can be implemented based on various algorithms, such as rule-based algorithms, traditional machine learning algorithms, deep learning algorithms, etc. Optionally, a bidirectional GRU+CRF can be used as a joint model of intent and slot. Compared with other types of models, this model can not only effectively utilize bidirectional context information through bidirectional gated recurrent units, but also consider the correlation between adjacent labels through conditional random fields to obtain the global optimal prediction result. Therefore, its prediction accuracy and recall rate are higher. Usually, the intent slot recognition model receives the word vector of each word in the query sentence. Therefore, it is necessary to first embed the query sentence to obtain the word vector of each word in the query sentence, and then process the word vector to obtain the intent slot information.

[0081] The intent slot recognition model can be trained by machine learning methods. Usually, the electronic device can use a large number of sample sentences as the input of the initial model, and use the labeled intent information and labeled slot information corresponding to the input sample sentences as the expected output, repeatedly train the initial model, and when the preset end training conditions are met (for example, the training time exceeds the preset time, the number of training times exceeds the preset number of times, the loss value of the loss function converges, etc.), the training is terminated to obtain the intent slot recognition model.

[0082] Step 205: Obtain relevant information of the query statement.

[0083] In this embodiment, the electronic device can obtain the associated information of the query statement. The associated information is used to represent the information related to the question asked by the user. The electronic device can obtain the associated information corresponding to the above query statement from the associated information set set locally or remotely. The associated information in the associated information set is used to represent the information of different dimensions related to the query statement. The electronic device can determine the associated information of the query statement from the associated information set based on the relevant information of the user (such as the location of the user, the age of the user, etc.).

[0084] As an example, when a user asks questions about real estate, the associated information set can be used to represent different types of users, different administrative districts, different business districts, housing price ranges in each administrative district, tax ranges, etc. For another example, when a user asks questions about medical care, the associated information set can be used to represent different types of patients, different administrative districts, different hospitals, medical levels in each administrative district, hospitalization cost ranges in each hospital, patient visit number ranges, etc.

[0085] Step 206, input the query statement, related information and a preset number of intent slot information into a pre-trained disambiguation model to obtain confidence information corresponding to the intent slot information in the preset number of intent slot information.

[0086] In this embodiment, the electronic device can input the inquiry statement, associated information and a preset number of intent slot information into a pre-trained disambiguation model to obtain the confidence information corresponding to the intent slot information in the preset number of intent slot information. Among them, the disambiguation model is used to determine the confidence information corresponding to each intent slot information in the preset number of intent slot information based on the associated information. The confidence information is used to characterize the accuracy of the intent slot information in reflecting the user's true intention, thereby achieving the goal of eliminating the ambiguity of the spoken inquiry statement. As an example, the confidence information can be a score value, and the higher the score value, the more accurate the intent slot information is in reflecting the user's true intention.

[0087] The electronic device can adopt a machine learning method to train an initial model of a preset structure to obtain an ambiguity elimination model. As an example, the initial model may include but is not limited to at least one of the following models: XGBoost model, gbm model, GBDT model, etc. The ambiguity elimination model determines the confidence information of each intent slot information in a preset number of intent slot information according to the associated information. When training the initial model, a training sample set can be obtained, and the sample sentences, sample associated information and multiple sample intent slot information included in the training sample are used as the input of the initial model, and the confidence information annotated for each sample intent slot information is used as the expected output to train the ambiguity elimination model. Generally, when the ambiguity elimination model determines the confidence information of the intent slot information, the information it processes is a vector. Therefore, the ambiguity elimination model can first embed the query sentence to obtain the word vector of each word in the query sentence, and then process the word vector and the vector representing the associated information to obtain the confidence information corresponding to the intent slot information.

[0088] Step 207: based on the confidence information, extract the target intent slot information representing the intent of the user's inquiry from a preset number of intent slot information.

[0089] In this embodiment, the electronic device can extract the target intent slot information representing the intention of the user's inquiry from a preset number of intent slot information based on the confidence information. Usually, the intent slot information corresponding to the confidence information with the largest value can be used as the target intent slot information. The target intent slot information can accurately represent the main content of the user's inquiry, that is, it can accurately reflect the true intention of the user's inquiry. As an example, the target intent slot information can be: "Intent: House information; Slot: [Floor: 10-], [Down payment: 2.63 million]".

[0090] In some optional implementations, after step 207, the electronic device may also generate semantic information of the inquiry statement based on the target intent slot information and the associated information and output the semantic information. The semantic information may be output in various ways, such as being displayed on a display, or being sent to other devices, etc. Among them, the semantic information is used to characterize the true semantics of the inquiry statement. As an example, the associated information may include classification information of the inquiry statement, and the classification information may include sentiment classification information, sentence classification information, etc. The semantic information may be: "Intent: housing information; slot: [Floor: 10-], [Down payment: 2.63 million]; sentiment: neutral; sentence pattern: declarative sentence". This implementation method can more accurately represent the inquiry statement by generating semantic information, which helps to provide a reference for service providers and improve the accuracy of the question-and-answer system.

[0091] In some optional implementations, such as Figure 3 As shown, after step 203, step 208 may also be included:

[0092] In response to determining that there is a sentence matching the query sentence in the preset sentence library, output semantic information corresponding to the matching sentence. Among them, the semantic information corresponding to the matching sentence can be pre-generated. For example, the query sentence is "I want to buy a subway house near xxx, and the ideal price is within 600", and the sentence matching it is "Ask about xxx 5.5 million to 6.5 million houses", then the corresponding semantic information can be "Intention: housing demand; Slot: [Subway Station: xxx], [Total Price: 6 million]; Emotion: Neutral; Sentence Pattern: Declarative Sentence". This implementation method directly outputs semantic information when there is a sentence matching the query sentence in the preset sentence library, which can improve the efficiency of sentence analysis.

[0093] In some optional implementations, the associated information includes at least one of the following: user portrait information of the user, basic regional information of the region related to the user (e.g., the region where the user is located, the region where the user inquired, etc.), and classification information of the inquiry statement. The user portrait information is used to characterize the characteristics of the user, such as the user's age, gender, habits, etc. The user portrait information is usually generated in advance based on the user's personal information, historical records, and other information.

[0094] The regional basic information is used to characterize the basic characteristics of the area related to the user. For example, when the user asks about housing prices, the regional basic information can characterize the distribution of housing prices in the area inquired by the user, the distribution of policy fees (such as taxes, agency fees, etc.). Regional basic information is usually represented by a vector, and the data in the vector can represent various fee ranges. For example, the vector includes (4500000, 6000000), which represents the distribution range of housing prices in the area inquired by the user.

[0095] The classification information is obtained based on a pre-trained classification model. The classification model is used to characterize the correspondence between the user's query statement and the category information. The classification model can be obtained by training the initial model based on a large number of preset sample sentences and corresponding annotated category information. The initial model may include but is not limited to convolutional neural networks (CNN), long short-term memory networks (LSTM), support vector machines (SVM), fasttext, etc. The number of classification models can be one or more, that is, the query statements are classified in different dimensions.

[0096] In some optional implementations, the classification information may include at least one of the following: sentiment classification information, sentence classification information, and sentence label information. The sentiment classification information is obtained based on a pre-trained sentiment analysis model, the sentence classification information is obtained based on a pre-trained sentence analysis model, and the sentence label information is obtained based on a pre-trained label extraction model.

[0097] The sentiment classification model is used to characterize the correspondence between the query sentence and the sentiment classification information. The electronic device can take the preset sample sentence as input, and take the labeled sentiment classification information (such as positive, negative, neutral, etc.) corresponding to the input sample sentence as the expected output, which is obtained by training using a machine learning method.

[0098] The sentence analysis model is used to characterize the correspondence between the query sentence and the sentence classification information. The electronic device can use a preset sample sentence as input, and use the annotated sentence classification information (such as a declarative sentence, a question sentence, etc.) corresponding to the input sample sentence as the expected output, which is obtained by training using a machine learning method.

[0099] The sentence label information is used to characterize the correspondence between the query sentence and the sentence label information. The electronic device can use the preset sample sentence as input, and use the label information of the annotated sentence corresponding to the input sample sentence (such as large three-bedroom, small two-bedroom, suitable for the elderly, etc.) as the expected output, and obtain it through training using a machine learning method. The label information is combined with the above-mentioned slot information to more accurately analyze the query sentence and more accurately obtain the user's true intention.

[0100] The above models can be obtained based on initial model training of various structures. As an example, sentiment classification information can be trained based on the fasttext model, sentence classification information can be trained based on the LSTM model, and sentence label information can be trained based on the multi-classification model transformer.

[0101] This implementation method classifies query statements by using multiple classification models to obtain classification information of multiple dimensions, which is combined with other related information and intent slot information to eliminate ambiguity, so that the query statements can be analyzed more accurately and the accuracy of determining the user's true intention can be improved.

[0102] Continue to refer Figure 4 , which shows a schematic diagram of determining the confidence information of a preset number of intent slot information based on the query sentence, associated information and a preset number of intent slot information, and taking the optimal result by using an ambiguity elimination model (XGBoost is used in the figure). Among them, the associated information includes the user portrait information, regional basic information and classification information shown in the figure, and the classification information includes sentiment classification information, sentence classification information, and sentence label information. These information are input into XGBoost, and XGBoost determines the confidence information of the preset number of intent slot information, and outputs the intent slot information corresponding to the confidence information with the largest value as the optimal result.

[0103] The method provided by the above-mentioned embodiment of the present disclosure obtains a preset number of intent slot information by using the intent slot recognition model when there is no sentence matching the query sentence in the preset sentence library, and then uses the associated information of the query sentence and the disambiguation model to determine the confidence information of each intent slot information, and extracts the target intent slot information representing the intention of the user's query based on the confidence information, so that the extracted target intent slot information can reflect the true intention of the user's query, effectively eliminate the ambiguity caused by the spoken query sentence, help improve the accuracy of the question-and-answer system's automatic reply to the user's question, and enable the service provider to accurately obtain the true intention of the user's query.

[0104] Further references Figure 5 , shows a flow chart of another embodiment of the semantic analysis method. Figure 5 As shown in the above Figure 2 Based on the illustrated embodiment, step 204 may include the following steps:

[0105] Step 2041, input the query statement into the intent slot recognition model to obtain the intent slot information set.

[0106] In this embodiment, the electronic device can input the query statement into the intent slot recognition model to obtain the intent slot information set. Among them, the intent slot information in the intent slot information set corresponds to a score that characterizes the accuracy of the intent slot information. As an example, the output intent slot information set may include N intent slot information, each intent slot information corresponds to a score, and the higher the score, the higher the accuracy of the corresponding intent slot information.

[0107] Step 2042: extract a preset number of intent slot information from the intent slot information set based on the size of the score.

[0108] In this embodiment, the electronic device can extract a preset number of intent slot information from the intent slot information set based on the size of the score. Usually, a preset number of intent slot information with the highest score (eg, top5) can be extracted.

[0109] Above Figure 5 The method provided in the corresponding embodiment extracts a preset number of intent slot information from the intent slot information set based on the size of the score, so that the extracted preset number of intent slot information can more accurately represent the user's intention, which helps to more accurately extract the target intent slot information in subsequent analysis and improve the accuracy of sentence analysis.

[0110] Further references Figure 6 , shows a flow chart of another embodiment of the semantic analysis method. Figure 6 As shown in the above Figure 2 Based on the illustrated embodiment, step 202 may include the following steps:

[0111] Step 2021, determine the sentence vector of the query statement.

[0112] In this embodiment, the electronic device can determine the sentence vector of the query sentence. Specifically, the query sentence can be first segmented to obtain a word sequence, and then the words can be encoded to obtain a word vector for each word, and then the sentence vector of the query sentence can be generated using a pre-trained sentence vector model (such as bert, word2vec, ELMo, etc.).

[0113] Step 2022, determining the similarity between the sentence vector of the query statement and the sentence vector corresponding to the statement in the preset statement library.

[0114] In this embodiment, the electronic device can determine the similarity between the sentence vector of the query statement and the sentence vector corresponding to the sentence in the preset sentence library. Among them, the sentences in the preset sentence library are standardized sentences, and each sentence corresponds to a pre-generated sentence vector. The electronic device can determine the similarity between the sentence vector of the query statement and each sentence in the preset sentence library based on the existing method for determining the similarity between vectors (for example, a method for determining the similarity based on a predetermined distance, Euclidean distance, etc.), and the similarity is used to characterize the degree of similarity between sentences. The higher the similarity, the more similar the contents of the sentences.

[0115] Step 2023: For each of the determined similarities, in response to determining that the similarity is greater than or equal to a preset similarity threshold, determine that the sentence corresponding to the similarity matches the query sentence.

[0116] In this embodiment, for each of the determined similarities, the electronic device may cyclically perform the following steps: in response to determining that the similarity is greater than or equal to a preset similarity threshold, determining that the sentence corresponding to the similarity matches the query sentence. In particular, if there are multiple similarities greater than or equal to the preset similarity threshold, the sentence corresponding to the maximum value may be taken as the sentence matching the query sentence.

[0117] Correspondingly, if each determined similarity is less than a preset similarity threshold, it is determined that there is no statement matching the query statement in the preset statement library.

[0118] Above Figure 6 The method provided in the corresponding embodiment determines the sentence vector of the query sentence, and then calculates the similarity between the sentence vector and the predetermined sentence vector of each sentence in the preset sentence library, so that the similarity between the vectors can be directly determined, thereby improving the efficiency of sentence matching.

[0119] Exemplary Devices

[0120] Figure 7 is a schematic diagram of the structure of a semantic analysis device provided by an exemplary embodiment of the present disclosure. This embodiment can be applied to electronic devices, such as Figure 7 As shown, the semantic analysis device includes: a first acquisition module 701, which is used to acquire a query statement input by a user; a matching module 702, which is used to match the query statement with statements in a preset statement library; a determination module 703, which is used to determine whether there is a statement matching the query statement in the preset statement library; an identification module 704, which is used to input the query statement into an intention slot recognition model if there is no statement matching the query statement, and obtain a preset number of intention slot information; a second acquisition module 705, which is used to acquire associated information of the query statement; an ambiguity elimination module 706, which is used to input the query statement, associated information and a preset number of intention slot information into a pre-trained ambiguity elimination model, and obtain confidence information corresponding to the intention slot information in the preset number of intention slot information; an extraction module 707, which is used to extract target intention slot information representing the intention of the user's query from the preset number of intention slot information based on the confidence information.

[0121] In this embodiment, the first acquisition module 701 can obtain the query sentence input by the user locally or remotely. For example, when the semantic analysis device is set on the terminal device, the query sentence (query) input by the user can be obtained locally; when the semantic analysis device is set on the server, the query sentence input by the user can be obtained from the terminal device. The query sentence can be a text sentence directly input by the user, or a sentence after the voice input by the user is converted into text.

[0122] In this embodiment, the matching module 702 can match the query statement with the statements in the preset statement library. The preset statement library is preset and includes a large number of statements. Usually, the statements in the preset statement library are standardized statements with specific meanings. For example, the query statement is "I want to buy a subway house near xxx, the ideal price is within 600", if there is a standardized statement "Ask xxx 5.5 million to 6.5 million houses" in the statement library, then the two match.

[0123] Generally, when performing sentence matching, the query sentence may be first segmented to obtain a word sequence. For example, the segmentation result for the above example may be: "I want to buy a house near the subway near xxx, with an ideal price of less than 600 yuan. The matching module 702 may use the segmentation result to match the query sentence with the sentences in the preset sentence library in various ways. For example, the query sentence may be compared with the sentences in the preset sentence library one by one using existing neural network models, topic models, and other methods. If the similarity between the query sentence and a certain sentence is greater than a preset similarity threshold, it is determined that the two are matched.

[0124] In this embodiment, the determination module 703 may determine whether there is a sentence matching the query sentence in the preset sentence library.

[0125] In this embodiment, if there is no sentence matching the query sentence, the recognition module 704 can input the query sentence into the intent slot recognition model to obtain a preset number of intent slot information. The intent slot information may include user intent information and slot information. The user intent information is used to characterize the main intent of the user's inquiry, such as: the demand for buying a house, the demand for renting a house, etc. The slot information is used to characterize the relevant entity information included in the user's query sentence. For example: geographical location, apartment type, area, room, price, down payment, budget, etc.

[0126] The intent slot recognition model can output multiple intent slot information, and the recognition module 704 can select a preset number (e.g., 5) of intent slot information from the multiple intent slot information. As an example, the query statement is "Which floor is the owner's house on? It is best if it is below the 10th floor. We can pay a maximum of 2.63 million yuan." The following 5 intent slot information can be output:

[0127] 1) Intent: House information; Slot: [Floor: 10-], [Total price: 2.63 million];

[0128] 2) Intent: House information; Slot: [Floor: 10-], [Down payment: 2.63 million];

[0129] 3) Intent: House information; Slot: [Floor: 10-], [Budget: 2.63 million];

[0130] 4) Intent: Owner information; Slot: [Floor: 10], [Total price: 2.63 million];

[0131] 5) Intent: Owner information; Slot: [Floor: 10-], [Down payment: 2.63 million].

[0132] Among them, 10- means less than 10.

[0133] The intent slot recognition model is used to characterize the correspondence between sentences and intent slot information. The intent slot recognition model can be implemented based on various algorithms, such as rule-based algorithms, traditional machine learning algorithms, deep learning algorithms, etc. Optionally, a bidirectional GRU+CRF can be used as a joint model of intent and slot. Usually, the intent slot recognition model receives the word vector of each word in the query sentence. Therefore, it is necessary to first embed the query sentence to obtain the word vector of each word in the query sentence, and then process the word vector to obtain the intent slot information.

[0134] The intent slot recognition model can be trained by machine learning methods. Usually, the electronic device can use a large number of sample sentences as the input of the initial model, and use the labeled intent information and labeled slot information corresponding to the input sample sentences as the expected output, repeatedly train the initial model, and when the preset end training conditions are met (for example, the training time exceeds the preset time, the number of training times exceeds the preset number of times, the loss value of the loss function converges, etc.), the training is terminated to obtain the intent slot recognition model.

[0135] In this embodiment, the second acquisition module 705 can obtain the associated information of the query statement. The associated information is used to represent the information related to the question asked by the user. The second acquisition module 705 can obtain the associated information corresponding to the above query statement from the associated information set set locally or remotely. The associated information in the associated information set is used to represent the information of different dimensions related to the query statement. The second acquisition module 705 can determine the associated information of the query statement from the associated information set based on the relevant information of the user (such as the location of the user, the age of the user, etc.).

[0136] As an example, when a user asks questions about real estate, the associated information set can be used to represent different types of users, different administrative districts, different business districts, housing price ranges in each administrative district, tax ranges, etc. For another example, when a user asks questions about medical care, the associated information set can be used to represent different types of patients, different administrative districts, different hospitals, medical levels in each administrative district, hospitalization cost ranges in each hospital, patient visit number ranges, etc.

[0137] In this embodiment, the disambiguation module 706 can input the inquiry statement, associated information and a preset number of intent slot information into a pre-trained disambiguation model to obtain the confidence information corresponding to the intent slot information in the preset number of intent slot information. Among them, the disambiguation model is used to determine the confidence information corresponding to each intent slot information in the preset number of intent slot information based on the associated information. The confidence information is used to characterize the accuracy of the intent slot information in reflecting the user's true intention, thereby achieving the goal of eliminating the ambiguity problem of spoken inquiry statements.

[0138] The electronic device can adopt a machine learning method to train an initial model of a preset structure to obtain an ambiguity elimination model. As an example, the initial model may include but is not limited to at least one of the following models: XGBoost model, gbm model, GBDT model, etc. The ambiguity elimination model determines the confidence information of each intent slot information in a preset number of intent slot information based on the association information. When training the initial model, a training sample set can be obtained, and the sample sentences, sample association information and multiple sample intent slot information included in the training sample are used as the input of the initial model, and the confidence information annotated for each sample intent slot information is used as the expected output to train the ambiguity elimination model. Usually, the ambiguity elimination model receives a vector, so it is necessary to first embed the query sentence to obtain the word vector of each word in the query sentence, and then process the word vector and the vector representing the management information to obtain the confidence information corresponding to the intent slot information.

[0139] In this embodiment, the extraction module 707 can extract the target intent slot information representing the intention of the user's inquiry from a preset number of intent slot information based on the confidence information. Generally, the intent slot information with the highest confidence information can be used as the target intent slot information. The target intent slot information can accurately represent the main content of the user's inquiry, that is, it can accurately reflect the true intention of the user's inquiry. As an example, the target intent slot information can be: "Intent: House information; Slot: [Floor: 10-], [Down payment: 2.63 million]".

[0140] Reference Figure 8 , Figure 8 It is a structural diagram of a semantic analysis device provided by another exemplary embodiment of the present disclosure.

[0141] In some optional implementations, the associated information includes at least one of the following: user portrait information of the user, basic regional information of the area related to the user, and classification information of the query statement, wherein the classification information is obtained based on a pre-trained classification model.

[0142] In some optional implementations, the classification information includes at least one of the following: sentiment classification information, sentence classification information, and sentence label information, wherein the sentiment classification information is obtained based on a pre-trained sentiment analysis model, the sentence classification information is obtained based on a pre-trained sentence analysis model, and the sentence label information is obtained based on a pre-trained label extraction model.

[0143] In some optional implementations, the device further includes: a generation module 708, which is used to generate semantic information of the query statement based on the target intention slot information and the associated information and output the semantic information.

[0144] In some optional implementations, the identification module 704 includes: an identification unit 7041, used to input the query statement into the intent slot recognition model to obtain an intent slot information set, wherein the intent slot information in the intent slot information set corresponds to a score representing the accuracy of the intent slot information; an extraction unit 7042, used to extract a preset number of intent slot information from the intent slot information set based on the size of the score.

[0145] In some optional implementations, the matching module 702 includes: a first determination unit 7021, used to determine the sentence vector of the query statement; a second determination unit 7022, used to determine the similarity between the sentence vector of the query statement and the sentence vector corresponding to the statement in the preset sentence library; a third determination unit 7023, used to, for each of the determined similarities, in response to determining that the similarity is greater than or equal to a preset similarity threshold, determine that the statement corresponding to the similarity matches the query statement.

[0146] In some optional implementations, the device further includes: an output module 709, configured to output semantic information corresponding to the matching statement in response to determining that there is a statement matching the query statement in the preset statement library.

[0147] The semantic analysis device provided by the above-mentioned embodiment of the present disclosure obtains a preset number of intent slot information by using the intent slot recognition model when there is no sentence matching the query sentence in the preset sentence library, and then uses the associated information of the query sentence and the disambiguation model to determine the confidence information of each intent slot information, and extracts the target intent slot information representing the intention of the user's query based on the confidence information, so that the extracted target intent slot information can reflect the true intention of the user's query, effectively eliminate the ambiguity caused by the spoken query sentence, help improve the accuracy of the question-and-answer system's automatic reply to the user's question, and enable the service provider to accurately obtain the true intention of the user's query.

[0148] Exemplary Electronic Devices

[0149] Below, reference Fig. 9 To describe an electronic device according to an embodiment of the present disclosure. The electronic device may be as follows Figure 1 Any one or both of the terminal device 101 and the server 103 shown, or a stand-alone device independent of them, the stand-alone device can communicate with the terminal device 101 and the server 103 to receive the collected input signals from them.

[0150] Fig. 9 A block diagram of an electronic device according to an embodiment of the present disclosure is illustrated.

[0151] like Fig. 9 As shown, the electronic device 900 includes one or more processors 901 and a memory 902 .

[0152] The processor 901 may be a central processing unit (CPU) or other forms of processing units having data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device 900 to perform desired functions.

[0153] The memory 902 may include one or more computer program products, and the computer program product may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and / or cache memory (cache), etc. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on a computer-readable storage medium, and the processor 901 may run the program instructions to implement the semantic analysis method of each embodiment of the present disclosure above and / or other desired functions. Various contents such as query statements, preset statement libraries, etc. may also be stored in the computer-readable storage medium.

[0154] In one example, the electronic device 900 may further include: an input device 903 and an output device 904 , and these components are interconnected via a bus system and / or other forms of connection mechanisms (not shown).

[0155] For example, when the electronic device is a terminal device 101 or a server 103, the input device 903 may be a device such as a mouse, a keyboard, a microphone, etc., for inputting a query statement. When the electronic device is a stand-alone device, the input device 903 may be a communication network connector for receiving the input query statement from the terminal device 101 and the server 103.

[0156] The output device 904 can output various information to the outside, including target intention slot information. The output device 904 can include, for example, a display, a speaker, a printer, a communication network and a remote output device connected thereto, and the like.

[0157] Of course, to simplify, Fig. 9 Only some of the components related to the present disclosure in the electronic device 900 are shown, and components such as a bus, an input / output interface, etc. are omitted. In addition, according to specific application situations, the electronic device 900 may also include any other appropriate components.

[0158] Exemplary computer program products and computer-readable storage media

[0159] In addition to the above-mentioned methods and devices, an embodiment of the present disclosure may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps of the semantic analysis method according to various embodiments of the present disclosure described in the above-mentioned "Exemplary Method" section of this specification.

[0160] The computer program product may be written in any combination of one or more programming languages ​​to write program code for performing the operations of the disclosed embodiments, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0161] In addition, an embodiment of the present disclosure may also be a computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, enable the processor to execute the steps of the semantic analysis method according to various embodiments of the present disclosure described in the above “Exemplary Method” section of this specification.

[0162] The computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable 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 above.

[0163] The basic principles of the present disclosure are described above in conjunction with specific embodiments. However, it should be noted that the advantages, strengths, effects, etc. mentioned in the present disclosure are only examples and not limitations, and it cannot be considered that these advantages, strengths, effects, etc. are required by each embodiment of the present disclosure. In addition, the specific details disclosed above are only for the purpose of illustration and ease of understanding, and are not limitations. The above details do not limit the present disclosure to the necessity of adopting the above specific details to be implemented.

[0164] Each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the system embodiment, since it basically corresponds to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0165] The block diagrams of the devices, apparatuses, equipment, and systems involved in this disclosure are only illustrative examples and are not intended to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagrams. As will be appreciated by those skilled in the art, these devices, apparatuses, equipment, and systems can be connected, arranged, and configured in any manner. Words such as "including," "comprising," "having," and the like are open words, referring to "including but not limited to," and can be used interchangeably therewith. The words "or" and "and" used herein refer to the words "and / or," and can be used interchangeably therewith, unless the context clearly indicates otherwise. The word "such as" used herein refers to the phrase "such as but not limited to," and can be used interchangeably therewith.

[0166] The method and apparatus of the present disclosure may be implemented in many ways. For example, the method and apparatus of the present disclosure may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above order of steps for the method is for illustration only, and the steps of the method of the present disclosure are not limited to the order specifically described above, unless otherwise specifically stated. In addition, in some embodiments, the present disclosure may also be implemented as a program recorded in a recording medium, which includes machine-readable instructions for implementing the method according to the present disclosure. Therefore, the present disclosure also covers a recording medium storing a program for executing the method according to the present disclosure.

[0167] It should also be noted that in the apparatus, device and method of the present disclosure, each component or each step can be decomposed and / or recombined. Such decomposition and / or recombination should be regarded as equivalent solutions of the present disclosure.

[0168] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the aspects shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

[0169] The above description has been given for the purpose of illustration and description. In addition, this description is not intended to limit the embodiments of the present disclosure to the forms disclosed herein. Although multiple example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, changes, additions and sub-combinations thereof.

Claims

1. A semantic analysis method, comprising: Get the query statement entered by the user; Matching the query statement with statements in a preset statement library; Determining whether there is a statement matching the query statement in the preset statement library; If it does not exist, perform the following steps: Input the query statement into the intent slot recognition model to obtain a preset number of intent slot information; wherein the intent slot information includes user intent information and slot information, and the slot information is used to represent the entity information included in the user query statement; The query statement is input into the intent slot recognition model to obtain an intent slot information set, wherein the intent slot information in the intent slot information set corresponds to a score representing the accuracy of the intent slot information; based on the size of the score, a preset number of intent slot information is extracted from the intent slot information set; Acquire the associated information of the query statement; Input the query statement, the associated information and the preset number of intent slot information into a pre-trained disambiguation model to obtain confidence information corresponding to the intent slot information in the preset number of intent slot information; the confidence information is used to characterize the accuracy of the intent slot information in reflecting the user's true intention; Based on the confidence information, extracting target intent slot information representing the intent of the user's query from the preset number of intent slot information; Based on the target intent slot information and the associated information, semantic information of the query statement is generated and the semantic information is output.

2. The method according to claim 1, wherein: The associated information includes at least one of the following: user portrait information of the user, regional basic information of the area related to the user, and classification information of the query statement, wherein the classification information is obtained based on a pre-trained classification model.

3. The method according to claim 2, wherein: The classification information includes at least one of the following: sentiment classification information, sentence classification information, and sentence label information, wherein the sentiment classification information is obtained based on a pre-trained sentiment analysis model, the sentence classification information is obtained based on a pre-trained sentence analysis model, and the sentence label information is obtained based on a pre-trained label extraction model.

4. The method according to claim 1, wherein: The step of matching the query statement with statements in a preset statement library includes: Determining a sentence vector of the query sentence; Determine the similarity between the sentence vector of the query sentence and the sentence vector corresponding to the sentence in the preset sentence library; For each of the determined similarities, in response to determining that the similarity is greater than or equal to a preset similarity threshold, it is determined that a sentence corresponding to the similarity matches the query sentence.

5. The method according to any one of claims 1 to 4, wherein: After determining whether there is a statement matching the query statement in the preset statement library, the method further includes: In response to determining that there is a sentence matching the query sentence in the preset sentence library, outputting semantic information corresponding to the matching sentence.

6. A semantic analysis device, comprising: A first acquisition module, used to acquire a query sentence input by a user; A matching module, used for matching the query statement with statements in a preset statement library; A determination module, used to determine whether there is a statement matching the query statement in the preset statement library; an identification module, configured to input the query statement into an intent slot identification model to obtain a preset number of intent slot information if there is no statement matching the query statement; Among them, the recognition unit is used to input the query statement into the intention slot recognition model to obtain an intention slot information set, wherein the intention slot information in the intention slot information set corresponds to a score representing the accuracy of the intention slot information; the extraction unit is used to extract a preset number of intention slot information from the intention slot information set based on the size of the score; the intention slot information includes user intention information and slot information, and the slot information is used to represent the entity information included in the user query statement; A second acquisition module, used to acquire the associated information of the query statement; an ambiguity elimination module, configured to input the query statement, the associated information, and the preset number of intent slot information into a pre-trained ambiguity elimination model, and obtain confidence information corresponding to the intent slot information in the preset number of intent slot information; the confidence information is used to characterize the accuracy of the intent slot information in reflecting the true intention of the user; An extraction module, configured to extract target intent slot information representing the intent of the user's inquiry from the preset number of intent slot information based on the confidence information; A generation module is used to generate semantic information of the query statement based on the target intention slot information and the association information and output the semantic information.

7. The device according to claim 6, wherein: The associated information includes at least one of the following: user portrait information of the user, regional basic information of the area related to the user, and classification information of the query statement, wherein the classification information is obtained based on a pre-trained classification model.

8. The device according to claim 7, wherein: The classification information includes at least one of the following: sentiment classification information, sentence classification information, and sentence label information, wherein the sentiment classification information is obtained based on a pre-trained sentiment analysis model, the sentence classification information is obtained based on a pre-trained sentence analysis model, and the sentence label information is obtained based on a pre-trained label extraction model.

9. The device according to claim 6, wherein: The matching module comprises: A first determining unit, configured to determine a sentence vector of the query sentence; A second determining unit, configured to determine a similarity between a sentence vector of the query sentence and a sentence vector corresponding to a sentence in the preset sentence library; The third determining unit is configured to determine, for each of the determined similarities, in response to determining that the similarity is greater than or equal to a preset similarity threshold, that a sentence corresponding to the similarity matches the query sentence.

10. The device according to any one of claims 6 to 9, wherein: The device also includes: The output module is used for outputting semantic information corresponding to the matched sentence in response to determining that there is a sentence matching the query sentence in the preset sentence library.

11. A computer-readable storage medium storing a computer program, wherein the computer program is used to execute the method according to any one of claims 1 to 5.

12. An electronic device, comprising: processor; a memory for storing instructions executable by the processor; The processor is used to read the executable instructions from the memory and execute the instructions to implement the method described in any one of claims 1 to 5.