CN110688859A - Semantic analysis method, device, medium and electronic equipment based on machine learning - Google Patents

Semantic analysis method, device, medium and electronic equipment based on machine learning Download PDF

Info

Publication number
CN110688859A
CN110688859A CN201910879338.1A CN201910879338A CN110688859A CN 110688859 A CN110688859 A CN 110688859A CN 201910879338 A CN201910879338 A CN 201910879338A CN 110688859 A CN110688859 A CN 110688859A
Authority
CN
China
Prior art keywords
input information
processed
semantic
machine learning
template
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910879338.1A
Other languages
Chinese (zh)
Inventor
陈恺
房小颖
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201910879338.1A priority Critical patent/CN110688859A/en
Priority to PCT/CN2019/117680 priority patent/WO2021051565A1/en
Publication of CN110688859A publication Critical patent/CN110688859A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning

Abstract

The application relates to a semantic analysis method, a semantic analysis device, a semantic analysis medium and electronic equipment based on machine learning, which belong to the technical field of machine learning application, and the method comprises the following steps: when receiving input information to be processed, converting the input information to be processed into pre-input information; inputting the pre-input information into a pre-trained machine learning model to obtain a prediction semantic template corresponding to the input information to be processed; obtaining semantic template constraint information and a prediction semantic template, inputting the prediction semantic template constraint model, and outputting the constraint to predict the semantic template; converting the input information to be processed into pre-analysis data according to the constrained semantic template; and acquiring a semantic analysis result of the input information to be processed according to the pre-analysis data. According to the method and the device, the predicted semantic template is obtained by analyzing according to various input information based on the preset machine learning model, and then the accuracy and the efficiency of semantic analysis are effectively guaranteed.

Description

Semantic analysis method, device, medium and electronic equipment based on machine learning
Technical Field
The application relates to the technical field of machine learning application, in particular to a semantic analysis method, a semantic analysis device, a semantic analysis medium and electronic equipment based on machine learning.
Background
The semantic analysis is to analyze a semantic analysis result that the user wants to output to a certain object from a piece of information output by the user.
Currently, when performing semantic analysis, initial information output by different legal users is usually different for the same semantic analysis result, and the same user may have various expressions at different times. For example, when the air conditioner needs to be turned on, different users, even the same user, have many expression modes, and for the initial information analysis output by the user, there are a plurality of semantic analysis results analyzed, and the efficiency is difficult to guarantee. Therefore, the problems of low efficiency and low accuracy in analyzing the user semantics by adopting a fixed analysis method exist in the prior art.
It is to be noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the present application and therefore may include information that does not constitute prior art known to a person of ordinary skill in the art.
Disclosure of Invention
The purpose of the application is to provide a semantic parsing scheme based on machine learning, and then at least to a certain extent based on a preset machine learning model, and according to various input information, a semantic template is obtained through parsing, and then the accuracy and efficiency of semantic parsing are effectively guaranteed.
According to an aspect of the present application, there is provided a semantic parsing method based on machine learning, including:
when receiving input information to be processed, converting the input information to be processed into pre-input information;
inputting the pre-input information into a pre-trained machine learning model to obtain a prediction semantic template corresponding to the input information to be processed;
acquiring semantic template constraint information when input information to be processed is received, inputting a prediction semantic template constraint model together with a prediction semantic template, outputting the constrained prediction semantic template, wherein the semantic template constraint information is real-time environment information related to the input information;
converting the input information to be processed into pre-analysis data according to the constrained semantic template;
and acquiring a semantic analysis result of the input information to be processed according to the pre-analysis data.
In an exemplary embodiment of the present application, when the input information to be processed is in a text form, when the input information to be processed is received, converting the input information to be processed into pre-input information, including:
searching a word vector dictionary according to the text of the input information to be processed, and acquiring a word vector of each word in the text;
and serially connecting the word vectors into a word vector string as the pre-input information.
In an exemplary embodiment of the present application, if the received input information to be processed is in a non-text form,
when receiving the input information to be processed, converting the input information to be processed into pre-input information, including:
converting the input information to be processed in the non-text form into a text form;
and converting the input information to be processed in a text form into pre-input information.
In an exemplary embodiment of the present application, the training method of the machine learning model is:
collecting an input information sample set to be processed, wherein the input information sample to be processed is calibrated with a corresponding semantic template in advance;
converting each input information sample to be processed into pre-input information;
inputting the pre-input information obtained by converting each input information sample to be processed into a machine learning model to obtain a semantic template corresponding to each input information sample to be processed;
if the semantic template output by the machine learning model aiming at the input information sample to be processed is inconsistent with the semantic template calibrated in advance for the sample, adjusting the coefficient of the machine learning model until the semantic template output by the machine learning model aiming at the input information sample to be processed is consistent with the semantic template calibrated in advance for the sample;
and if the semantic templates output by the machine learning model aiming at all the input information samples to be processed are consistent with the semantic templates calibrated in advance for each sample, finishing training.
In an exemplary embodiment of the present application, training a machine learning model applicable to each application environment type according to an application environment type of each to-be-processed input information, and inputting the pre-input information into a pre-trained machine learning model to obtain a predicted semantic template corresponding to the to-be-processed input information includes:
acquiring an application environment type corresponding to the pre-input information;
searching a machine learning model corresponding to the application environment type according to the application environment type;
and inputting the pre-input information into a machine learning model corresponding to the application environment type to obtain a prediction semantic template corresponding to the input information to be processed.
In an exemplary embodiment of the present application, after the inputting the pre-input information into a pre-trained machine learning model to obtain a predicted semantic template corresponding to the input information to be processed, the method further includes:
obtaining semantic blocks forming the prediction semantic template;
judging whether the semantic blocks forming the prediction semantic template lack necessary semantic blocks or not;
and if the necessary semantic blocks are lacked, sending an input information supplementing instruction which is necessary to be processed and corresponds to the type of the lacked necessary semantic blocks to a user.
In an exemplary embodiment of the application, after the step of, if there is a missing necessary semantic block, issuing a necessary to-be-processed input information supplement instruction corresponding to a type of supplementing the missing necessary semantic block to a user, the method further includes:
when receiving the necessary to-be-processed input information corresponding to the supplemented missing necessary semantic block type, converting the necessary to-be-processed input information and the previous to-be-processed input information into pre-input information;
inputting the pre-input information into a pre-trained machine learning model to obtain the necessary input information to be processed and a prediction semantic template corresponding to the input information to be processed;
converting the necessary input information to be processed and the input information to be processed before into pre-analysis data according to the prediction semantic template;
and acquiring a semantic analysis result of the input information to be processed according to the pre-analysis data.
According to an aspect of the present application, there is provided a semantic analysis device based on machine learning, including:
the preprocessing module is used for converting the input information to be processed into the pre-input information when the input information to be processed is received;
the template analysis module is used for inputting the pre-input information into a pre-trained machine learning model to obtain a prediction semantic template corresponding to the input information to be processed;
the template constraint module is used for acquiring semantic template constraint information when the input information to be processed is received, inputting a prediction semantic template constraint model together with a prediction semantic template, outputting the constrained prediction semantic template, and obtaining the semantic template constraint information which is the real-time environment information related to the input information;
the conversion module is used for converting the input information to be processed into pre-analysis data according to the semantic template after constraint;
and the acquisition module is used for acquiring a semantic analysis result of the input information to be processed according to the pre-analysis data.
According to an aspect of the present application, there is provided a computer-readable storage medium having a machine learning based semantic parser stored thereon, wherein the machine learning based semantic parser when executed by a processor implements the method of any one of the above.
According to an aspect of the present application, there is provided an electronic device, comprising:
a processor; and
a memory to store a machine learning based semantic parser for the processor; wherein the processor is configured to perform any of the methods described above via execution of the machine learning based semantic parser.
Firstly, when receiving input information to be processed, converting the input information to be processed into pre-input information; this may translate various forms of input information to be processed into pre-input information that may be input into the machine learning model. And then, the pre-input information is input into a pre-trained machine learning model, so that a prediction semantic template corresponding to the input information to be processed can be accurately and efficiently obtained. Secondly, semantic template constraint information when input information to be processed is received is obtained, the semantic template constraint information and a prediction semantic template are jointly input into a prediction semantic template constraint model, the semantic template is predicted after constraint is output, and the semantic template constraint information is real-time environment information related to the input information; therefore, the semantic template predicted by real-time environmental information constraint can be further ensured to be accurate. Then, converting the input information to be processed into pre-analysis data according to the semantic template after constraint; therefore, the input information to be processed can be analyzed based on the semantic template after constraint, and the pre-analysis data meeting the acceptance requirements of the accepted object can be obtained. Finally, according to the pre-analysis data, obtaining a semantic analysis result of the input information to be processed; the result that can be directly accepted by the acceptance object is obtained. Therefore, based on the preset machine learning model, the predicted semantic template is obtained through analysis according to various input information, and the accuracy and efficiency of semantic analysis are further effectively guaranteed.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application. It is obvious that the drawings in the following description are only some embodiments of the application, and that for a person skilled in the art, other drawings can be derived from them without inventive effort.
Fig. 1 schematically shows a flow chart of a semantic parsing method based on machine learning.
Fig. 2 schematically shows a flow chart of a method of obtaining pre-input information.
Fig. 3 schematically illustrates a flow chart of a method of obtaining an input information supplement instruction.
Fig. 4 schematically shows a block diagram of a semantic parsing apparatus based on machine learning.
Fig. 5 schematically illustrates an example block diagram of an electronic device for implementing the above-described machine learning-based semantic parsing method.
Fig. 6 schematically illustrates a computer-readable storage medium for implementing the above-described machine learning-based semantic parsing method.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the application. One skilled in the relevant art will recognize, however, that the subject matter of the present application can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and so forth. In other instances, well-known technical solutions have not been shown or described in detail to avoid obscuring aspects of the present application.
Furthermore, the drawings are merely schematic illustrations of the present application and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus their repetitive description will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
In the present exemplary embodiment, a semantic analysis method based on machine learning is provided first, and the semantic analysis method based on machine learning may be run on a server, or may be run on a server cluster or a cloud server, and the like. Referring to fig. 1, the semantic parsing method based on machine learning may include the following steps:
step S110, when receiving input information to be processed, converting the input information to be processed into pre-input information;
step S120, inputting the pre-input information into a pre-trained machine learning model to obtain a prediction semantic template corresponding to the input information to be processed;
step S130, semantic template constraint information when the input information to be processed is received is obtained, the semantic template constraint information and a prediction semantic template are jointly input into a prediction semantic template constraint model, the semantic template is predicted after constraint is output, and the semantic template constraint information is real-time environment information related to the input information;
step S140, converting the input information to be processed into pre-analysis data according to the semantic template after constraint;
step S150, according to the pre-analysis data, obtaining a semantic analysis result of the input information to be processed.
In the semantic analysis method based on machine learning, firstly, when receiving input information to be processed, converting the input information to be processed into pre-input information; this may translate various forms of input information to be processed into pre-input information that may be input into the machine learning model. And then, the pre-input information is input into a pre-trained machine learning model, so that a prediction semantic template corresponding to the input information to be processed can be accurately and efficiently obtained. Secondly, semantic template constraint information when input information to be processed is received is obtained, the semantic template constraint information and a prediction semantic template are jointly input into a prediction semantic template constraint model, the semantic template is predicted after constraint is output, and the semantic template constraint information is real-time environment information related to the input information; therefore, the semantic template predicted by real-time environmental information constraint can be further ensured to be accurate. Then, converting the input information to be processed into pre-analysis data according to the semantic template after constraint; therefore, the input information to be processed can be analyzed based on the semantic template after constraint, and the pre-analysis data meeting the acceptance requirements of the accepted object can be obtained. Finally, according to the pre-analysis data, obtaining a semantic analysis result of the input information to be processed; the result that can be directly accepted by the acceptance object is obtained. Therefore, based on the preset machine learning model, the predicted semantic template is obtained through analysis according to various input information, and the accuracy and efficiency of semantic analysis are further effectively guaranteed.
Hereinafter, each step in the above-described semantic parsing method based on machine learning in the present exemplary embodiment will be explained and explained in detail with reference to the drawings.
In step S110, when the input information to be processed is received, the input information to be processed is converted into pre-input information.
In the embodiment of the present example, the input information to be processed is information that a user expresses an intrinsic idea in a certain application environment, but in a specific application, the intrinsic idea contained in the input information needs to be parsed according to the current input information, and the intrinsic idea needs to be parsed into a parsing result that can be implemented in the specific application environment, that is, a semantic parsing result. For example, when an insurance product needs to be purchased, in an application for purchasing insurance, the user enters: "i want to know about insurance a package", at this time, "i want to know about insurance a package" is the input information to be processed, at this time, the input information to be processed needs to be parsed into semantic parsing results that the insurance app can recognize, for example: "get-the Insurancea package-data". After the input information to be processed is received, semantic analysis needs to be performed in the subsequent steps, the input information to be processed is converted into pre-input information, calculation and analysis in the subsequent steps can be facilitated on the basis that the input information to be processed is accurately represented, and efficiency is improved. The pre-input information may be obtained, for example, by converting the input information to be processed into a vector form.
In an implementation manner of this example, when the input information to be processed is in a text form, when the input information to be processed is received, converting the input information to be processed into pre-input information includes:
searching a word vector dictionary according to the text of the input information to be processed, and acquiring a word vector of each word in the text;
and serially connecting the word vectors into a word vector string as the pre-input information.
The word vector dictionary stores vectors corresponding to various words, can search word vectors of each word corresponding to texts for mapping each input information to be processed, and can be used for calculating by a machine learning model by serially connecting the word vectors into word vector strings serving as pre-input information.
In one embodiment of this example, concatenating the word vectors into a word vector string as the pre-input information includes:
and according to the sequence of the words corresponding to the word vectors in the text, serially connecting the word vectors into a word vector string as the pre-input information.
In one embodiment of this example, concatenating the word vectors into a word vector string as the pre-input information includes:
and serially connecting the word vectors into a word vector string according to a random sequence, wherein the word vector string is used as the pre-input information.
In an embodiment of this example, when the input information to be processed is in a text form, when the input information to be processed is received, converting the input information to be processed into pre-input information includes:
segmenting the text of the input information to be processed into words to obtain each character and word forming the text;
searching the word vector of each word and the word vector of each word which form the text from a word vector dictionary;
and connecting the word vector of each word and the word vector of each word in series to form a vector string as the pre-input information.
The text segmentation is to use the existing text segmentation to decompose the children insurance that I want to know into I, I. Furthermore, the word vector of each word and the word vector of each word forming the text are searched from the word vector dictionary, so that the initial semantic meaning of the input information to be processed can be effectively ensured.
In one embodiment of this example, referring to fig. 2, if the received input information to be processed is in a non-text form,
when receiving the input information to be processed, converting the input information to be processed into pre-input information, including:
step S210, converting the input information to be processed in the non-text form into a text form;
step S220, converting the input information to be processed in a text form into pre-input information.
The input information to be processed in non-text form is, for example, speech information input by the user. The speech information can be converted into the input information to be processed in text form by speech recognition. And may thus be used throughout processing of input information to be processed in non-text form in speech form.
In step S120, the pre-input information is input into a pre-trained machine learning model, so as to obtain a predicted semantic template corresponding to the input information to be processed.
In the embodiment of the present example, the prediction semantic template is a prediction semantic template including implementation elements required to implement an intrinsic idea expressed by each piece of input information to be processed, which corresponds to the input information to be processed in various application environments. In one application environment, the predictive semantic template may be, for example: "get" + "insurance A package" + "data"; wherein, the 'acquisition' is an implementation action element, the 'insurance A package' is an implementation object element, and the 'data' is an implementation object attribute element.
In an application environment, when a user expresses the same idea, input information to be processed has a great number of personalized expression modes. In the related art, the intrinsic idea of the input information to be processed, which is input by the user, is analyzed in a manner of matching the input information to be processed with the preset prediction semantic template by presetting the prediction semantic template, which is very limited by the input information of the user, for example: when the user inputs 'i are good, the air conditioner knows your information', matching is carried out through a preset prediction semantic template, the phenomenon that only the implementation object element 'air conditioner' is analyzed occurs, and the purpose of accurate analysis cannot be achieved.
In the embodiment, a large amount of input information to be processed in various expression modes is input and collected as the machine learning model trained by the sample through the pre-input information obtained by converting the input information to be processed, so that the prediction semantic template corresponding to the input information to be processed can be automatically and accurately obtained, the accuracy is high, and the efficiency is high. For example, after feature vector data of ' i ' good heat, air conditioner know you ' is input into the machine for learning, a prediction semantic template of ' open ' + ' air conditioner ' can be accurately obtained. Through the machine learning model trained in advance, the efficiency and the accuracy of obtaining the prediction semantic template can be effectively ensured.
In an embodiment of this example, the training method of the machine learning model is:
collecting an input information sample set to be processed, wherein the input information sample to be processed is calibrated with a corresponding prediction semantic template in advance;
converting each input information sample to be processed into pre-input information;
inputting the pre-input information obtained by converting each input information sample to be processed into a machine learning model to obtain a prediction semantic template corresponding to each input information sample to be processed;
if the predicted semantic template output by the machine learning model aiming at the input information sample to be processed is inconsistent with the predicted semantic template calibrated in advance for the sample, adjusting the coefficient of the machine learning model until the predicted semantic template output by the machine learning model aiming at the input information sample to be processed is consistent with the predicted semantic template calibrated in advance for the sample;
and if the predicted semantic templates output by the machine learning model aiming at all the input information samples to be processed are consistent with the predicted semantic templates calibrated in advance for each sample, finishing training.
In an embodiment of this example, training a machine learning model applicable to each application environment type according to an application environment type of each piece of input information to be processed, and inputting the pre-input information into a pre-trained machine learning model to obtain a predicted semantic template corresponding to the input information to be processed includes:
acquiring an application environment type corresponding to the pre-input information;
searching a machine learning model corresponding to the application environment type according to the application environment type;
and inputting the pre-input information into a machine learning model corresponding to the application environment type to obtain a prediction semantic template corresponding to the input information to be processed.
The application environment type is an acceptance environment of input information to be processed, and the acceptance environment is, for example, various environments such as an air conditioner terminal, a mobile phone, a television, and the like. And training a machine learning model suitable for each application environment type, and selecting according to requirements to ensure the accuracy of obtaining the prediction semantic template corresponding to the input information to be processed.
In an embodiment of this example, training a machine learning model applicable to all the application environment types according to all the application environment types of the input information to be processed, and inputting the pre-input information into the pre-trained machine learning model to obtain a predicted semantic template corresponding to the input information to be processed includes:
and inputting the pre-input information into the machine learning model suitable for all the application environment types to obtain a prediction semantic template corresponding to the input information to be processed.
In step S130, semantic template constraint information when the input information to be processed is received is obtained, and the semantic template constraint information and the predicted semantic template are input into the predicted semantic template constraint model together, and the predicted semantic template after constraint is output, where the semantic template constraint information is real-time environment information related to the input information.
The semantic template constraint information is real-time environment information related to input information, and at least comprises one of the following three levels of related environment information, namely a first level: voice voiceprint information of the user (voice audio information when the user inputs information by voice, etc.), second stage: the service environment information (such as counter machines, portable terminals, household machines and the like) of the acceptance equipment associated with the input information, and the third level: weather related information (e.g., real-time temperature, whether it is raining, etc.) when the input information is received. The above three levels of information can be conveniently obtained in a networking or direct receiving mode. The more the three-level information is acquired, the better the constraint effect on the semantic template is. For example, when the predicted semantic template is: "get" + "insurance A package" + "data"; the post constraint semantic template is: < paging > "get" + "insurance a package" + < transmissible > "data"; or, when the predicted semantic template is: turning on the + air conditioner, and constraining the semantic templates as follows: < immediately > < dry > "turn on" + "air conditioner".
By the method, the predicted semantic template can be further constrained into a constrained semantic template with a real-time environment consistent on the basis of the received input information prediction, and the flexibility of semantic analysis is improved.
In an embodiment of this example, the training method of the predictive semantic template constraint model includes:
collecting semantic template constraint information and a prediction semantic template sample set, wherein each sample is calibrated with a corresponding semantic constraint template in advance;
inputting the sample into a machine learning model to obtain a prediction semantic constraint template corresponding to the sample;
if the predicted semantic constraint template output by the machine learning model aiming at the sample is inconsistent with the semantic constraint template calibrated in advance for the sample, adjusting the coefficient of the machine learning model until the predicted semantic constraint template output by the machine learning model aiming at the sample is consistent with the semantic constraint template calibrated in advance for the sample;
and if the predicted semantic constraint templates output by the machine learning model aiming at all the samples are consistent with the semantic constraint templates calibrated in advance for each sample, finishing training.
In step S140, the input information to be processed is converted into pre-analysis data according to the constrained semantic template.
In the present exemplary embodiment, there are generally many types of formats of the received data of the device that receives the input information to be processed. For example: the data receiving form of the accepting device is as follows: the "implementation object attribute-implementation object-implementation action" and the data reception form of the other accepting device is: "implementation action @ implementation object-implementation object attribute".
The pre-analysis data generation means that the pre-analysis data in a corresponding form can be obtained in advance according to the form of the received data of the equipment accepting the input information to be processed, and the semantic analysis result of the equipment suitable for the input information to be processed can be accurately obtained only by performing language mode conversion in the subsequent steps.
In an implementation manner of this example, converting the input information to be processed into pre-analytic data according to the post-constraint semantic template includes:
acquiring a data receiving requirement corresponding to the application environment type of the input information to be processed;
and converting the input information to be processed into pre-analysis data according to the data receiving requirement and the constrained semantic template.
The data receiving requirement corresponding to the application environment type is, for example, a data receiving form of an accepting device is as follows: "< a > implementation object attribute- < B > implementation object- < C > implementation action", and the data reception form of another reception device is: "< a > implementation action @ implementation object < B > - < C > implementation object attribute". The embodiment can accurately convert the input information to be processed into the pre-analysis data according to different application environment types.
In step S150, a semantic parsing result of the input information to be processed is obtained according to the pre-parsing data.
In the embodiment of the present example, the semantic analysis result is data that can be recognized by a device or the like that accepts input information to be processed, for example, machine language. The pre-analysis data is converted into data with corresponding format requirements, and the semantic analysis result of the input information to be processed can be obtained by performing simple language instruction conversion on the pre-analysis data. For example, "< paging > get @ insurance a package- < transmissible > profile" translates into a semantic mind result that the insurance purchase app can recognize, i.e., "(fy) Gain @ instr-a (ts) pk", which is required in advance according to the data format of the app instruction. The method for obtaining the semantic analysis result of the input information to be processed can be that the analysis data blocks in various pre-analysis data and the corresponding analysis results are stored in the database according to the corresponding relationship in advance, the corresponding analysis results can be inquired according to the analysis data blocks, and then the semantic analysis result of the whole input information to be processed is formed. If the pre-analysis data is < paging > get @ insurance-a package- < transmissible > data ", the analysis data block is < paging >" get "," insurance-a package ", < transmissible >" data ", and the corresponding analysis results are (fy)" Gain "," instr-a ", and (ts)" pk ".
In an implementation manner of this example, obtaining a semantic parsing result of the input information to be processed according to the pre-parsing data includes:
acquiring each sub-pre-analytic data forming the pre-analytic data;
searching a sub-semantic analysis result corresponding to each sub-pre-analysis data from a database;
and combining the sub-semantic analysis results into a semantic analysis result of the input information to be processed.
For example, if the pre-parse data is "< page > get @ insurance-a package- < transmissible type > data", the sub-pre-parse data is "< page >" get "," insurance-a package "", < transmissible type > "data", respectively, and the corresponding sub-semantic parsing results are (fy) "Gain", "insir-a", and (ts) "pk".
In an implementation manner of this example, referring to fig. 3, after the pre-input information is input into a pre-trained machine learning model to obtain a predicted semantic template corresponding to the input information to be processed, the method further includes:
step S310, obtaining semantic blocks forming the prediction semantic template;
step S320, judging whether the semantic blocks forming the prediction semantic template lack necessary semantic blocks;
step S330, if the necessary semantic block is lacked, a necessary input information supplement instruction to be processed corresponding to the type of the lacked necessary semantic block is sent to the user.
Wherein, if the predicted semantic template is 'acquire' + 'insurance A package' + 'data', the semantic blocks are 'acquire', 'insurance A package' and
"data". The necessary semantic blocks are the semantic blocks indispensable for the prediction semantic template to express the intrinsic idea of the input information to be processed. For example, if the semantic block "insurance a package" is missing from the "acquisition" + "insurance a package" + "material" of the prediction semantic template, the implementation object of the input information to be processed corresponding to the prediction semantic template is unknown. In the embodiment, the predicted semantic template output by the machine learning model lacks necessary semantic blocks, which indicates that the input information to be processed which is input at the beginning lacks necessary input information, and the necessary input information can be accurately acquired through a supplement instruction. Thereby ensuring the integrity and the practicability of the semantic analysis result.
In an embodiment of this example, after the step of, if there is a missing necessary semantic block, issuing, to a user, an input information supplementing instruction to supplement the necessary to-be-processed input information corresponding to the type of the missing necessary semantic block, the method further includes:
when receiving the necessary to-be-processed input information corresponding to the supplemented missing necessary semantic block type, converting the necessary to-be-processed input information and the previous to-be-processed input information into pre-input information;
inputting the pre-input information into a pre-trained machine learning model to obtain the necessary input information to be processed and a prediction semantic template corresponding to the input information to be processed;
converting the necessary input information to be processed and the input information to be processed before into pre-analysis data according to the prediction semantic template;
and acquiring a semantic analysis result of the input information to be processed according to the pre-analysis data.
The application also provides a semantic analysis device based on machine learning. Referring to fig. 4, the semantic parsing apparatus based on machine learning may include a preprocessing module 410, a template parsing module 420, a template constraint module 430, a transformation module 440, and an acquisition module 450. Wherein:
the preprocessing module 410 may be configured to, when receiving input information to be processed, convert the input information to be processed into pre-input information;
the template analysis module 420 may be configured to input the pre-input information into a pre-trained machine learning model, so as to obtain a predicted semantic template corresponding to the input information to be processed;
the template constraint module 430 may be configured to obtain semantic template constraint information when receiving input information to be processed, input a predictive semantic template constraint model together with a predictive semantic template, and output a constrained predictive semantic template, where the semantic template constraint information is real-time environment information related to the input information;
the conversion module 440 may be configured to convert the input information to be processed into pre-analysis data according to the constrained semantic template;
the obtaining module 450 may be configured to obtain a semantic parsing result of the input information to be processed according to the pre-parsing data.
The specific details of each module in the semantic analysis device based on machine learning have been described in detail in the corresponding semantic analysis method based on machine learning, and therefore are not described herein again.
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the application. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
Moreover, although the steps of the methods herein are depicted in the drawings in a particular order, this does not require or imply that the steps must be performed in this particular order, or that all of the depicted steps must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions, etc.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the embodiments of the present application.
In an exemplary embodiment of the present application, there is also provided an electronic device capable of implementing the above method.
As will be appreciated by one skilled in the art, aspects of the present invention may be embodied as a system, method or program product. Thus, various aspects of the invention may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
An electronic device 500 according to this embodiment of the invention is described below with reference to fig. 5. The electronic device 500 shown in fig. 5 is only an example and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 5, the electronic device 500 is embodied in the form of a general purpose computing device. The components of the electronic device 500 may include, but are not limited to: the at least one processing unit 510, the at least one memory unit 520, and a bus 530 that couples various system components including the memory unit 520 and the processing unit 510.
Wherein the storage unit stores program code that is executable by the processing unit 510 to cause the processing unit 510 to perform steps according to various exemplary embodiments of the present invention as described in the above section "exemplary methods" of the present specification. For example, the processing unit 510 may execute step S110 as shown in fig. 1: when receiving input information to be processed, converting the input information to be processed into pre-input information; s120: inputting the pre-input information into a pre-trained machine learning model to obtain a prediction semantic template corresponding to the input information to be processed; step S130: converting the input information to be processed into pre-analysis data according to the prediction semantic template; step S140: acquiring semantic template constraint information when input information to be processed is received, inputting a prediction semantic template constraint model together with a prediction semantic template, outputting the constrained prediction semantic template, wherein the semantic template constraint information is real-time environment information related to the input information; step S150: and acquiring a semantic analysis result of the input information to be processed according to the pre-analysis data.
The memory unit 520 may include a readable medium in the form of a volatile memory unit, such as a random access memory unit (RAM)5201 and/or a cache memory unit 5202, and may further include a read only memory unit (ROM) 5203.
Storage unit 520 may also include a program/utility 5204 having a set (at least one) of program modules 5205, such program modules 5205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Bus 530 may be one or more of any of several types of bus structures including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 500 may also communicate with one or more external devices 700 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a client to interact with the electronic device 500, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 500 to communicate with one or more other computing devices. Such communication may occur via input/output (I/O) interface 550, which may include display unit 540 coupled to input/output (I/O) interface 550. Also, the electronic device 500 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the internet) via the network adapter 560. As shown, the network adapter 560 communicates with the other modules of the electronic device 500 over the bus 530. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the electronic device 500, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to make a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) execute the method according to the embodiments of the present application.
In an exemplary embodiment of the present application, there is also provided a computer-readable storage medium having stored thereon a program product capable of implementing the above-described method of the present specification. In some possible embodiments, aspects of the invention may also be implemented in the form of a program product comprising program code means for causing a terminal device to carry out the steps according to various exemplary embodiments of the invention described in the above section "exemplary methods" of the present description, when said program product is run on the terminal device.
Referring to fig. 6, a program product 600 for implementing the above method according to an embodiment of the present invention is described, which may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited in this regard and, in the present document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
A computer readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the client computing device, partly on the client device, as a stand-alone software package, partly on the client computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the client computing device over any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., over the internet using an internet service provider).
Furthermore, the above-described figures are merely schematic illustrations of processes involved in methods according to exemplary embodiments of the invention, and are not intended to be limiting. It will be readily understood that the processes shown in the above figures are not intended to indicate or limit the chronological order of the processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, e.g., in multiple modules.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.

Claims (10)

1. A semantic parsing method based on machine learning is characterized by comprising the following steps:
when receiving input information to be processed, converting the input information to be processed into pre-input information;
inputting the pre-input information into a pre-trained machine learning model to obtain a prediction semantic template corresponding to the input information to be processed;
acquiring semantic template constraint information when input information to be processed is received, inputting a prediction semantic template constraint model together with a prediction semantic template, outputting the constrained prediction semantic template, wherein the semantic template constraint information is real-time environment information related to the input information;
converting the input information to be processed into pre-analysis data according to the constrained semantic template;
and acquiring a semantic analysis result of the input information to be processed according to the pre-analysis data.
2. The method of claim 1, wherein converting the input information to be processed into pre-input information when receiving the input information to be processed comprises:
when input information to be processed is received and the input information to be processed is in a text form, searching a word vector dictionary according to the text of the input information to be processed, and acquiring a word vector of each word in the text;
and serially connecting the word vectors into a word vector string as pre-input information.
3. The method of claim 1, wherein if the received input information to be processed is in a non-textual form,
when receiving the input information to be processed, converting the input information to be processed into pre-input information, including:
converting the input information to be processed in the non-text form into a text form;
and converting the input information to be processed in a text form into pre-input information.
4. The method of claim 1, wherein the training method of the machine learning model is:
collecting an input information sample set to be processed, wherein the input information sample to be processed is calibrated with a corresponding semantic template in advance;
converting each input information sample to be processed into pre-input information;
inputting the pre-input information obtained by converting each input information sample to be processed into a machine learning model to obtain a semantic template corresponding to each input information sample to be processed;
if the semantic template output by the machine learning model aiming at the input information sample to be processed is inconsistent with the semantic template calibrated in advance for the sample, adjusting the coefficient of the machine learning model until the semantic template output by the machine learning model aiming at the input information sample to be processed is consistent with the semantic template calibrated in advance for the sample;
and if the semantic templates output by the machine learning model aiming at all the input information samples to be processed are consistent with the semantic templates calibrated in advance for each sample, finishing training.
5. The method according to claim 1, wherein training a machine learning model suitable for each application environment type according to the application environment type of each input information to be processed, and inputting the pre-input information into the pre-trained machine learning model to obtain a predicted semantic template corresponding to the input information to be processed comprises:
acquiring an application environment type corresponding to the pre-input information;
searching a machine learning model corresponding to the application environment type according to the application environment type;
and inputting the pre-input information into a machine learning model corresponding to the application environment type to obtain a prediction semantic template corresponding to the input information to be processed.
6. The method according to claim 1, wherein after the pre-input information is input into a pre-trained machine learning model to obtain a predicted semantic template corresponding to the input information to be processed, the method further comprises:
obtaining semantic blocks forming the prediction semantic template;
judging whether the semantic blocks forming the prediction semantic template lack necessary semantic blocks or not;
and if the necessary semantic blocks are lacked, sending an input information supplementing instruction which is necessary to be processed and corresponds to the type of the lacked necessary semantic blocks to a user.
7. The method according to claim 6, wherein after the step of issuing, if the necessary semantic block is absent, a necessary input information supplement instruction corresponding to a type of supplementing the absent necessary semantic block to the user to be processed, the method further comprises:
when receiving the necessary to-be-processed input information corresponding to the supplemented missing necessary semantic block type, converting the necessary to-be-processed input information and the previous to-be-processed input information into pre-input information;
inputting the pre-input information into a pre-trained machine learning model to obtain the necessary input information to be processed and a prediction semantic template corresponding to the input information to be processed;
converting the necessary input information to be processed and the input information to be processed before into pre-analysis data according to the prediction semantic template;
and acquiring a semantic analysis result of the input information to be processed according to the pre-analysis data.
8. A semantic parsing apparatus based on machine learning, comprising:
the preprocessing module is used for converting the input information to be processed into the pre-input information when the input information to be processed is received;
the template analysis module is used for inputting the pre-input information into a pre-trained machine learning model to obtain a prediction semantic template corresponding to the input information to be processed;
the template constraint module is used for acquiring semantic template constraint information when the input information to be processed is received, inputting a prediction semantic template constraint model together with a prediction semantic template, outputting the constrained prediction semantic template, and obtaining the semantic template constraint information which is the real-time environment information related to the input information;
the conversion module is used for converting the input information to be processed into pre-analysis data according to the semantic template after constraint;
and the acquisition module is used for acquiring a semantic analysis result of the input information to be processed according to the pre-analysis data.
9. A computer-readable storage medium having stored thereon a machine learning based semantic parser, wherein the machine learning based semantic parser, when executed by a processor, implements the method of any of claims 1-7.
10. An electronic device, comprising:
a processor; and
a memory to store a machine learning based semantic parser for the processor; wherein the processor is configured to perform the method of any of claims 1-7 via execution of the machine learning based semantic parser.
CN201910879338.1A 2019-09-18 2019-09-18 Semantic analysis method, device, medium and electronic equipment based on machine learning Pending CN110688859A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201910879338.1A CN110688859A (en) 2019-09-18 2019-09-18 Semantic analysis method, device, medium and electronic equipment based on machine learning
PCT/CN2019/117680 WO2021051565A1 (en) 2019-09-18 2019-11-12 Machine learning-based semantic parsing method and apparatus, electronic device, and computer non-volatile readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910879338.1A CN110688859A (en) 2019-09-18 2019-09-18 Semantic analysis method, device, medium and electronic equipment based on machine learning

Publications (1)

Publication Number Publication Date
CN110688859A true CN110688859A (en) 2020-01-14

Family

ID=69109664

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910879338.1A Pending CN110688859A (en) 2019-09-18 2019-09-18 Semantic analysis method, device, medium and electronic equipment based on machine learning

Country Status (2)

Country Link
CN (1) CN110688859A (en)
WO (1) WO2021051565A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111353292A (en) * 2020-02-26 2020-06-30 支付宝(杭州)信息技术有限公司 Analysis method and device for user operation instruction

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080196016A1 (en) * 2007-02-13 2008-08-14 International Business Machines Corporation Processing of Expressions
CN104575501A (en) * 2015-01-19 2015-04-29 北京云知声信息技术有限公司 Analysis method and system of voice control instruction of radio
US20150310862A1 (en) * 2014-04-24 2015-10-29 Microsoft Corporation Deep learning for semantic parsing including semantic utterance classification
CN106874259A (en) * 2017-02-23 2017-06-20 腾讯科技(深圳)有限公司 A kind of semantic analysis method and device, equipment based on state machine
CN110147490A (en) * 2017-08-07 2019-08-20 声音猎手公司 Natural language recommends feedback

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080196016A1 (en) * 2007-02-13 2008-08-14 International Business Machines Corporation Processing of Expressions
US20150310862A1 (en) * 2014-04-24 2015-10-29 Microsoft Corporation Deep learning for semantic parsing including semantic utterance classification
CN104575501A (en) * 2015-01-19 2015-04-29 北京云知声信息技术有限公司 Analysis method and system of voice control instruction of radio
CN106874259A (en) * 2017-02-23 2017-06-20 腾讯科技(深圳)有限公司 A kind of semantic analysis method and device, equipment based on state machine
CN110147490A (en) * 2017-08-07 2019-08-20 声音猎手公司 Natural language recommends feedback

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111353292A (en) * 2020-02-26 2020-06-30 支付宝(杭州)信息技术有限公司 Analysis method and device for user operation instruction
CN111353292B (en) * 2020-02-26 2023-06-16 支付宝(杭州)信息技术有限公司 Analysis method and device for user operation instruction

Also Published As

Publication number Publication date
WO2021051565A1 (en) 2021-03-25

Similar Documents

Publication Publication Date Title
US11403680B2 (en) Method, apparatus for evaluating review, device and storage medium
KR102401942B1 (en) Method and apparatus for evaluating translation quality
CN110287278B (en) Comment generation method, comment generation device, server and storage medium
CN107480162B (en) Search method, device and equipment based on artificial intelligence and computer readable storage medium
CN109284399B (en) Similarity prediction model training method and device and computer readable storage medium
CN111402861B (en) Voice recognition method, device, equipment and storage medium
CN111368559A (en) Voice translation method and device, electronic equipment and storage medium
US11651015B2 (en) Method and apparatus for presenting information
US20210125600A1 (en) Voice question and answer method and device, computer readable storage medium and electronic device
CN111783450B (en) Phrase extraction method and device in corpus text, storage medium and electronic equipment
CN114840671A (en) Dialogue generation method, model training method, device, equipment and medium
CN111079432A (en) Text detection method and device, electronic equipment and storage medium
CN111695338A (en) Interview content refining method, device, equipment and medium based on artificial intelligence
CN112988753A (en) Data searching method and device
CN116303537A (en) Data query method and device, electronic equipment and storage medium
CN114637843A (en) Data processing method and device, electronic equipment and storage medium
CN109753658B (en) Interaction method and device
CN111209367A (en) Information searching method, information searching device, electronic equipment and storage medium
CN112711943B (en) Uygur language identification method, device and storage medium
CN117149140B (en) Method, device and related equipment for generating coded architecture information
CN110688859A (en) Semantic analysis method, device, medium and electronic equipment based on machine learning
CN113642569A (en) Unstructured data document processing method and related equipment
US20230351110A1 (en) Text recognition method and apparatus, computer-readable storage medium and electronic device
CN113761895A (en) Text abstract generation method and device, electronic equipment and storage medium
CN110705308A (en) Method and device for recognizing field of voice information, storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination