Subquery generation from a query
Methods, systems, and apparatus, including computer programs encoded on a computer storage medium, for generating subqueries from a query. In one aspect, a method includes obtaining a query, generating a set of two subqueries from the query, where the set includes a first subquery and a second subquery, determining a quality score for the set of two subqueries, determining whether the quality score for the set of two subqueries satisfies a quality threshold, and in response to determining that the quality score for the set of two subqueries satisfies the quality threshold, providing a first response to the first subquery that is responsive to a first operation that receives the first subquery as input and providing a second response to the second subquery that is responsive to a second operation that receives the second subquery as input.
1. A computer-implemented method, the method comprising:
obtaining a query;
generating a set of two subqueries from the query, where the set includes a first subquery and a second subquery;
determining a quality score for the set of two subqueries;
determining whether the quality score for the set of two subqueries satisfies a quality threshold; and
in response to determining that the quality score for the set of two subqueries satisfies the quality threshold:
executing a first voice action operation that is based on the first subquery, and
executing a second voice action operation that is based on the second subquery.
2. The method of claim 1 , wherein executing the first voice action operation causes the first voice action operation to be performed at one or more first devices and wherein executing the second voice action operation causes the second voice action operation to be performed at one or more second devices.
3. The method of claim 2 , wherein the one or more first devices comprise one or more lights and wherein the first voice action operation includes turning on the one or more lights.
4. The method of claim 3 , wherein the one or more second devices comprise one or more user devices having at least a corresponding speaker and wherein the second voice action operation includes playing music.
5. The method of claim 1 , wherein the determining the quality score for the set of two subqueries comprises:
determining a frequency that the first subquery appears in a log of prior queries from multiple users; and
determining the quality score for the set of two subqueries based at least on the frequency that the first subquery appears in the log of prior queries from multiple users.
6. The method of claim 1 , wherein the determining the quality score for the set of two subqueries comprises:
determining that the first subquery corresponds to the first voice action operation; and
determining the quality score for the set of two subqueries based at least on determining that the first subquery corresponds to the first voice action operation.
7. The method of claim 1 , wherein the determining whether the quality score for the set of two subqueries satisfies a quality threshold comprises:
determining whether the quality score for the set of two subqueries satisfies a predetermined threshold that reflects that a user is likely to be satisfied by respective operations being executed using each of the two subqueries.
8. The method of claim 1 , further comprising:
generating a second set of two subqueries from the query;
determining a second quality score for the second set of two subqueries; and
determining that the first quality score reflects that respective operations being executed using the two subqueries of the first set of two subqueries is more likely to satisfy a user than respective operations being executed using the two subqueries of the second set of two subqueries.
9. The method of claim 1 , wherein the generating the set of two subqueries from the query comprises:
identifying a position of one or more particular characters in the query;
generating the first query from a first portion of the query before the position of the one or more particular characters in the query; and
generating the second query from a second portion of the query after the position of the one or more particular characters in the query.
10. The method of claim 9 , wherein the one or more particular characters comprise the word “and”.
11. The method of claim 1 , wherein the generating the set of two subqueries from the query comprises:
identifying a list of items in the query;
generating the first query from the portion of the query up to and including a first item of the list; and
generating the second query from the portion of the query before the first item of the list and including a second item of the list.
12. The method of claim 1 , wherein the generating the set of two subqueries from the query comprises:
determining that a phrase in the query can be used as a third subquery that results in a list of items; and
replacing the phrase in the query with the list of items.
13. The method of claim 1 , wherein the generating the set of two subqueries from the query comprises generating a set of three subqueries.
14. A system comprising:
a data processing apparatus; and
a non-transitory computer readable storage medium in data communication with the data processing apparatus and storing instructions executable by the data processing apparatus and upon such execution cause the data processing apparatus to perform operations comprising:
obtaining a query;
generating a set of two subqueries from the query, where the set includes a first subquery and a second subquery;
determining a quality score for the set of two subqueries;
determining whether the quality score for the set of two subqueries satisfies a quality threshold; and
in response to determining that the quality score for the set of two subqueries satisfies the quality threshold:
executing a first voice action operation that is based on the first subquery, and
executing a second voice action operation that is based on the second subquery.
15. The system of claim 14 , wherein the determining the quality score for the set of two subqueries comprises:
determining a frequency that the first subquery appears in a log of prior queries from multiple users; and
determining the quality score for the set of two subqueries based at least on the frequency that the first subquery appears in the log of prior queries from multiple users.
16. The system of claim 14 , wherein executing the first voice action operation causes the first voice action operation to be performed at one or more first devices and wherein executing the second voice action operation causes the second voice action operation to be performed at one or more second devices.
17. The system of claim 14 , wherein the determining the quality score for the set of two subqueries comprises:
determining that the first subquery corresponds to the first voice action operation; and
determining the quality score for the set of two subqueries based at least on determining that the first subquery corresponds to the first voice action operation.
18. A non-transitory computer readable storage medium storing instructions executable by a data processing apparatus and upon such execution cause the data processing apparatus to perform operations comprising:
obtaining a query;
generating a set of two subqueries from the query, where the set includes a first subquery and a second subquery;
determining a quality score for the set of two subqueries;
determining whether the quality score for the set of two subqueries satisfies a quality threshold; and
in response to determining that the quality score for the set of two subqueries satisfies the quality threshold:
executing a first voice action operation that is based on the first subquery, and
executing a second voice action operation that is based on the second subquery.