CN103838713A - Semantics analyzing method based on regular expression - Google Patents

Semantics analyzing method based on regular expression Download PDF

Info

Publication number
CN103838713A
CN103838713A CN201410120061.1A CN201410120061A CN103838713A CN 103838713 A CN103838713 A CN 103838713A CN 201410120061 A CN201410120061 A CN 201410120061A CN 103838713 A CN103838713 A CN 103838713A
Authority
CN
China
Prior art keywords
combination
service
semantic analysis
text message
regular expression
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
CN201410120061.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.)
Individual
Original Assignee
Individual
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 Individual filed Critical Individual
Priority to CN201410120061.1A priority Critical patent/CN103838713A/en
Publication of CN103838713A publication Critical patent/CN103838713A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention discloses a semantics analyzing method based on a regular expression. The semantics analyzing method includes the following steps that a regular expression combination database is set up and a mapping relation is set up between all combinations and services; text information corresponding to voice input of a user is obtained, combined and matched; the services correlated with matched combinations are executed. The processing means of the method is quite transparent, a developer can easily perform further optimization as needed, and semantic analysis is accurate, flexible and high in executing efficiency.

Description

A kind of semantic analysis based on regular expression
[technical field]
The present invention relates to semantic analysis field, relate in particular to a kind of semantic analysis based on regular expression.
[background technology]
Semantic analysis technology is widely used in actual life, as the siri service of iphone, and news fly voice service, Baidu's voice service etc., all can provide search service and other services based on voice command for user, its Main is: first speech data is converted to text message, then utilize text matches mode search key, export corresponding project according to key word, carry out semantic analysis by keyword merely, but we know, semantic analysis mode in these services inevitably has following several defect: the one, because the content of identification is too wide in range, need a large amount of third party's general semantics identification kits, cause program volume too fat to move, recognition efficiency is low, the 2nd, according to the project of the semantic output of identification, without specific aim, execution efficiency is low, the 3rd, adopt very complicated and opaque processing procedure, make to be not easy to software to make intense adjustment.Therefore, identification, execution efficiency etc. are had to the running car environment of requirements at the higher level, be necessary to provide a set of new semantic analysis scheme.
[summary of the invention]
For the problems referred to above, the invention provides a kind of semantic analysis based on regular expression, it not only has the advantage that recognition efficiency is high, execution efficiency is high, can also make according to demand intense adjustment.
Concrete technical scheme is as follows:
Based on a semantic analysis for regular expression, comprise step:
Set up regular expression combination according to key word, and the combination of establishment is stored in database in advance to the associated one or more service of each combination;
Obtain user speech and input corresponding text message, the coupling that described text message is combined;
Carry out the associated service of combination of coupling.
People can be according to required service, sets in advance corresponding with it combination; After user's speech conversion is text message, automatically detect the combination that whether contains coupling in text message, then according to the combination of coupling, carry out service accordingly: first, customizedization of the present invention degree is very high, by regular expression, key word is combined, and mate by regular expression, because regular expression is international text-processing rule, therefore process means very transparent, developer can finely tune as required, and it is theoretical to have evaded abstruse semanteme identification; Secondly, the present invention is accurate identification range, has simplified identification process, has simplified sequential operation resource; Finally, the mode that the present invention has adopted key word or combination to be associated with the concrete service of carrying out, execution efficiency effectively improves.
[accompanying drawing explanation]
Fig. 1 is method flow diagram of the present invention.
[embodiment]
In order to make the object, technical solutions and advantages of the present invention more clear, be described in further detail below in conjunction with drawings and embodiments.
Semantic analysis based on regular expression of the present invention, can be the APP software based in the operating systems such as ios, Android, WP, its carrier is mainly mobile terminal, it can be widely used in semantic analysis field, but it should be noted that, this method is especially applicable to being applied in vehicle, as being applied on vehicle navigator, obviously, on vehicle navigator, implant software corresponding to this method, can make it in semantic analysis efficiency and execution efficiency, be increased dramatically.Below by a preferred embodiment, the solution of the present invention is done to concrete introduction.
In addition, regular expression is international text-processing rule, but do not get rid of all big enterprises and carry out regular fine setting, its concrete using method can be with reference to disclosed document on internet, will not describe in detail herein, certainly, in order to help those skilled in the art better to understand, the symbol repeatedly using in meeting brief introduction present specification hereinafter, and can intert and set forth by way of example hereinafter.
Semantic analysis based on regular expression of the present invention, comprises step:
S1, set up regular expression combination according to key word, and the combination of establishment is stored in database in advance to the associated one or more service of each combination;
In the time that developer intends a service, first to find people in the time requiring this service, the usual term that can say, find out the general character in multiple usual terms, be key word, then according to these key words, by the rule of regular expression, set up the regular expression combination containing these key words, then the service of this combination and its correspondence is carried out associated; In the time that developer need to develop a whole set of service, need for the associated different combination respectively of the various service in a whole set of service, these combinations are stored in database in advance, supply to call when needs;
It should be noted that, when only using a key word or keyword just can pricise position service time, can set up this key word or keyword carries out associated with corresponding service, this key word or keyword can be stored in database, certainly, for unitarity, the form that also single key word or single keyword can be converted to regular expression combination is stored in database;
The present embodiment is preferably the only associated service of each combination, the benefit of doing is like this, after the content in text message successfully matches corresponding combination, just can carry out immediately the associated service of combination, therefore have execution efficiency more efficiently, be particularly useful in the vehicle of running at high speed of time requirement;
It should be noted that, interrelational form is not relation one to one, i.e. mapping relations between " combination-service ", it can be one-to-one relationship, can be many-to-one mapping relations, can certainly be the mapping relations of one-to-many, be below to set up many-to-one mapping relations in specific embodiment;
S2, obtain user speech and input corresponding text message, the coupling that described text message is combined;
According to canonical formula matched rule, the combination in the content in text message and database is mated, detect and in text message, whether have the combination of coupling to exist;
It should be noted that, each is combined in when text message is traveled through to the coupling of formula, is the coupling one by one with succession, specifically can adopt positive sequence or inverted order, but for high efficiency, the present invention does not repel other efficient retrieval or matching way;
The associated service of combination of S3, execution coupling;
In the time detecting that in text message the combination of coupling exists, carry out the associated service of this combination.
In a preferred embodiment, also has the functional parameter that is provided with of part combination correspondence, if text message and certain combinations matches, and this combination correspondence be provided with functional parameter, need to extract described functional parameter in the corresponding position of text message, if extract less than, the request of sending prompting user input capability parameter.
For example user speech input " airport, Bao'an, upper Shenzhen is gone ", this voice messaging is converted to after text message, the combinations matches of text message and " (upper .+) ", and this combination is just provided with a functional parameter that characterizes address information, therefore after coupling, will " on " extract an address information " airport, Bao'an, Shenzhen " in text message below, and finally output to the navigation circuit on " airport, Bao'an, Shenzhen ".
In addition, combination is also to there being additional parameter at least partly, as in the combination of " (upper .+) " except related information, also there is additional information, this additional information be to investigate " Shanghai ", " Shangyu " etc. take " on " as beginning address, can find out, it is a kind of to the supplementary of effective information or the eliminating to invalid information that additional parameter can be understood as.
In step S3, before carrying out corresponding service, also comprise the step of confirmation or further selective acknowledgement: so-called confirmation, the confirmation of " whether being " before carrying out, if the combination of " (upper .+) " is after the match is successful with " airport, Bao'an, upper Shenzhen is gone ", should output to the navigation circuit on " airport, Bao'an, Shenzhen ", but before this service of execution, have a confirmation as " whether PLSCONFM navigates to airport, Bao'an, Shenzhen ", if obtain after user's confirmation, carry out immediately this service, output to the navigation circuit on " airport, Bao'an, Shenzhen "; What is called is further optionally confirmed, " to east, airport, Bao'an, Shenzhen, arrives west, airport, Bao'an, Shenzhen, PLSCONFM " as output, after user confirms, then exports corresponding navigation circuit.
Adopt a specific embodiment below, be illustrated.
In this embodiment, be associated with mapping relations between the key word of a service or combination and functional parameter, service as follows:
Figure BDA0000483247500000051
Figure BDA0000483247500000071
As can be seen from the above table, what part combination was corresponding is provided with functional parameter, and be many-to-one mapping relations between the combination in the present embodiment and service, in addition, above table is not limited to the present invention, combination and corresponding service thereof can be added according to demand or delete, are not repeated herein.
Wherein, the canonical formula symbol of using in form is as follows:
" | ": represent two matching conditions to carry out logical "or", for example " artificial | customer service ", if there is " manually " or " customer service " all same services of execution of correspondence in text message, between them, there is replaceability;
". ": any single character or the multiple character of coupling except " n ", (in this definition, a Chinese character is a character);
" * ": zero degree, one or many mate character or subexpression above, for example, zo* can mate " z ", " zo " and " zoo ";
" .* ": coupling zero, one or more character;
" .+ ": mate one or more characters;
"? ": zero degree or once coupling character or subexpression above.For example, " do (es) " can mate " do " in " do " or " does ";
"+": one or many mates character or subexpression above.For example, ' zo+' can mate " zo " and " zoo ", but can not mate " z ";
" () ": the beginning of a subexpression and end position.
The definition of cited canonical formula symbol above, is not used for limiting the present invention, selects several typical examples below form is made an explanation:
1, " (stop | closing | exit | cancel | finish) navigation ": if retrieve any one in " stopping navigation ", " closing navigation ", " exiting navigation ", " cancelling navigation ", " finishing navigation " in text message, all corresponding execution " stop navigation ";
2, " (| to) .* (which | that | place) ": if 1. in text message, retrieve " " or " arriving ", and this " " or " to " closelyed follow below " where " or " that " or " place ", as " to which ", represent text information and combination " (| to) .* (which | that | place) " mate, then, carry out corresponding service, export current location; If 2. in text message, retrieve " " or " arriving ", and this " " or " arriving " below immediately following a character or multiple identical character, and after this character or multiple identical character immediately following having " where " or " that " or " place ", as " to where ", " to what what place ", " one by one one one by one that ", represent text information and combination " (| to) .* (which | that | place) " mate, then, carry out corresponding service, export current location;
3, " (dial | dial | make a call)+(individual) (| mobile phone | number)+(to | to | go | to | past) (.+) ": wherein, " individual " can occur once or zero degree, " (give | to | go | to | past) " can occur once equally or zero degree, " (.+) " indicates one or more characters, for example: " making a phone call to Xiao Ming ", " phone Xiao Ming ", " 1387040XXXX of making a phone call " etc., we notice, this combination also needs the functional parameter extracting, and functional parameter is the 5th parameter, i.e. character in " (.+) ", for example, in " phoning Xiao Ming ", " Xiao Ming " is extracted as functional parameter, then, start the function called and the number of " Xiao Ming " from telephone directory,
4, " (give | to | go | to | past)+(.+) (send out | return)+(individual | bar) (note | message | information)+": wherein, " (give | to | go | to | past) " can there is one or many, there are afterwards one or more characters, " (send out | return) " can there is one or many, " (individual | bar) " can occur once or zero degree, " (note | message | information) " can there is one or many, illustrate: " sending out clockwork spring note note note to Xiao Ming ", " obviously send short messages to little " etc., we notice, this combination also needs the functional parameter extracting, and functional parameter is second parameter, i.e. character in " (.+) ", for example, in " giving the little note of obviously returning ", " Xiao Ming " is extracted as functional parameter, then, start note interface, and the number that finds " Xiao Ming " from telephone directory is inserted in note sender,
5, " micro-letter ": if retrieved in text message, carry out corresponding service, and start micro-letter;
6, above and non exhaustive.
It should be noted that, Ben Biaoge is due to the restriction of page paper, and unlisted additional parameter, enumerates several elaboration below:
1, will retrieve " weather " this key word time, whether retrieval has address to exist, and using the address retrieving as additional parameter, for output service more accurately, in the time not retrieving, can point out user's Input Address information or take local address as default address;
2, coupling combination " (upper .+) (how to get to | how to go | how to | how to navigate | how to look for | how to walk | how far have | how far) ", in " (upper .+) ", " Shanghai ", " Shangyu " etc. using " on " address that starts gets rid of as additional parameter;
3, " listening (song | song | music) of (.+) " can be using singing songs person as additional parameter;
4, " listen (.+) ", " (song | song | music) (.*) " can be using song title as additional parameter;
5, looking for the corresponding combination of ambient services, " car owner ", " user ", " good friend ", " friend ", " who " etc. got rid of as additional parameter about the key word for searching periphery car owner;
6, above and non exhaustive.
In addition, the semantic analysis engine based on server is not only identified in the language that so-called specific area uses, and is also identified in the various word languages in nonspecific field.
Above-described embodiment of the present invention, does not form limiting the scope of the present invention.Any modification of doing within the spirit and principles in the present invention, be equal to and replace and improvement etc., within all should being included in claim protection domain of the present invention.

Claims (7)

1. the semantic analysis based on regular expression, is characterized in that, comprises step:
Set up regular expression combination according to key word, and the combination of establishment is stored in database in advance to the associated one or more service of each combination;
Obtain user speech and input corresponding text message, the coupling that described text message is combined;
Carry out the associated service of combination of coupling.
2. semantic analysis according to claim 1, it is characterized in that, what combination was corresponding at least partly is provided with functional parameter, carries out parameter extraction or send prompting user inputting the request of described functional parameter according to the residing position of this functional parameter from text message.
3. semantic analysis according to claim 2, is characterized in that, combination is also to there being additional parameter at least partly.
4. semantic analysis according to claim 1, is characterized in that, described combination is mated described text message by the order of setting.
5. according to the semantic analysis described in claim 1,2,3 or 4, it is characterized in that, before carrying out corresponding service, also comprise the step of confirmation or further selective acknowledgement.
6. semantic analysis according to claim 1, is characterized in that, described in be associated with the key word of one or more service or combination and comprise any one or more in following form, the mapping relations between they and service are as follows:
Figure FDA0000483247490000011
Figure FDA0000483247490000021
Figure FDA0000483247490000031
7. semantic analysis according to claim 6, is characterized in that, described in be provided with the combination of functional parameter, the position of its functional parameter in combination is as follows:
Figure FDA0000483247490000032
CN201410120061.1A 2014-03-27 2014-03-27 Semantics analyzing method based on regular expression Pending CN103838713A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410120061.1A CN103838713A (en) 2014-03-27 2014-03-27 Semantics analyzing method based on regular expression

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410120061.1A CN103838713A (en) 2014-03-27 2014-03-27 Semantics analyzing method based on regular expression

Publications (1)

Publication Number Publication Date
CN103838713A true CN103838713A (en) 2014-06-04

Family

ID=50802229

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410120061.1A Pending CN103838713A (en) 2014-03-27 2014-03-27 Semantics analyzing method based on regular expression

Country Status (1)

Country Link
CN (1) CN103838713A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104915334A (en) * 2015-05-29 2015-09-16 浪潮软件集团有限公司 Automatic extraction method of key information of bidding project based on semantic analysis
CN105355200A (en) * 2015-11-20 2016-02-24 深圳狗尾草智能科技有限公司 System and method for training and modifying interactive content of robot directly
CN106713111A (en) * 2015-11-17 2017-05-24 腾讯科技(深圳)有限公司 Processing method for adding friends, terminal and server
CN107608981A (en) * 2016-07-11 2018-01-19 顺丰科技有限公司 Character match method and system based on regular expression
CN109727598A (en) * 2018-12-28 2019-05-07 浙江省公众信息产业有限公司 Intension recognizing method under big noise context
CN109727594A (en) * 2018-12-27 2019-05-07 北京百佑科技有限公司 Method of speech processing and device
CN109766551A (en) * 2019-01-08 2019-05-17 广东小天才科技有限公司 A kind of determination method and system of polysemant semanteme

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102930054A (en) * 2012-11-19 2013-02-13 北京奇虎科技有限公司 Data search method and data search system
CN103268313A (en) * 2013-05-21 2013-08-28 北京云知声信息技术有限公司 Method and device for semantic analysis of natural language
CN103400579A (en) * 2013-08-04 2013-11-20 徐华 Voice recognition system and construction method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102930054A (en) * 2012-11-19 2013-02-13 北京奇虎科技有限公司 Data search method and data search system
CN103268313A (en) * 2013-05-21 2013-08-28 北京云知声信息技术有限公司 Method and device for semantic analysis of natural language
CN103400579A (en) * 2013-08-04 2013-11-20 徐华 Voice recognition system and construction method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
YE-YI WANG 等: "Creating Speech Recognition Grammars from Regular Expressions for Alphanumeric Concepts", 《INTERNATIONAL CONFERENCE ON SPOKEN LANGUAGE PROCESSING》, 31 December 2004 (2004-12-31), pages 2161 - 2164 *
宋鑫坤 等: "基于正则表达式的语音识别控制策略研究", 《计算机技术与发展》, vol. 20, no. 2, 28 February 2010 (2010-02-28), pages 106 - 113 *

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104915334A (en) * 2015-05-29 2015-09-16 浪潮软件集团有限公司 Automatic extraction method of key information of bidding project based on semantic analysis
CN106713111A (en) * 2015-11-17 2017-05-24 腾讯科技(深圳)有限公司 Processing method for adding friends, terminal and server
CN106713111B (en) * 2015-11-17 2020-04-07 腾讯科技(深圳)有限公司 Processing method for adding friends, terminal and server
CN105355200A (en) * 2015-11-20 2016-02-24 深圳狗尾草智能科技有限公司 System and method for training and modifying interactive content of robot directly
CN107608981A (en) * 2016-07-11 2018-01-19 顺丰科技有限公司 Character match method and system based on regular expression
CN107608981B (en) * 2016-07-11 2021-11-12 深圳市丰驰顺行信息技术有限公司 Character matching method and system based on regular expression
CN109727594A (en) * 2018-12-27 2019-05-07 北京百佑科技有限公司 Method of speech processing and device
CN109727594B (en) * 2018-12-27 2021-04-09 北京百佑科技有限公司 Voice processing method and device
CN109727598A (en) * 2018-12-28 2019-05-07 浙江省公众信息产业有限公司 Intension recognizing method under big noise context
CN109766551A (en) * 2019-01-08 2019-05-17 广东小天才科技有限公司 A kind of determination method and system of polysemant semanteme

Similar Documents

Publication Publication Date Title
CN103838713A (en) Semantics analyzing method based on regular expression
US20190081914A1 (en) Method and apparatus for generating candidate reply message
KR101267006B1 (en) A method of linking online document and instnt message and a mobile terminal linking online document and instnt message in a chatting window of instnt messaging service
KR101768509B1 (en) On-line voice translation method and device
CN104919522A (en) Distributed NLU/NLP
RU2525440C2 (en) Markup language-based selection and utilisation of recognisers for utterance processing
WO2017151400A1 (en) Interpreting and resolving conditional natural language queries
US20200081884A1 (en) Processing method and device of the user input information
CN102215233A (en) Information system client and information publishing and acquisition methods
CN103384290A (en) Mobile terminal with positioning and navigation functions and fast positioning and navigation method of mobile terminal
US20150186455A1 (en) Systems and methods for automatic electronic message annotation
US20170249934A1 (en) Electronic device and method for operating the same
CN107209757B (en) Natural language understanding buffer
CN103377652A (en) Method, device and equipment for carrying out voice recognition
CN101662541A (en) Prompting method, system and mobile terminal of related information of contact persons at mobile terminal
US20190303384A1 (en) Method and system for consolidating data retrieved from different sources
KR101594835B1 (en) Vehicle and head unit having voice recognizing function, and method for voice recognizning therefor
EP2908562B1 (en) Address book information service system, and method and device for address book information service therein
CN101405693A (en) Personal synergic filtering of multimodal inputs
CN104750718A (en) Data information search method and data information search device
JP2008305385A (en) Character input device, server device, dictionary download system, method for presenting conversion candidate phrase, information processing method, and program
US9930168B2 (en) System and method for context aware proper name spelling
CN104239371B (en) A kind of command information processing method and processing device
CN102970401A (en) Method and device for recoding contact information
KR101858544B1 (en) Information processing method and apparatus

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20140604