The present invention is in the field of virtual assistants, and particularly accessing data sources.
The modern world thrives on data, and virtual assistant apps and devices make different types of interesting data accessible to users who wish to make queries. Some examples of data are hourly weather forecasts; minute to minute status of traffic on local roads; scores of sports games in progress; stock prices; news headlines; retail store item stock and sale prices; recipes; locations and ratings of restaurants; Wikipedia articles; and jury findings in trial case law.
Many providers of access to data make it available through communication protocols such as JavaScript Object Notation (JSON), Extensible Hypertext Markup Language (XHTML), or plain text responses to HyperText Transport Protocol (HTTP) POST, Asynchronous Javascript and eXtensible markup language (AJAX), or Simple Object Access Protocol (SOAP) requests through web Application Program Interface (API) hits. Various other types of access to data in databases are possible. Many providers give requesters, such as virtual assistants, access through unique ID keys that track numbers of requests and, for each request, deduct credits. Virtual assistant services agree to contracts to buy credits, typically at prices of a small fraction of a penny for each credit. Contracts can take the form of signed documents, verbal agreements, online clicked acknowledgments, credit card authorizations, or others. In various cases, virtual assistant providers charge users for the service or charge advertisers to show specific ads in response to virtual assistant queries.
Many types of data are available from multiple providers. For-profit data providers tend to compete for the business of selling credits. Some data providers are non-profit and provide data access free of charge. For example, weather forecast data is available from The Weather Channel at weather.com, The Weather Company a wunderground.com, AccuWeather, Inc. at accuweather.com, and United States National Weather Service at weather.gov.
Different data sources have different advantages. Some charge less money per request. Some have data that are more accurate. Some have data that is more precise, such as ratings on a scale of 1 to 10 instead of 1 to 5 stars. Some respond more quickly, that is, with lower latency. Some have more bandwidth to handle multiple concurrent requests. Some have better data formats and details. Some are more dependably available than others. Some are seasonally available, such as sports standings, occasionally available, such as democratic election campaign polls, or daily available such as intensity of sunlight. Various data sources have other differentiating advantages specific to the types of data that they provide. Virtual assistant services must choose data sources, and their choice of data sources strongly affects the satisfaction that they provide to users.
The disclosed invention provides an improved approach for selecting data sources by a virtual assistant.
The present disclosure is directed to various aspects and embodiments of novel systems and methods for virtual assistants to dynamically choose between sources of data useful for providing answers to user queries. A virtual assistant system maintains a list of data sources that are applicable to different domains of user queries and might have data appropriate for answering queries within each domain. Domains may include weather, food, sports, music, courtroom proceedings, and others. The list includes, for at least one domain, at least two applicable data sources. When interpreting queries with a reasonable likelihood of being within the domain, the virtual assistant system applies a cost function to compute a cost for making a request to each of the applicable data sources. Based on cost thresholds and the relative costs of accessing each data source the virtual assistant system chooses which one or more data source from which to request data to answer the query.
Various function rules of various factors, according to various embodiments of the invention, are appropriate for various virtual assistants and various data sources. Some examples of factors are contract pricing per hit; estimated data quality; measured or guaranteed API request to response latency; currently pending and allowed maximum concurrent requests; measured or guaranteed up-time reliability; whether the data source and virtual assistant provider have a business partnership; and whether the end user has permission to access certain data. Various embodiments measure data quality in various ways, such as accuracy, granularity, and consistency.
The scope of the present invention encompasses machines that process and methods of processing that produce requests for data from multiple data sources. More extensive systems, of which such machines and processes are components, are also encompassed by the present invention. Some such systems are virtual assistants that perform natural language understanding. Some such systems are ones that also perform speech recognition.
In various systems, a natural language query is any expression—spoken, typed, written, gestured, or otherwise—that can be parsed by natural language processing, and requests information that is representable as data.
Some embodiments of the invention operate on simple query input that indicates a specific required data value, such as the current temperature at Heathrow Airport or the dictionary definition of the word Troglodyte. Some embodiments output simple answers such as a single integer number, a Boolean value, an enumerable value, or string of text. Some embodiments operate on complex query input such as streams of audiovisual data with geolocation information. Some embodiments output complex answers such as command data structures with multiple parameters for actuating each of multiple motors. Some embodiments that process natural language queries are exemplary of the present invention.
Data source 17 proceeds to look up the weather in database 18 and send a response over connection 16 to virtual assistant service 20. Virtual assistant 20 forms an answer to the query comprising the weather data. Virtual assistant 20 proceeds to send the answer over connection 15 across the internet 14 to the household assistant device 12, which outputs audio with the answer to the weather query.
Various other embodiments perform similar functions, but in different positions or with other steps. For example, some embodiments perform speech recognition within the virtual assistant service 20, and some embodiments perform data caching in the virtual assistant service 20 and in the household assistant device 12. Furthermore, many types of devices other than household assistance devices 12 are useful for human-machine interaction. Some examples are mobile phones, automobiles, and cognitive enhancement implants (CEIs).
The output of natural language interpreter 21 is interpretation hypotheses that represent user intent as relationships between entities, E, each having attributes, A, each having values V. For example, a person entity has a height attribute with a value that indicates a number of centimeters. System 20 would represent the query, “Is Alice taller than Bob?”, as a greater-than comparison between the value of the height attribute of the entity named Alice and the value of the height attribute of the entity named Bob. To process the query, “How old is Miley Cyrus?”, system 20 would look up the value of the birth date attribute of the person entity Miley Cyrus, and subtract the birth date from the current date to compute an age. Some values are not numerical. For example, processing the query, “What's the weather?” requires looking up the location of the user, searching for the nearest city or airport location, hitting a weather data provider API by providing the name of the location and the fact that sky conditions is the attribute, and receiving a response indicating sunny, overcast, raining, or snowing.
Some embodiments perform actions as a result of imperative queries. For example, a query, “Call me a ride.” provides an NL interpretation requiring not an information request, but a command for a car service to send a car to the user location. In this case, fulfilling the intent of the request is equivalent to a data access through an API.
In the embodiment of
For example, consider a user query of a virtual assistant, with two transcription hypotheses, “how much to tighten a pumps belt if there is bow on the slack side” and “how much to lighten a pumps belt if there is bow on the slack side”. Because of background noise in the query audio, both transcriptions are highly probable. Every word in the transcriptions is common both in the domain of auto mechanics and in the domain of women's clothing, therefore yielding four interpretation hypotheses. A device or process that incorporates or uses system 20 compares each interpretation hypothesis to the chosen transcription and interpretations in a buffer of the previous three queries. For each of the buffered queries that mentions tightness or looseness, hypotheses pruner 23 boosts the probability score of the interpretation hypotheses derived from the first transcription hypothesis, whereas for each of the previous queries that mentions lightness or darkness, hypotheses pruner 23 boosts the probability score of the interpretation hypotheses derived from the second transcription hypothesis. For each word in the buffered transcription that matches keywords in the auto mechanics domain, hypotheses pruner 23 boosts the probability score of the auto mechanics interpretation hypotheses, whereas for each word in the buffered transcription that matches keywords in the women's clothing domain, hypotheses pruner 23 boosts the probability score of the auto mechanics interpretation hypotheses. After boosting scores, hypotheses pruner 23 discards any interpretation hypotheses with a probability score below a target threshold. As a result, interpretations are much more accurate than without a history-based hypotheses pruner. Furthermore, by pruning very unlikely interpretation hypotheses, various embodiments provide for lower requirements on computer processor usage and computer processor memory bandwidth, thereby reducing data center power consumption and allowing a given number of servers to handle a greater number of user queries and do so with lower latency.
The limited remaining likely hypotheses go from pruner 23 to data source determiner 24. For each hypothesized interpretation, the data source determiner determines, based on which types of entities, attributes, and values are in the query, which data sources might have the data needed to produce an appropriate answer. Data source determiner 24 outputs, for each interpretation hypothesis, a list of sources, entities, and attributes needed.
Consider the user query “what are the temperature and humidity going to be tomorrow”. A correct interpretation hypothesis identifies that: this requires two pieces of data, one that is a temperature attribute and one that is a humidity attribute; both pieces of data are related to a weather entity, and that the time attribute is tomorrow. Data source determiner 24 determines that two weather data requests are necessary, and that they can be served by any one of several weather data providers' APIs.
Consider a correct interpretation of the user query “what will be the weather at the 49ers game tomorrow.” Data source determiner 24 recognizes that this requires a weather entity data access with time attribute tomorrow and a location attribute that is the location of the 49ers game tomorrow. Data source determiner 24 further recognizes that the weather data request location attribute requires the result of a location attribute of a 49ers game entity with time attribute tomorrow. Data source determiner outputs a list of necessary data source requests, first including sports game location data sources, 49ers entity, a time attribute of tomorrow, and a request for location data, and second including a weather location data sources, a weather entity, a time attribute of tomorrow, and a location attribute indicating the result of the previous member of the list.
A request generator 25, takes in the list, as well as the pruned interpretation hypotheses. It also takes in a cost estimate from a cost estimator 30 for accessing each of a number of data sources. The embodiment shown in
In the embodiment of
Some data sources are sometimes unavailable. In the embodiment of
Response processing 26 completes the query processing and produces the answer. It does so with the pruned interpretation hypotheses, and the responses from the data sources. By analyzing the data and pruned hypotheses, response processing 26 chooses the single most likely hypothesis in order to generate the answer. Response processor 26 provides the answer as text with an indication of word emphasis. In speech-enabled systems, the answer goes to a text-to-speech engine to produce a spoken audible response.
Response processing 26 takes in the hypotheses of hypotheses pruner 23. It identifies the EAVs needed to formulate a response. It takes as input the data values received from data sources such as data source 40 and data source 41. Various embodiments of response processing are appropriate. In the embodiment of
The effectiveness of achieving superior cost/performance trade-offs depends on the usefulness and accuracy of cost estimates. In system 20, query processor 22 comprises cost estimation 30, which produces the cost estimate used by request generation. According to the embodiment of
Various embodiments use various cost estimation functions. In some embodiments the cost estimation function is a sum of scaled (multiplied by a constant) and weighted (multiplied by an importance value) values of multiple values of relevant information. Some cost estimation functions apply conditional or logical functions or both, such as including an input in the function if a second input or a third and fourth input are within designated ranges but not if a fifth input is true.
In some embodiments, for which minimum query answer latency is desirable, the virtual assistant system 20 sends the request to multiple data sources concurrently, and uses data from whichever data source provides the earliest response. In some embodiments that provide guaranteed maximum query answer latency, the virtual assistant system 20 chooses the most accurate response among all data source responses that responded in time to meet the answer latency requirement. In some such embodiments, upon receiving the response data to form a query answer, the virtual assistant system 20 sends a signal to other data sources 40, 41 with pending API hits to cancel the request.
Some embodiments require a guaranteed answer quality, but are not latency critical. Some such embodiments send requests to data sources and, upon receiving a response that the data is unavailable or that the quality is insufficient to form a useful answer, send requests to secondary data sources. For such embodiments, the more expensive data sources are reserved as secondary.
Some embodiments store data from data source responses in a cache, and use it for future query answers for which the data is appropriate. Whether to cache, and when to replace data in the cache, depends on the cost of requesting it. Various cache replacement algorithms are appropriate, and should take into consideration the shelf life of the data. Weather data, for example, remains accurate for about 1 hour. Birth dates remains accurate perpetually. Stock prices change continuously, and should not be cached at all. Furthermore, depending on contractual agreements between virtual assistant providers and data source providers, some data is uncacheable or comes with an obligation for the virtual assistant system to count cache hits against API hit credits.
For each hypothesis, natural language interpreter 21 computes a domain of knowledge for the query. Each domain has a default data source, indicated by variable domain_default_source. To ensure that the request generation 25 will issue at least one request to a data source, the function sets the cost[ ] variable for the default domain to zero. In some embodiments, NL interpreter 21 produces a plurality of domains needed to respond to queries requiring multiple values of data in the answer. In some embodiments, NL interpreter 21 invokes the query processor multiple times for a query, using the result of one invocation to resolve unknown information required for further evaluation of the interpretation and therefore further invocation of the query processor. In some embodiments, NL interpreter 21 invokes the query processor multiple times to resolve multiple different likely correct interpretations of the query. In some embodiments NL interpreter 21 accumulates data from multiple answers from multiple invocations of query processor 22.
The embodiment of
The final for loop in the function of
The algorithm shown in
Some cost functions depend on attributes of multiple sources. For example, in one cost function, the cost of a second data access depends on whether the cost of an access to the lowest cost source is below a particular threshold. In another example, the cost function for one source depends on the number of requests pending at another source.
Some cost functions depend on user feedback. For example, some embodiments accept from users a thumbs-up or thumbs-down indication about a prior response. Some such embodiments increase the cost for data sources that served data that resulted in a user thumbs-down indication. This steers the system away from data sources that have inaccurate data or in other ways dissatisfy users. Conversely, the embodiment decreases the cost, and thereby steers towards data sources that satisfy users. Some cost functions use the ratio of thumbs-up to thumbs-down indications, as long as the system has received a certain count of indications for the particular data source. As is apparent to ordinarily skilled practitioners, some embodiments use other means of user feedback and some embodiments use feedback information from sources other than direct user input.
Some embodiments validate data from one or more sources to confirm that the received data values make sense. Some embodiments checks a data checksum to ensure that error-prone data transmission was successful. Some embodiments checks date data to confirm that days of the month are less than or equal to 31 and that if the month is February the number of days is less or equal to 29, and less than or equal to 28 if the year is not an integer multiple of 4. Some embodiments, upon receiving a person data record, check that the gender matches the gender expected by an interpretation. For example, a query about the president's mother should return information about a female person. Some embodiments that perform data validation send a request to a second data source only if a data validation fails to yield a confirmation. Some embodiments record data validation failures, and use the records to rate data providers and negotiate contracts.
Some embodiments perform data validation by issuing corresponding requests to multiple data sources and comparing the results. This is useful in embodiments that measure data from separate sensors. For example, it is usual that different weather data providers give slightly different forecasts for a daily high temperature. Some embodiments choose the data to use in the answer based on the difference between responses from multiple data sources. For example, if a first data sources gives more information but a second source gives more accurate values for a smaller set of information, if the comparison finds that the two data sources are close enough on corresponding information then the embodiment chooses the first data source information in the answer. However, if the corresponding data values are different beyond a certain threshold then the system provides only the smaller amount of information from the second source in the answer.
Computer system 50 comprises multiple computer processors. In various embodiments, these multiple computer processors are on separate circuit boards, separate chips, separate cores within a single chip, or separate hardware threads within a single core. In various embodiments, the computer processors execute software written for the x86 instruction set, ARM instruction set, PowerPC instruction set, or extended instruction sets of custom computer processors. Some embodiments use many-core chips with tens or hundreds of small computer processors, the chips, computer processor instruction sets, or both being optimized for the minimum power consumption needed for artificial intelligence processing tasks in power-constrained, heat-constrained, data centers.
By dividing the functions of various embodiments into separate software threads that run on separate computer processors, the computer processors perform with higher throughput. This is in part because the software for each function resides in each computer processor's local instruction cache and is less likely to be replace by software for other functions. The higher performance throughput is also possible because computer processors performing data source accesses consume a lot of network bandwidth relative to the number of instructions processed. By optimizing certain computer processors for optimal network bandwidth requirements, they perform with higher data source access throughput. Conversely, by running software such as for hypotheses pruning, determining data sources, cost estimation, and response processing on dedicates computer processors, they do not need to stall for network accesses, and therefore provide greater processing throughput. Another benefit of that is that with greater processing throughput, embodiments are able to process a greater number of hypotheses for each query within tolerable latencies. Processing a greater number of hypotheses results in fewer incorrect interpretations, and therefore greater satisfaction for system users.
Number | Name | Date | Kind |
---|---|---|---|
6457047 | Chandra | Sep 2002 | B1 |
7596568 | McConnell | Sep 2009 | B1 |
8155962 | Kennewick | Apr 2012 | B2 |
20010044795 | Cohen | Nov 2001 | A1 |
20010047355 | Anwar | Nov 2001 | A1 |
20030037034 | Daniels | Feb 2003 | A1 |
20030177111 | Egendorf | Sep 2003 | A1 |
20050055357 | Campbell | Mar 2005 | A1 |
20070050328 | Li | Mar 2007 | A1 |
20080140699 | Jones | Jun 2008 | A1 |
20120005148 | Horvitz | Jan 2012 | A1 |
20130081044 | Sandstrom | Mar 2013 | A1 |
20140214820 | ODonnell | Jul 2014 | A1 |
20160004706 | Faghihi Rezaei | Jan 2016 | A1 |
Entry |
---|
Anastasios Kementsietsidis, Scalable MultiQuery Optimization for Exploratory Queries over Federated Scientific Databases, PVLDB '08, Aug. 23-28, 2008, pp. 16-27, ACM, Auckland, New Zealand. |
Number | Date | Country | |
---|---|---|---|
20180121508 A1 | May 2018 | US |