1. Field of Invention
The present invention relates to the field of natural language processing, and in particular to a device and method for adaptive service selection, a system and method for adaptive service selection as well as a query system and method.
2. Description of Prior Art
With the continuous development of the information technology, it becomes desirable that any required information can be queried and found in a rapid and convenient way. In order to meet various query requirements from users, relevant companies have offered all kinds of services, such as traffic service, yellowpage service, weather service and the like, regarding almost all aspects of our life. A service selection system based on natural language allows a user to query various services with natural language, and then the system selects any service corresponding to the user's query from these services and feeds the answer back to the user.
The conventional service selection system generally finds out the service corresponding to the user's query in natural language according to certain predefined service mapping rules. If some flexible natural language query is not encompassed by the predefined service mapping rules, however, the system fails to find the service corresponding to the user query, and thus the user cannot obtain the expected service.
Patent Application No. JP2002351913 proposes a method in which a web service having optimal waiting time can be selected from all types of web services according to the history of user access to these web services (which particularly contains user name, longest waiting time, service type, latest access time, etc.) so as to avoid excessive load on network and service.
Patent Application No. JP2004054781 discloses a method which can extracts key words for retrieval from a user query in natural language and then select from various services the service and its invocation interface corresponding to the key words for retrieval.
Patent Application No. JP2004288118 provides a method which can, based on service register data supplied by a service provider, select a service corresponding to a user query and other services relevant to the service from a plurality of services.
In conclusion, all the existing methods find a service corresponding to a user query based on certain predefined service mapping rules, and thus neither of them can handle a user query uncovered by the service mapping rules as well as automatically find any new service mapping rule. It remains as a difficult and critical problem that how to process a query uncovered by the predefined service mapping rules and to automatically find any new service mapping rule.
The present invention is made to address the above problems. The present invention provides an adaptive service selection device and method as well as a query system and method, which can dynamically generate a service mapping rule not contained in a service mapping rule base predefined in the system so that a service corresponding to a query entered by a user can be found by adding the corresponding service mapping rule even if it is not included in the service mapping rule base. The system of the present invention improves accuracy in natural language service selection since it can not only process a natural language query covered by predefined service mapping rules but also handle any natural language query not included in these rules and automatically find a new service mapping rule.
According to the first aspect of the present invention, a device for adaptive service selection is provided, comprising: a semantic analyzing means which analyzes a query from a user semantically; an adaptive service selecting means which generates a new service mapping rule so as to obtain a selected service, when the semantically-analyzed query does not match with a rule in a service mapping rule base; and a retrieving means which retrieves and obtains an answer according to the selected service.
According to the second aspect of the present invention, a method for adaptive service selection is provided, comprising: a semantic analyzing step of analyzing a query from a user semantically; an adaptive service selecting step of generating a new service mapping rule so as to obtain a selected service, when the semantically-analyzed query does not match with a rule in a service mapping rule base; and a retrieving step of retrieving and obtaining an answer according to the selected service.
A system for adaptive service selection and the related method are provided according to the third and fourth aspects of the present invention.
According to the fifth aspect of the present invention, a query system is provided, comprising: a query receiver which receives a query from a user; a semantic analyzing device which analyzes the query semantically; a determining device which determines whether a rule accurately matched with the query can be found in a service mapping rule base, and sends the semantically analyzed query to an accurate service selecting device or an adaptive service selecting device; an accurate service selecting device which extracts from the accurately matched rule a service type to which the query belongs so as to obtain a first selected service; an adaptive service selecting device which generates a new service mapping rule so as to obtain a second selected service, when the accurately matched rule can not be found in the service mapping rule base; a retrieving device which retrieves and obtains an answer according to the first selected service or the second selected service; and an answer sender which sends the retrieved answer to the user.
According to the sixth aspect of the present invention, a query method is provided, comprising: a query receiving step of receiving a query from a user; a semantic analyzing step of analyzing the query semantically; a determining step of determining whether a rule accurately matched with the user query can be found in a service mapping rule base, and sending the semantically analyzed query to an accurate service selecting step or an adaptive service selecting step; an accurate service selecting step of extracting the service type and service parameters from the accurately matched rule, so as to obtain a first selected service; an adaptive service selecting step of generating a new service mapping rule so as to obtain a second selected service, when the accurately matched rule can not be found in the service mapping rule base; a retrieving step of retrieving and obtaining an answer according to the first selected service or the second selected service; and an answer sending step of sending the retrieved answer to the user.
a is a schematic diagram showing a system for adaptive service selection according to the present invention;
b is a flowchart showing a method for adaptive service selection according to the present invention;
a is an exemplary block diagram showing a service mapping rule base according to the present invention;
b is a flowchart showing a method for generating the service mapping rule base;
a is a schematic diagram showing a device for adaptive service selection according to the present invention;
b is a flowchart showing a method for adaptive service selection according to the present invention;
a is a schematic diagram showing an adaptive service selecting section based on the service mapping rule base according to the present invention;
b is a flowchart showing an adaptive service selecting method based on the service mapping rule base according to the present invention;
c shows an example of adaptive service selection based on the service mapping rule base;
a is a schematic diagram showing an adaptive service selecting section based on the user query history base according to the present invention;
b is a flowchart showing an adaptive service selecting method based on the user query history base according to the present invention;
c shows an example of adaptive service selection based on the user query history base;
a is a schematic diagram showing an adaptive service selecting section based on a service response according to the present invention;
b is a flowchart showing an adaptive service selecting method based on the service response according to the present invention;
c shows an example of adaptive service selection based on the service response;
a and 11b show a device for adaptive service selection used in a mobile terminal and an ASP, respectively;
a and 12b show flowcharts of two methods for retrieval control, respectively.
Hereafter, a description will be made to the preferred embodiments of the present invention with reference to the figures, throughout which like elements are denoted by like reference symbols or numbers. In the following description, the details of any known function or configuration will not be repeated, otherwise they may obscure the subject of the present invention.
a is a schematic diagram showing a system for adaptive service selection according to the present invention. The system comprises a receiving/transmitting device, an adaptive service selecting device 20 and a storage device. The receiving/transmitting device includes a query receiver 101 for receiving a natural-language-based user query inputted by a user via a mobile terminal, such as a mobile phone, an answer sender 102 for sending to the user a retrieved answer corresponding to the user query. The storage device includes a service mapping rule base 301 and a user query history base 302. The adaptive service selecting device 20 functions to process a query that can be covered by neither of the service mapping rules in the service mapping rule base and add a new service mapping rule automatically, so that a service corresponding to the user query can be selected from all the service contained in the service mapping rule base even if neither of the service mapping rules in the base can match with the user query. The adaptive service selecting device 20 comprises a semantic analyzing means 201 which analyzes the received natural language query to obtain a structured semantic analysis result, an adaptive service selecting means 202 which supplements the rules in the service mapping rule base 301 by searching the service mapping rule base 301 and the user query history base 302 based on the semantic analysis result or by utilizing an retrieved answer from a service provider so as to obtain a selected service, a retrieving means 203 which retrieves and obtains an answer based on the selected service. Alternatively, the system can access a service mapping rule base and a user query history base external to the system instead of including internally the service mapping rule base 301 and the user query history base 302.
b shows a flowchart of the method for adaptive service selection. At S101, the query receiver 101 receives a natural-language-based user query sent from a user via a mobile terminal, such as a mobile phone, and transmits the query to the semantic analyzing means 201, which analyzes the received natural-language-based user query at S102.
At S103, when not finding any matched service mapping rule in the service mapping rule base, the adaptive service selecting means 202 can supplement the service mapping rule base automatically, that is, the adaptive service selecting means 202 supplements the rules in the service mapping rule base 301 by searching the service mapping rule base 301 and the user query history base 302 based on the semantic analysis result or by interacting with a service provider and utilizing an retrieved answer from the service provider, so as to obtain a selected service.
At S104, the retrieving means 203 retrieves a corresponding answer based on the selected service.
The retrieving means 203 may return only the answer corresponding to the user query, as shown in
(1) information search, that is, finding the service provider corresponding to the service type in the selected service and then sending the service parameters in the selected service to the service provider which will search and return a corresponding retrieved result; and
(2) answer generation, that is, generating the final answer according to the retrieved result returned by the service provider.
An integration is required for respective retrieved results if there are a number of service providers. The integration can be implemented in any relevant known method, such as ranking these results based on the credit standing of each service provider.
For the above example of the user query “which route can I take to Hailong Building from Tsinghua East Gate?”, according to the selected service “service type: route; start: Tsinghua East Gate; destination: Hailong Building”, the system can find service providers corresponding to the service type “route”, such as Baidu map, Sogou map, Google map, etc., then sends the parameters “start: Tsinghua East Gate; destination: Hailong Building” to these service provider and receives and integrates the retrieved results from them.
The retrieving means 203 can also return other relevant answers, as shown in
The retrieved answer is sent to the user terminal by the answer sender 102 at S105.
In the present invention, the system for adaptive service selection utilizes the service mapping rule base 301 and the user query history base 302 to add a service mapping rule not included in the service mapping rule base 301 and therefore selects a service corresponding to the user query. Accordingly, the following description is made to the service mapping rule base and the user query history base with respect to
The service mapping rule base 301 stores multiple sets of service mapping rules. When the match is established between the user query in natural language and a service mapping rule in the service mapping rule base 301, a service corresponding to the rule can be found as the service selected from all services contained in the service mapping rule base.
As shown in
b is a flowchart showing a method for generating the service mapping rule base. First, several sets of actual user queries are gathered from respective service providers. Then, a query corpus is established from the gathered user queries. Here, any semantic analyzing method in the prior art can be utilized to analyze each user query and obtain a semantic analysis result for the purpose of query corpus establishment. Lastly, the similarity between the labeled results of all the queries for each service type is analyzed in the query corpus, and certain service mapping rule is extract from the similarity and written into the service mapping rule base.
For example, the above flow begins with gathering from respective route service providers various common queries, such as “which route can I take to Peiking University from Hailong Building?”, “which route can I take to Qinghe from Zhongguancun?”, etc. Then semantic analysis results are obtained through semantic analysis so as to establish a query corpus. The final step is analyzing all queries for the service type “route” and extracting the common requirement “which route can I take” as well as the common parameters “start” and “destination” so as to generate a service mapping rule regarding “route”. Although the above method generates the service mapping rule base automatically, the base can be manually generated by summarizing various service mapping rules by an operator. Alternatively, the service mapping rule base can be semi-automatically generated, that is, first generating service mapping rules automatically, and then collating them manually.
Take the first piece of user query record in
The user query history base is generated automatically. To be specific, every time processing on one user query is completed, the system stores as one piece of query record the user, query question, query time, service type and query parameters of the query.
When the user query based on natural language matches a certain rule in the service mapping rule base 301, a service corresponding to the user query can be found. On the other hand, if the existing service mapping rule base cannot encompass the user query, that is, there is no rule matched with the user query, no service can be found corresponding to the user query, and thus the user cannot obtain his/her expected query answer.
a shows a block diagram of an adaptive service selection means 202 according to the present invention. As shown in the figure, the adaptive service selection means 202 comprises an input section (not shown), an output section (not shown), an adaptive service selecting section 2021 based on the service mapping rule base, an adaptive service selecting section 2022 based on the user query history base and an adaptive service selecting section 2023 based on a service response. When the adaptive service selection means 202 receives an user query analyzed by the semantic analyzing means via the input section, and the user query is not covered by the service mapping rule base, the adaptive service selection means 202 adds a new service mapping rule in the service mapping rule base by use of the adaptive service selecting section 2021 based on the service mapping rule base, the adaptive service selecting section 2022 based on the user query history base and the adaptive service selecting section 2023 based on a service response, and then determines the service selected by the user according to the new service mapping rule. Subsequently, the adaptive service selection means 202 outputs the service selected by the user via the output section. In this way, the required answer can be found. Although the adaptive service selection means 202 in
b shows a flowchart of a method for adaptive service selection according to the present invention. The input section receives a user query analyzed by the semantic analyzing means 201 at S501. At S502, at least one of the adaptive service selection means 202 in
(a) Majority with priority principle, that is, if the results returned by two of the three sections are identical, the result is considered as the optimal one;
(b) Highest similarity with the priority principle, that is, for example, if the results returned by the adaptive service selecting section 2021 based on the service mapping rule base, the adaptive service selecting section 2022 based on the user query history base differ from each other, the result with the highest similarity is selected as the optimum (the former section 2021 uses the similarity between the requirements of the semantic analysis result and the similar rule, while the latter section 2022 uses the similarity between the syntaxes between the user query and the similar query);
(c) Service response with the priority principle, that is, the optimal result is the result returned by the adaptive service selecting section 2023 based on a service response.
At S503, the output section outputs the selected service to the retrieving means 203 so as to retrieve the expected answer.
a is a block diagram of the adaptive service selecting section based on the service mapping rule base in the adaptive service selecting means of
b shows the adaptive service selecting method based on the service mapping rule base. At S601, the input unit 60 receives an inputted semantic analysis result of a user query and sends it to the similar rule finding unit 62, which finds the rule most similar to the semantic analysis result at S602. The similarity between the semantic analysis result and a service mapping rule can be obtained by calculating the similarity between their requirements and the match between their service parameters, and a service mapping rule with the highest similarity is selected as the most similar rule. Here, the similar rule must meet the following conditions:
(1) The requirement of the semantic analysis result is similar to that of the similar rule, and this is determined by semantic similarity and string similarity both of which can be calculated by use of any known method, for example, the semantic similarity can be calculated on the basis of a current semantic dictionary or an ontology base, and the string similarity can be a comparison between strings, for example, “which route can I take” and “which route can I take” are both similar in semantic and string;
(2) The semantic analysis result contains the service parameters defined in the similar rule.
At S603, based on the found similar rule, the rule generating and service selecting unit 64 generates a new service mapping rule that can cover the user query and adds the new rule to the service mapping rule base. The generated new rule is so defined that its requirement is identical with that of the semantic analysis result, its service type is identical to that of the similar rule, and its service parameter is identical with that of the similar rule. Then, the service type is extracted from the new rule to obtain the determined selected service.
At S604, the output unit 64 outputs the determined selected service to the retrieving means so as to retrieve the query answer.
c shows an example of the adaptive service selecting method based on the service mapping rule base. Here, the user query is “how can I get to Hailong Building from Tsinghua East Gate?”, and the semantic analysis result is “requirement: how can I get, start: Tsinghua East Gate, destination: Hailong Building”. Since there is no service mapping rule that matches the query exactly in the service mapping rule base, a similar rule is found, that is, the first rule in the base as shown in
a is a block diagram of the adaptive service selecting section based on the user query history base. This adaptive service selecting section 2022 comprises an input unit 70 for receiving an inputted semantic analysis result of a user query, an similar query finding unit 72 for finding from the user query history base the query similar to the user query, a rule generating and service selecting unit 74 for generating a new service mapping rule band determining the selected service corresponding to the user query based on the found similar query, and an output unit 76 for outputting the determined selected service.
b shows the adaptive service selecting method based on the user query history base. At S701, the input unit 70 receives an inputted semantic analysis result of a user query and sends it to the similar query finding unit 72, which searches the user query history base for the most similar query on the basis of the semantic analysis result of the user query at S702. The similarity between the semantic analysis result and a query can be calculated through parameter comparison and syntactical similarity, and the similar query must meet the following conditions:
(1) The query parameters in the semantic analysis result are identical with those of the similar query;
(2) The values of query parameters in the semantic analysis result are the same or belong to the same category as those of the similar query, the determination as to whether two words belong to the same category can be made by use of any prior art method, such as the method on the basis of a current semantic dictionary or an ontology base, “Hailong Building” and “Tiananmen”, for example, are both belong to the category “location”;
(3) The user query and the similar query are similar syntactically, where the syntactic similarity can be calculated by use of any computation method for string similarity, for example, the method for determining the number of editing operations (add, delete, substitute) required in changing two strings to the same one, and the smaller the number of operations is, the more the two strings resemble. Here, the particular calculation formula is “1−(the number of editing operations/maximal length of two strings)”. Take as an example two strings of “how can I get to Hailong Building from Tsinghua East Gate?” and “which route can I take to Tiananmen from Tsinghua East Gate?”, to change them into the same one, “which route can I take to Tiananmen” must be replaced with “how can I get to Hailong Building”, that is, at least 7 words must be substituted. Further, the maximal length of the two strings is 11 words, and thus they have a syntactic similarity of 4/11 and can be determined as similar to each other.
At S703, based on the found similar query, the rule generating and service selecting unit 74 generates a new service mapping rule that can cover the user query and adds the new rule to the service mapping rule base. The generated new rule is so defined that its requirement is identical with that of the semantic analysis result, its service type is identical to that of the similar query, and its service parameter is identical with the query parameter of the similar query. Then, the service type is extracted from the new rule to obtain the determined selected service.
At S704, the output unit 76 outputs the determined selected service to the retrieving means so as to retrieve the query answer.
c shows an example of the adaptive service selecting method based on the user query history base. Here, the user query is “how can I get to Hailong Building from Tsinghua East Gate?”, and the semantic analysis result is “requirement: how can I get, start: Tsinghua East Gate, destination: Hailong Building”. Since there is no service mapping rule that matches the query exactly in the service mapping rule base, a similar query is found from the user query history base, that is, “which route can I take to Tiananmen from Tsinghua East Gate?”, in which the semantic analysis result and the similar query each contain the parameters “start” and “destination”, the values of “start” are both “Tsinghua East Gate”, the values of “destination” both belong to “location”, and the user query is similar to the similar query in terms of syntax. Therefore, a new rule is accordingly generated as “serial number:4; requirement: how can I get; service type: route; service parameter: <start>; <destination>”, and the service type “route” is taken out so as to obtain the determined selected service “service type: route; start: Tsinghua East Gate; destination: Hailong Building”.
a is a block diagram of the adaptive service selecting section based on a service response, which comprises an input unit 80 for receiving an inputted semantic analysis result of a user query, a service interacting unit 82 for finding candidate service types, sending the parameters contained in the semantic analysis result to service providers corresponding to the candidate service types and receiving the retrieved results returned from these service providers, a service determining unit 84 for selecting a service type with optimal retrieved result from multiple returned retrieved results, a rule generating and service selecting unit 86 for generating a new service mapping rule and determining the selected service corresponding to the user query based on the service type with optimal retrieved result, and an output unit 88 for outputting the selected service.
b shows a flowchart of the adaptive service selecting method based on a service response. At S802, the input unit 80 receives an inputted semantic analysis result of a user query and sends it to the service interacting unit 82, which finds candidate service types and interacts with service providers corresponding to the candidate service types at S802. Specifically, the service interacting unit 82 first searches the service mapping rule base for all service mapping rules which have parameter match with the semantic analysis result and then extracts the service types from these rules as the candidate service types. Here, the parameter match satisfies the condition that the query parameters are the same as the service parameters of the service mapping rule, that is, the number and types of the parameters are the same, respectively. For the definition of such service parameters, reference can be made to the service mapping rule base. Next, the service interacting unit 802 performs service interaction, that is, sends the query parameters of the semantic analysis result to the service providers corresponding to the candidate service types and then receives the retrieved results returned by the providers.
At S803, the service determining unit 84 determines the service types corresponding to the user query based on the returned retrieved results. The determination is conducted specifically in the following manner: (1) if only one service provider returns its retrieved result(s), the service type is selected as corresponding to this provider; (2) if more than one service providers returns their retrieved results, respectively, it is necessary to evaluate the quality of each result and then select the service type corresponding to the service provider providing the result with the highest quality. Here, the evaluation of the quality of each result can be based on a predefined uncertainty-describing dictionary which accommodates description of various certainties, such as those expressions of “not known”, “unknown” and “unclear”. The retrieved result from some service provider is referred to as a low-quality result if it contains description of uncertainty.
At S804, based on the service type obtained above, the rule generating and service selecting unit 86 generates a new service mapping rule that can cover the user query and adds the new rule to the service mapping rule base for update. The generated new rule is so defined that its requirement is identical with that of the semantic analysis result, its service type is that obtained by the service determining unit, and its service parameter is identical with the query parameter of the semantic analysis result. The rule generating and service selecting unit 86 also generates a selected service according to the service type obtained by the service determining unit. Then, the output unit 88 outputs the selected service.
c shows an example of the adaptive service selecting method based on a service response. Here, the user query is “how can I get to Hailong Building from Tsinghua East Gate?”, and the semantic analysis result is “requirement: how can I get, start: Tsinghua East Gate, destination: Hailong Building”. First, service interaction is initiated to find the candidate service types “route” and “traffic” from the service mapping rule base, since the service parameters of the two types match with the query parameters of the semantic analysis result (each of them has two parameters of the type “start” and “destination”, respectively), while the service parameters of the service type “weather” are “location” and “date” which are not matching with the semantic analysis result. Then, the parameters “start: Tsinghua East Gate, destination: Hailong Building” are sent to the service providers for “route” and “traffic”, which returns the retrieved results of “Bus No. 355 travels from Tsinghua East Gate to Hailong Building” and “the traffic between Tsinghua East Gate to Hailong Building is unclear at present”, respectively. Next, service determination is conducted to select the service type “route” as the final result, since the retrieved result from the “traffic” service provider contains an uncertainty word “unclear” and thus falls into the scope of low-quality result. Eventually, a new rule is accordingly generated as “serial number:4; requirement: how can I get; service type: route; service parameter: <start>; <destination>” according to the service type “route”, thereby obtaining the determined selected service “service type: route; start: Tsinghua East Gate; destination: Hailong Building”.
Referring to
a and 11b show a schematic diagram for applying the device for adaptive service selection according to the present invention to a mobile terminal and an ASP (Active Server Page), respectively. As shown in
While the present invention has been described with reference to the above particular embodiments, the present invention should be defined by the appended claims other than these specific embodiments. It is obvious to those ordinarily skilled in the art that any change or modification can be made without departing from the scope and spirit of the present invention.
Number | Date | Country | Kind |
---|---|---|---|
200710180649.6 | Sep 2007 | CN | national |