CN109542929A - Voice inquiry method, device and electronic equipment - Google Patents

Voice inquiry method, device and electronic equipment Download PDF

Info

Publication number
CN109542929A
CN109542929A CN201811440115.7A CN201811440115A CN109542929A CN 109542929 A CN109542929 A CN 109542929A CN 201811440115 A CN201811440115 A CN 201811440115A CN 109542929 A CN109542929 A CN 109542929A
Authority
CN
China
Prior art keywords
vocabulary
sql statement
speech
text
obtains
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.)
Granted
Application number
CN201811440115.7A
Other languages
Chinese (zh)
Other versions
CN109542929B (en
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.)
Shandong Technology and Business University
Original Assignee
Shandong Technology and Business University
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 Shandong Technology and Business University filed Critical Shandong Technology and Business University
Priority to CN201811440115.7A priority Critical patent/CN109542929B/en
Publication of CN109542929A publication Critical patent/CN109542929A/en
Application granted granted Critical
Publication of CN109542929B publication Critical patent/CN109542929B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The present invention provides a kind of voice inquiry method, device and electronic equipments, wherein this method is applied to server, this method comprises: obtaining user speech, converts speech into Chinese text;Chinese text is handled, text vector is obtained;Text vector is input in preset transformation model, output result is obtained;Transformation model is obtained by attention model training;Output result is input in preset SQL statement template, obtains formalization SQL statement according to default semantic dependency relations;Obtain domain information;According to domain information and formalization SQL statement, executable SQL statement is obtained.The present invention is processed into text vector by digitizing the speech into, utilize transformation model, SQL statement template and the domain information pre-established, text vector is converted into executable SQL statement, database is inquired using executable SQL statement, simplify the inquiry mode of database, and it is adapted to the data base querying of different service systems, improve the portability of data base querying.

Description

Voice inquiry method, device and electronic equipment
Technical field
The present invention relates to field of database query technology, set more particularly, to a kind of voice inquiry method, device and electronics It is standby.
Background technique
Data base management system is the set of relation data and program, is widely used in the management system of all trades and professions In, for the storage and retrieval of data, to operate to Database Systems, need to have certain Basis of Computer Engineering even Certain SQL statement writes ability, more difficult if unprofessional user wants to inquire Database Systems, utilizes data Library Natural Language Query Interface can simplify inquiry of the unprofessional user to database to a certain extent, but would generally be by The limitation of professional domain vocabulary, it is portable poor for the service system of different industries.
Summary of the invention
In view of this, the purpose of the present invention is to provide a kind of voice inquiry method, device and electronic equipment, to simplify number According to the inquiry mode in library, allow to be adapted to the data base querying of different service systems, improves the portable of data base querying Property.
In a first aspect, the embodiment of the invention provides a kind of voice inquiry methods, wherein this method is applied to server, This method comprises: obtaining user speech, Chinese text is converted speech into;Chinese text is handled, text vector is obtained; Text vector is input in preset transformation model, output result is obtained;Transformation model is obtained by attention model training; Output result is input in preset SQL statement template, obtains formalization SQL statement according to preset semantic dependency relations; Obtain domain information;According to domain information and formalization SQL statement, executable SQL statement is obtained.
With reference to first aspect, the embodiment of the invention provides the first possible embodiments of first aspect, wherein right The step of Chinese text is handled, and text vector is obtained, comprising: Chinese text is pre-processed, multiple vocabulary are obtained;In advance Processing includes going to stop word, removing punctuate, participle;Part-of-speech tagging is carried out to each vocabulary, obtains the part of speech of each vocabulary;According to default Rule each vocabulary is encoded, obtain text vector.
The possible embodiment of with reference to first aspect the first, the embodiment of the invention provides second of first aspect Possible embodiment, wherein the step of each vocabulary is encoded according to default rule, comprising: each vocabulary is held The following processing step of row: the part of speech of vocabulary is obtained;Obtain the part of speech of the adjacent words of vocabulary;According to the part of speech of vocabulary and vocabulary The part of speech of adjacent words, encodes vocabulary;The coding result of multiple vocabulary of Chinese text is gathered, text is obtained Vector.
With reference to first aspect, the embodiment of the invention provides the third possible embodiments of first aspect, wherein turns The step of mold changing type is obtained by attention model training, comprising: obtain Chinese text sample;At Chinese samples of text Reason, obtains text vector sample;Text vector sample is input in the attention model built in advance and is trained, is turned Mold changing type.
The third possible embodiment with reference to first aspect, the embodiment of the invention provides the 4th kind of first aspect Possible embodiment, wherein this method further include: transformation model is adjusted using cross-validation method.
With reference to first aspect, the embodiment of the invention provides the 5th kind of possible embodiments of first aspect, wherein domain Information includes in the common expression of database table structure, literary name section, explanation of field, field type, field value range and field It is a variety of.
Second aspect, the embodiment of the present invention also provide a kind of speech polling device, wherein and the device is set to server, The device includes: conversion module, for obtaining user speech, converts speech into Chinese text;Processing module, for Chinese Text is handled, and text vector is obtained;First output module, for text vector to be input in preset transformation model, Obtain output result;Transformation model is obtained by attention model training;Second output module is input to for that will export result In preset SQL statement template, formalization SQL statement is obtained according to preset semantic dependency relations;Module is obtained, for obtaining Domain information, third output module, for obtaining executable SQL statement according to domain information and formalization SQL statement.
In conjunction with second aspect, the embodiment of the invention provides the first possible embodiments of second aspect, wherein place Manage module further include: preprocessing module obtains multiple vocabulary for pre-processing to Chinese text;Pretreatment includes going to stop Word removes punctuate, participle;Part-of-speech tagging module obtains the part of speech of each vocabulary for carrying out part-of-speech tagging to each vocabulary;It compiles Code module obtains text vector for encoding according to default rule to each vocabulary.
The third aspect, the embodiment of the present invention also provide a kind of electronic equipment, wherein including memory, processor, memory In be stored with the computer program that can be run on a processor, wherein processor execute computer program when realize above-mentioned first The step of method described in aspect.
Fourth aspect, the embodiment of the present invention also provide a kind of meter of non-volatile program code that can be performed with processor Calculation machine readable medium, wherein program code makes processor execute first aspect the method.
The embodiment of the present invention bring it is following the utility model has the advantages that
The present invention provides a kind of voice inquiry method, device and electronic equipments, wherein and this method is applied to server, This method comprises: obtaining user speech, Chinese text is converted speech into;Chinese text is handled, text vector is obtained; Text vector is input in preset transformation model, output result is obtained;Transformation model is obtained by attention model training; Output result is input in preset SQL statement template, obtains formalization SQL statement according to preset semantic dependency relations; Obtain domain information;According to domain information and formalization SQL statement, executable SQL statement is obtained.The present invention is by digitizing the speech into place Text vector is managed into, using the transformation model and SQL statement template and domain information pre-established, text vector is converted into Executable SQL statement, inquires database using executable SQL statement, simplifies the inquiry mode of database, and can be with It is adapted to the data base querying of different service systems, improves the portability of data base querying.
Other features and advantages of the present invention will illustrate in the following description, alternatively, Partial Feature and advantage can be with Deduce from specification or unambiguously determine, or by implementing above-mentioned technology of the invention it can be learnt that.
To enable the above objects, features and advantages of the present invention to be clearer and more comprehensible, better embodiment is cited below particularly, and match Appended attached drawing is closed, is described in detail below.
Detailed description of the invention
It, below will be to specific in order to illustrate more clearly of the specific embodiment of the invention or technical solution in the prior art Embodiment or attached drawing needed to be used in the description of the prior art be briefly described, it should be apparent that, it is described below Attached drawing is some embodiments of the present invention, for those of ordinary skill in the art, before not making the creative labor It puts, is also possible to obtain other drawings based on these drawings.
Fig. 1 is a kind of flow chart of voice inquiry method provided in an embodiment of the present invention;
Fig. 2 is the flow chart that a kind of pair of Chinese text provided in an embodiment of the present invention is handled;
Fig. 3 is a kind of structural schematic diagram of semantic dependency relations provided in an embodiment of the present invention;
Fig. 4 is a kind of flow chart for obtaining transformation model provided in an embodiment of the present invention;
Fig. 5 is a kind of structural schematic diagram of transformation model provided in an embodiment of the present invention;
Fig. 6 is a kind of structural schematic diagram of speech polling device provided in an embodiment of the present invention;
Fig. 7 is the structural schematic diagram of a kind of electronic equipment provided in an embodiment of the present invention.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with attached drawing to the present invention Technical solution be clearly and completely described, it is clear that described embodiments are some of the embodiments of the present invention, rather than Whole embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art are not making creative work premise Under every other embodiment obtained, shall fall within the protection scope of the present invention.
Currently, existing database Natural Language Query Interface mostly uses keyword match, pattern match, vocabulary driving etc. Technology, still, these technologies would generally be limited by professional domain vocabulary, are usually only applied to dedicated field, are not suitable for Remaining field, it is portable poor, and user can only according to system it is preset it is regular be interacted with system, slightly deviation is then Error rate will greatly improve.Based on this, a kind of voice inquiry method, device and electronic equipment provided in an embodiment of the present invention, It can be applied to the data base querying of different field.
For convenient for understanding the present embodiment, first to a kind of voice inquiry method disclosed in the embodiment of the present invention into Row is discussed in detail.
The flow chart of a kind of voice inquiry method shown in Figure 1, wherein this method is applied to server, this method Steps are as follows:
Step S102 obtains user speech, converts speech into Chinese text;
When user query database by the way of voice input, the voice messaging of user is turned using speech software It changes Chinese text into, can be turned the voice of the various language of user using speech softwares such as Iflytek, search dog dictations Change Chinese text into.It is inputted using voice, the Basis of Computer Engineering and SQL language that the unnecessary certain grasp of user can be made certain Sentence writes ability, can inquire the desired data of user oneself by the input of simple voice, simplify user query The mode of database.
Step S104, handles Chinese text, obtains text vector;
In above-mentioned steps S104, the step of handling Chinese text, is as shown in Figure 2, the specific steps are as follows:
Step S202, pre-processes Chinese text, obtains multiple vocabulary;Pretreatment includes going to stop word, removing punctuate, divide Word;
The pretreatment for stopping word, removing punctuate and participle is carried out to the Chinese text being converted to by voice, go to stop word be Refer to that certain words or word, such as language are fallen in automatic fitration when literary text in processes in order to save memory space and improve treatment effeciency Word of gas auxiliary word, adverbial word, the onomatopoeia etc. itself without meaning reduces treating capacity in subsequent processing, improves treatment effeciency; It goes punctuate to refer to the punctuate of removal Chinese text, reduces treating capacity, improve treatment effeciency, participle refers to according to the word pre-established Library is assumed using Markov, ties up bit algorithm scheduling algorithm to Chinese text progress word segmentation processing, obtained multiple vocabulary, realize Pretreatment to Chinese text.
Step S204 carries out part-of-speech tagging to each vocabulary, obtains the part of speech of each vocabulary;
After pre-processing to Chinese text, the set of multiple vocabulary is obtained, part-of-speech tagging is carried out to each vocabulary, The part of speech of each vocabulary is obtained, that is, determines that each vocabulary is the process of noun, verb, adjective or other parts of speech.
Step S206 encodes each vocabulary according to default rule, obtains text vector.
Wherein, following processing step is performed both by when carrying out coded treatment to each vocabulary:
Step (1) obtains the part of speech for the vocabulary that need to currently encode;
Step (2) obtains the part of speech of the adjacent words for the vocabulary that need to currently encode;
Step (3), according to the part of speech of the part of speech for the vocabulary that need to currently encode and the adjacent words of the vocabulary, to the vocabulary into Row coding.
Vocabulary is encoded according to customized part of speech using the encoder pre-established, the form of number is weaved into, such as name Word=1, verb=2 etc. use customized part of speech and context since the limited granularity of division that will lead to of part of speech type is too thick The mode that part of speech combines encodes current vocabulary.
The coding result of all vocabulary of current Chinese text is gathered, the corresponding text of current Chinese text is obtained Vector.
Above-mentioned steps S202 to step S206 describes the step of handling Chinese text, obtaining text vector, The step of continuing with description voice inquiry method.
Text vector is input in preset transformation model by step S106, obtains output result;Transformation model passes through note Meaning power model training obtains;
Text vector after coded treatment is input in the transformation model pre-established, transformation model is based on note Meaning power model training obtains, and is handled by the text vector to digital form, obtains the output result of digital form.
Output result is input in preset SQL statement template, is obtained according to preset semantic dependency relations by step S108 To formalization SQL statement;
SQL statement template is pre-established, converts semantic understanding slot filling problem for the problem that automatically generates of SQL statement, By the output using transformation model as a result, being filled according to preset semantic dependency relations to SQL statement template, such as in advance The SQL statement template of foundation are as follows:
SELECT($COL)*,($AGG$COL)*
WHERE$COL$OP$VALUE
($LINK$COL$OP$VALUE)*
Wherein, * indicates 0 or multiple, and $ AGG indicates the function in SQL statement, such as sum (), avg (), max () etc.; $ COL indicates the column name in database;$ VALUE indicates Query Value;$ LINK is conjunction, such as and, or etc.;$ OP is to compare Operator.$ sign flag part is the part for needing to be filled according to the output result of transformation model, by SQL statement Template is filled, and obtains formalization SQL statement.
Step S110 obtains domain information;
Domain information includes that database table structure, literary name section, explanation of field, field type, field value range and field are normal With a variety of in expression;It can be obtained after obtaining formalization SQL statement, user can also be obtained in above-mentioned steps S102 Domain information is obtained while voice, as long as being handled formalization SQL statement to obtain executable SQL statement again.
Domain information is described in detail by taking table 1 as an example, wherein table 1 includes four tables, is transformer parameter respectively Table, plant stand parameter list, region parameter table, voltage class table, each table respectively correspond multiple fields, and each field has each field The common expression of corresponding field type, field and field value range.
1 database table explanation of table
Note: in field value range, E indicates that this field value can be enumerated, and enumerated value is listed in back;R indicates that this field is deposited In value range, value bound is listed in back.
Step S112 obtains executable SQL statement according to domain information and formalization SQL statement.
Further micronization processes are carried out to formalization SQL statement, replace $ COL, $ OP, $ using standardized SQL element Then AGG finds the $ COL for specifically arranging in SELECT statement and hiding in name and WHERE sentence, is supplemented, then find $ COL Corresponding table in the database finds the association between each table if being dispersed in multiple tables.
It is illustrated by taking above table 1 as an example to finding the treatment process for specifically arranging name in SELECT statement, will formalize It needs to carry out the word of column name materialization in SQL statement and the common expression of field, field in above table 1 carries out form respectively Match and semantic matches, and give a mark to matching result, takes the highest field of score value as the column name embodied, if there is more A similar score value, can introduce question and answer mechanism and carry out secondary enquirement to user, which column name should be embodied as by user's confirmation.
The treatment process for finding the $ COL hidden in WHERE sentence is illustrated still by taking table 1 as an example, for formalization Column value in SQL statement, judges its data type, filters out the unmatched field of data type according to data type, then It is matched by the field value range in table 1, and is given a mark to matching result, take the highest result of score value as knot Fruit can introduce question and answer mechanism and carry out secondary enquirement to user if there is multiple similar score values, by user to the result into Row confirmation.
It for finding the associated treatment process between each table, is illustrated by taking table 2 as an example, wherein transformer ginseng Number table " plant stand name " is associated with plant stand parameter list " number ";" area-name " of plant stand parameter list and " number " of region parameter table are closed Connection;" the high-end voltage class " of transformer parameter table is associated with " voltage class " of voltage class table.
The association of 2 tables of database of table
1, table Attribute/field 2, table Attribute/field
Transformer parameter table Plant stand name Plant stand parameter list Number
Plant stand parameter list Area-name Region parameter table Number
Transformer parameter table High-end voltage class Voltage class table Voltage class
According to the literary name section of table each in domain information, explanation of field, field type, the common expression of field, field value model It the information such as encloses, realizes the conversion of $ COL, $ OP, $ AGG to standardization SQL element, obtain executable SQL statement.
How many it is illustrated by taking " transformer each office, area 110kV please be search " as an example, the shape obtained after treatment Formula SQL statement are as follows:
Each office, area of select, $ FUN (transformer) where 110kV
According to step S112, $ COL, $ OP, $ FUN are replaced using standardized SQL element, is obtained:
(1) each office, area of Select, count (transformer) where 110kV
For the count function in Select sentence, there is the word that can be modified by it in front and back: each office, area, transformer, But count function only modifies one of word, and word in natural language is at this moment just analyzed by means of semantic dependency figure In the dependence of semantic level, as shown in figure 3, " lookup " is the core node of full sentence, it is denoted as " Root ", " asking " is " lookup " Emotag, be denoted as " mMOD ", " " and " lookup " are visitors concerning being to be denoted as " dCont ", and " office " and " " is consul pass System, is denoted as " Poss ", " each area " is the range role of " office ", is denoted as " Sco ", and " transformer " is the category thing role of " having ", is denoted as " Belg ", " a " are the quantity arrays of " transformer ", are denoted as " Qp ", and " how many " are the quantity roles of " a ", are denoted as " Quan ", " 110kV " is the description role of " transformer ", is denoted as " Desc ", " " be " 110kV " word mark, be denoted as " mAux ".By Fig. 3 is it is found that " how many " are therefore to count the quantity of transformer with count function for modifying " transformer ".
(2) the $ COL hidden in where sentence is found, is supplemented, is obtained:
Each office, area of Select, count (transformer) where voltage=110kV
$ COL corresponding table in the database is found to find the association between each table if being dispersed in multiple tables, obtain It arrives:
Select region parameter table title, count (voltage class table title)
From region parameter table, transformer parameter table, voltage class table, plant stand parameter list
Where region parameter table number=plant stand parameter list area-name AND voltage class table number=' 110kV'AND The high-end voltage class of transformer parameter table=voltage class table voltage class AND plant stand parameter list number=transformer parameter Table plant stand name
Wherein, specifically corresponding function is calculated FUN based on the text similarity of phonetic-stroke code, the specific corresponding behaviour of OP Make symbol to be calculated based on text semantic similarity, finally according to literary name section, explanation of field, field class in specific domain information The information such as type, field value range realize the conversion of $ COL, $ OP to standardization SQL element, obtain executable SQL statement, benefit With executable SQL statement, the inquiry to database is realized, due to being to remove building SQL using transformation model and SQL statement template The mode of sentence inquires database, compared with traditional keyword match, pattern match etc., is adapted to not go together The service system of industry improves the portability of data base querying, facilitates inquiry of the user to database.
The embodiment of the invention provides a kind of voice inquiry methods, wherein this method is applied to server, this method packet It includes: obtaining user speech, convert speech into Chinese text;Chinese text is handled, text vector is obtained;By text to Amount is input in preset transformation model, obtains output result;Transformation model is obtained by attention model training;Output is tied Fruit is input in preset SQL statement template, obtains formalization SQL statement according to preset semantic dependency relations;Obtain domain letter Breath;According to domain information and formalization SQL statement, executable SQL statement is obtained.The embodiment of the present invention is by digitizing the speech into processing At text vector, using the transformation model and SQL statement template and domain information pre-established, text vector is converted into can SQL statement is executed, database is inquired using executable SQL statement, simplifies the inquiry mode of database, and can fit The portability of data base querying should be improved in the data base querying of different service systems.
Corresponding to above method embodiment, emphasis of the embodiment of the present invention is described in the step S106 of foregoing invention embodiment, The specific training process of transformation model, as shown in Figure 4, the specific steps are as follows:
Step S402 obtains Chinese text sample;
The multiple speech samples for obtaining user in advance, convert multiple speech samples using speech software, obtain To the corresponding each Chinese text sample of each speech samples.
Step S404 handles Chinese samples of text, obtains text vector sample;
Each Chinese text sample is pre-processed, part-of-speech tagging and coding, it is corresponding to obtain each Chinese text sample Text vector sample.
Text vector sample is input in the attention model built in advance and is trained, converted by step S406 Model.
Text vector sample is input in the attention model built in advance, reality output result and ideal output are tied Fruit compares, and according to comparing result, adjusts the parameters of attention model, until model is restrained, obtains transformation model.
It can use cross-validation method transformation model is verified and adjusted, by obtaining a certain number of Chinese texts Chinese text sample is divided into specified number by sample, is handled Chinese samples of text, and each Chinese text sample is obtained At least corresponding text vector sample of portion Chinese text sample is input to modulus of conversion in turn by this corresponding text vector sample In type, reality output is obtained as a result, transformation model is calculated according to the comparison of reality output result and ideal output result Accuracy rate and recall rate.
Accuracy rate is reality output result and ideal output result is genuine Chinese text sample size and reality output It as a result is the ratio of genuine Chinese text sample size;Recall rate is reality output result and ideal output result is in genuine Literary samples of text quantity and ideal output result are the ratio of genuine Chinese text sample size.
Transformation model is adjusted according to accuracy rate and recall rate, makes its result in the treatment process to text vector It is more acurrate.
Attention model does not require encoder all to encode all input information among the vector of a regular length, phase Instead, encoder needs to input information coding at the sequence of a vector, and when decoding at this time, and each step can all select A subset is selected in the slave sequence vector of property to be further processed.In this way, when generating each output, it can Accomplish therefore the information for making full use of list entries to carry by being trained to attention model, obtains transformation model.
Transformation model shown in Figure 5 is Chinese text to conversion with " quantity for inquiring each office, area 110KV transformer " Model is illustrated, and by handling Chinese text, each vocabulary and each vocabulary for obtaining Chinese text are corresponding Part of speech is encoded according to each vocabulary of default rule, obtains text vector, using transformation model to text vector at Reason is exported as a result, attention model is when output, and can also generate one " attention range " indicates next output When which part of text vector paid close attention to, next output is then generated according to the region of concern, and so on, Obtain the corresponding output result of text vector.
The embodiment of the present invention by obtain Chinese text sample, Chinese samples of text is pre-processed, part-of-speech tagging and Coding, obtains text vector sample, text vector sample is input in the attention model built in advance, reality output is obtained As a result, reality output result and ideal actual result are compared, each of attention model is constantly adjusted according to comparing result A parameter, obtains transformation model, can also carry out further verifying and adjustment to transformation model by using cross-validation method, The conversion accuracy of transformation model is improved, does basis for the accuracy rate of subsequent processing.
Corresponding to above method embodiment, the embodiment of the invention also provides a kind of speech polling devices, as shown in fig. 6, Wherein, which is set to server, which includes:
Conversion module 60 converts speech into Chinese text for obtaining user speech;
Processing module 61 obtains text vector for handling Chinese text;
First output module 62 obtains output result for text vector to be input in preset transformation model;Conversion Model is obtained by attention model training;
Second output module 63 is input in preset SQL statement template, according to preset semanteme for that will export result Dependence obtains formalization SQL statement;
Module 64 is obtained, for obtaining domain information;
Third output module 65, for obtaining executable SQL statement according to domain information and formalization SQL statement.
Above-mentioned processing module 61 further include: preprocessing module obtains multiple words for pre-processing to Chinese text It converges;Pretreatment includes going to stop word, removing punctuate, participle;Part-of-speech tagging module is obtained for carrying out part-of-speech tagging to each vocabulary The part of speech of each vocabulary;Coding module obtains text vector for encoding according to default rule to each vocabulary.
A kind of speech polling device provided in an embodiment of the present invention by voice carry out conversion process, obtain text to Amount obtains formalization SQL statement, using domain information, to formalization using the transformation model and SQL statement template pre-established SQL statement is further standardized, and is obtained executable SQL statement, is looked into using executable SQL statement database It askes, simplifies the inquiry mode of database, and be adapted to the data base querying of different service systems, improve database and look into The portability of inquiry, meanwhile, user need to only input voice and can inquire database, improve the property easy to use of user With experience sense.
Speech polling device provided in an embodiment of the present invention has phase with voice inquiry method provided by the above embodiment Same technical characteristic reaches identical technical effect so also can solve identical technical problem.
The embodiment of the invention also provides a kind of electronic equipment as shown in fig. 7, electronic equipment 7 includes memory 71, processing Device 72, the computer program that can be run on processor 72 is stored in memory 71, and processor executes real when computer program The step of method that existing foregoing invention embodiment provides.
Referring to Fig. 7, electronic equipment further include: bus 73 and communication interface 74, processor 72, communication interface 74 and memory 71 are connected by bus 73;Processor 72 is for executing the executable module stored in memory 71, such as computer program.
Wherein, memory 71 may include high-speed random access memory (RAM, Random Access Memory), It may further include nonvolatile memory (non-volatile memory), for example, at least a magnetic disk storage.By at least One communication interface 74 (can be wired or wireless) realizes the communication between the system network element and at least one other network element Connection, can be used internet, wide area network, local network, Metropolitan Area Network (MAN) etc..
Bus 73 can be isa bus, pci bus or eisa bus etc..It is total that bus can be divided into address bus, data Line, control bus etc..Only to be indicated with a four-headed arrow in Fig. 7, it is not intended that an only bus or one convenient for indicating The bus of seed type.
Wherein, memory 71 is for storing program, and processor 72 executes program after receiving and executing instruction, and aforementioned Method performed by the device that the process that invention any embodiment discloses defines can be applied in processor 72, or by handling Device 72 is realized.
Processor 72 may be a kind of IC chip, the processing capacity with signal.During realization, above-mentioned side Each step of method can be completed by the integrated logic circuit of the hardware in processor 72 or the instruction of software form.Above-mentioned Processor 72 can be general processor, including central processing unit (Central Processing Unit, abbreviation CPU), network Processor (Network Processor, abbreviation NP) etc.;It can also be digital signal processor (Digital Signal Processing, abbreviation DSP), specific integrated circuit (Application Specific Integrated Circuit, referred to as ASIC), ready-made programmable gate array (Field-Programmable Gate Array, abbreviation FPGA) or other are programmable Logical device, discrete gate or transistor logic, discrete hardware components.It may be implemented or execute in the embodiment of the present invention Disclosed each method, step and logic diagram.General processor can be microprocessor or the processor is also possible to appoint What conventional processor etc..The step of method in conjunction with disclosed in the embodiment of the present invention, can be embodied directly in hardware decoding processing Device executes completion, or in decoding processor hardware and software module combination execute completion.Software module can be located at Machine memory, flash memory, read-only memory, programmable read only memory or electrically erasable programmable memory, register etc. are originally In the storage medium of field maturation.The storage medium is located at memory 71, and processor 72 reads the information in memory 71, in conjunction with Its hardware completes the step of above method.
The embodiment of the present invention also provide it is a kind of with processor can be performed non-volatile program code it is computer-readable Medium, program code make processor execute method described in aforementioned invention embodiment.
The computer-readable medium of the non-volatile program code provided in an embodiment of the present invention that can be performed with processor, With log recording method provided by the above embodiment, log recording apparatus technical characteristic having the same, so also can solve phase Same technical problem, reaches identical technical effect.
The computer program product of voice inquiry method, device provided by the embodiment of the present invention and electronic equipment, including The computer readable storage medium of the executable non-volatile program code of processor is stored, the instruction that program code includes can For executing previous methods method as described in the examples, specific implementation can be found in embodiment of the method, and details are not described herein.
It, can be with if the function is realized in the form of SFU software functional unit and when sold or used as an independent product It is stored in a computer readable storage medium.Based on this understanding, technical solution of the present invention is substantially in other words The part of the part that contributes to existing technology or the technical solution can be embodied in the form of software products, the meter Calculation machine software product is stored in a storage medium, including some instructions are used so that a computer equipment (can be a People's computer, server or network equipment etc.) it performs all or part of the steps of the method described in the various embodiments of the present invention. And storage medium above-mentioned includes: that USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), arbitrary access are deposited The various media that can store program code such as reservoir (RAM, Random Access Memory), magnetic or disk.
Finally, it should be noted that embodiment described above, only a specific embodiment of the invention, to illustrate the present invention Technical solution, rather than its limitations, scope of protection of the present invention is not limited thereto, although with reference to the foregoing embodiments to this hair It is bright to be described in detail, those skilled in the art should understand that: anyone skilled in the art In the technical scope disclosed by the present invention, it can still modify to technical solution documented by previous embodiment or can be light It is readily conceivable that variation or equivalent replacement of some of the technical features;And these modifications, variation or replacement, do not make The essence of corresponding technical solution is detached from the spirit and scope of technical solution of the embodiment of the present invention, should all cover in protection of the invention Within the scope of.Therefore, protection scope of the present invention should be based on the protection scope of the described claims.

Claims (10)

1. a kind of voice inquiry method, which is characterized in that the method is applied to server, which comprises
User speech is obtained, the voice is converted into Chinese text;
The Chinese text is handled, text vector is obtained;
The text vector is input in preset transformation model, output result is obtained;The transformation model passes through attention Model training obtains;
The output result is input in preset SQL statement template, is formalized according to preset semantic dependency relations SQL statement;
Obtain domain information;
According to the domain information and the formalization SQL statement, executable SQL statement is obtained.
2. obtaining text the method according to claim 1, wherein described handle the Chinese text The step of vector, comprising:
The Chinese text is pre-processed, multiple vocabulary are obtained;The pretreatment includes going to stop word, removing punctuate, participle;
Part-of-speech tagging is carried out to each vocabulary, obtains the part of speech of each vocabulary;
Each vocabulary is encoded according to default rule, obtains the text vector.
3. according to the method described in claim 2, it is characterized in that, described carry out each vocabulary according to default rule The step of coding, comprising:
Following processing step is executed to each vocabulary:
Obtain the part of speech of the vocabulary;
Obtain the part of speech of the adjacent words of the vocabulary;
According to the part of speech of the part of speech of the vocabulary and the adjacent words of the vocabulary, the vocabulary is encoded;
The coding result of multiple vocabulary of the Chinese text is gathered, the text vector is obtained.
4. the method according to claim 1, wherein what the transformation model was obtained by attention model training Step, comprising:
Obtain Chinese text sample;
The Chinese text sample is handled, text vector sample is obtained;
The text vector sample is input in the attention model built in advance and is trained, the modulus of conversion is obtained Type.
5. according to the method described in claim 4, it is characterized in that, the method also includes: using cross-validation method to described Transformation model is adjusted.
6. the method according to claim 1, wherein the domain information includes database table structure, literary name section, word It is a variety of in section explanation, field type, field value range and the common expression of field.
7. a kind of speech polling device, which is characterized in that described device is set to server, and described device includes:
The voice is converted into Chinese text for obtaining user speech by conversion module;
Processing module obtains text vector for handling the Chinese text;
First output module obtains output result for the text vector to be input in preset transformation model;Described turn Mold changing type is obtained by attention model training;
Second output module, for the output result to be input in preset SQL statement template, according to it is preset it is semantic according to The relationship of depositing obtains formalization SQL statement;
Module is obtained, for obtaining domain information;
Third output module, for according to the domain information and the formalization SQL statement, obtaining executable SQL statement.
8. device according to claim 7, which is characterized in that the processing module further include:
Preprocessing module obtains multiple vocabulary for pre-processing to the Chinese text;The pretreatment includes going to stop Word removes punctuate, participle;
Part-of-speech tagging module obtains the part of speech of each vocabulary for carrying out part-of-speech tagging to each vocabulary;
Coding module obtains the text vector for encoding according to default rule to each vocabulary.
9. a kind of electronic equipment, including memory, processor, be stored in the memory to run on the processor Computer program, which is characterized in that the processor realizes that the claims 1 to 6 are any when executing the computer program The step of method described in item.
10. a kind of computer-readable medium for the non-volatile program code that can be performed with processor, which is characterized in that described Program code makes the processor execute any one of the claim 1 to 6 the method.
CN201811440115.7A 2018-11-28 2018-11-28 Voice query method and device and electronic equipment Expired - Fee Related CN109542929B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811440115.7A CN109542929B (en) 2018-11-28 2018-11-28 Voice query method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811440115.7A CN109542929B (en) 2018-11-28 2018-11-28 Voice query method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN109542929A true CN109542929A (en) 2019-03-29
CN109542929B CN109542929B (en) 2020-11-24

Family

ID=65851196

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811440115.7A Expired - Fee Related CN109542929B (en) 2018-11-28 2018-11-28 Voice query method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN109542929B (en)

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110888897A (en) * 2019-11-12 2020-03-17 杭州世平信息科技有限公司 Method and device for generating SQL (structured query language) statement according to natural language
CN111159220A (en) * 2019-12-31 2020-05-15 北京百度网讯科技有限公司 Method and apparatus for outputting structured query statement
CN111177180A (en) * 2019-12-11 2020-05-19 北京百分点信息科技有限公司 Data query method and device and electronic equipment
CN111209297A (en) * 2019-12-31 2020-05-29 深圳云天励飞技术有限公司 Data query method and device, electronic equipment and storage medium
CN111324628A (en) * 2020-02-20 2020-06-23 山东爱城市网信息技术有限公司 Unified SQL query method based on Spark SQL
CN111538818A (en) * 2020-03-26 2020-08-14 深圳云天励飞技术有限公司 Data query method and device, electronic equipment and storage medium
CN111813989A (en) * 2020-07-02 2020-10-23 中国联合网络通信集团有限公司 Information processing method, device and storage medium
CN112650916A (en) * 2019-10-12 2021-04-13 青岛海信移动通信技术股份有限公司 Communication terminal and information query method
CN113051875A (en) * 2021-03-22 2021-06-29 北京百度网讯科技有限公司 Training method of information conversion model, and text information conversion method and device
CN113407534A (en) * 2021-06-02 2021-09-17 广州零端科技有限公司 Medical data recording method, query method and device
WO2021213160A1 (en) * 2020-11-27 2021-10-28 平安科技(深圳)有限公司 Medical query method and apparatus based on graph neural network, and computer device and storage medium
CN113986958A (en) * 2021-11-10 2022-01-28 北京有竹居网络技术有限公司 Text information conversion method and device, readable medium and electronic equipment
CN117271553A (en) * 2023-09-08 2023-12-22 上海浦东发展银行股份有限公司 Method for generating and operating supervision report data quality rule

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101415259A (en) * 2007-10-18 2009-04-22 三星电子株式会社 System and method for searching information of embedded equipment based on double-language voice enquiry
CN104021198A (en) * 2014-06-16 2014-09-03 北京理工大学 Relational database information retrieval method and device based on ontology semantic index
US20160255139A1 (en) * 2016-03-12 2016-09-01 Yogesh Chunilal Rathod Structured updated status, requests, user data & programming based presenting & accessing of connections or connectable users or entities and/or link(s)
CN106980689A (en) * 2017-03-31 2017-07-25 邢加和 A kind of method that data visualization is realized by interactive voice
CN108287822A (en) * 2018-01-23 2018-07-17 北京容联易通信息技术有限公司 A kind of Chinese Similar Problems generation System and method for

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101415259A (en) * 2007-10-18 2009-04-22 三星电子株式会社 System and method for searching information of embedded equipment based on double-language voice enquiry
CN104021198A (en) * 2014-06-16 2014-09-03 北京理工大学 Relational database information retrieval method and device based on ontology semantic index
US20160255139A1 (en) * 2016-03-12 2016-09-01 Yogesh Chunilal Rathod Structured updated status, requests, user data & programming based presenting & accessing of connections or connectable users or entities and/or link(s)
CN106980689A (en) * 2017-03-31 2017-07-25 邢加和 A kind of method that data visualization is realized by interactive voice
CN108287822A (en) * 2018-01-23 2018-07-17 北京容联易通信息技术有限公司 A kind of Chinese Similar Problems generation System and method for

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
程志强: "基于语音识别与文字理解的导购机器人设计与实现", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112650916A (en) * 2019-10-12 2021-04-13 青岛海信移动通信技术股份有限公司 Communication terminal and information query method
CN110888897A (en) * 2019-11-12 2020-03-17 杭州世平信息科技有限公司 Method and device for generating SQL (structured query language) statement according to natural language
CN111177180A (en) * 2019-12-11 2020-05-19 北京百分点信息科技有限公司 Data query method and device and electronic equipment
CN111159220A (en) * 2019-12-31 2020-05-15 北京百度网讯科技有限公司 Method and apparatus for outputting structured query statement
CN111209297A (en) * 2019-12-31 2020-05-29 深圳云天励飞技术有限公司 Data query method and device, electronic equipment and storage medium
CN111324628A (en) * 2020-02-20 2020-06-23 山东爱城市网信息技术有限公司 Unified SQL query method based on Spark SQL
CN111538818A (en) * 2020-03-26 2020-08-14 深圳云天励飞技术有限公司 Data query method and device, electronic equipment and storage medium
CN111813989B (en) * 2020-07-02 2023-07-18 中国联合网络通信集团有限公司 Information processing method, apparatus and storage medium
CN111813989A (en) * 2020-07-02 2020-10-23 中国联合网络通信集团有限公司 Information processing method, device and storage medium
WO2021213160A1 (en) * 2020-11-27 2021-10-28 平安科技(深圳)有限公司 Medical query method and apparatus based on graph neural network, and computer device and storage medium
CN113051875A (en) * 2021-03-22 2021-06-29 北京百度网讯科技有限公司 Training method of information conversion model, and text information conversion method and device
CN113051875B (en) * 2021-03-22 2024-02-02 北京百度网讯科技有限公司 Training method of information conversion model, and text information conversion method and device
CN113407534A (en) * 2021-06-02 2021-09-17 广州零端科技有限公司 Medical data recording method, query method and device
CN113407534B (en) * 2021-06-02 2023-11-28 广州零端科技有限公司 Medical data recording method, query method and device
CN113986958A (en) * 2021-11-10 2022-01-28 北京有竹居网络技术有限公司 Text information conversion method and device, readable medium and electronic equipment
CN113986958B (en) * 2021-11-10 2024-02-09 北京有竹居网络技术有限公司 Text information conversion method and device, readable medium and electronic equipment
CN117271553A (en) * 2023-09-08 2023-12-22 上海浦东发展银行股份有限公司 Method for generating and operating supervision report data quality rule

Also Published As

Publication number Publication date
CN109542929B (en) 2020-11-24

Similar Documents

Publication Publication Date Title
CN109542929A (en) Voice inquiry method, device and electronic equipment
CN112528672B (en) Aspect-level emotion analysis method and device based on graph convolution neural network
CN108363790B (en) Method, device, equipment and storage medium for evaluating comments
TWI664540B (en) Search word error correction method and device, and weighted edit distance calculation method and device
CN108304468B (en) Text classification method and text classification device
CN105893476B (en) Intelligent answer method, knowledge base optimization method and device, Intelligence repository
CN105095204B (en) The acquisition methods and device of synonym
CN104199965B (en) Semantic information retrieval method
CN107204184A (en) Audio recognition method and system
CN108804428A (en) Correcting method, system and the relevant apparatus of term mistranslation in a kind of translation
CN111125334A (en) Search question-answering system based on pre-training
CN109345282A (en) A kind of response method and equipment of business consultation
CN105389307A (en) Statement intention category identification method and apparatus
WO2021068683A1 (en) Method and apparatus for generating regular expression, server, and computer-readable storage medium
EP1016074A1 (en) Text normalization using a context-free grammar
CN111782763A (en) Information retrieval method based on voice semantics and related equipment thereof
CN110188926B (en) Order information prediction system and method
CN106980620A (en) A kind of method and device matched to Chinese character string
CN114118065A (en) Chinese text error correction method and device in electric power field, storage medium and computing equipment
CN109582954A (en) Method and apparatus for output information
CN110309282A (en) A kind of answer determines method and device
CN115048944A (en) Open domain dialogue reply method and system based on theme enhancement
CN109189907A (en) A kind of search method and device based on semantic matches
CN109542968A (en) One kind calculating data processing method and device based on VASP software
CN106776695A (en) The method for realizing the automatic identification of secretarial document value

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
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20201124

Termination date: 20211128