# US 2021/0081436 A1 · Classifying different query types

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2021/0081436 A1
- Document ID: US20210081436A1
- Status: Published application
- Kind: A1
- Application number: 16/736,577
- Filed: 2020-01-07
- Published: 2021-03-18
- Earliest claimed: 2019-09-18
- Assignees: salesforce.com, inc.
- Applicants: salesforce.com, inc.
- Inventors: Rohit Kapoor; Christian Posse; Francisco Borges; Guillaume Kempf; Arvind Srikantan
- Web page: https://patentgrep.com/patent/US20210081436A1

## CPC

- G06F 16/285: {Clustering or classification}
- G06F 16/353: into predefined classes
- G06F 16/2282: {Tablespace storage structures; Management thereof}
- G06F 16/243: {Natural language query formulation}
- G06F 16/29: Geographical information databases
- G06F 16/387: using geographical or spatial information, e.g. location
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

In disclosed techniques, a computing system causes presentation of a user interface having an input field operable to receive, from a user, a search query for a database. The computing system may classify the search query by: determining whether the search query includes terms that are within a specified vocabulary indicative of a natural language query and determining whether the search query includes terms that identify an object defined in a schema of the database. In response to classifying the search query as a natural language query, the computing system returns query results determined by identifying values in the database corresponding to the object defined in the schema. In response to classifying the search query as a keyword query, the computing system returns query results determined by comparing terms of the search query to values within records in the database.

## Claims

### Claim 1

A non-transitory computer-readable medium having program instructions stored thereon that are capable of causing a computing system to implement operations comprising:
causing presentation of a user interface having an input field operable to receive, from a user, a search query for a database;
classifying the search query, wherein the classifying includes:
determining whether the search query includes one or more terms that are within a specified vocabulary indicative of a natural language query; and
determining whether the search query includes one or more terms that identify an object defined in a schema of the database;
in response to classifying the search query as a natural language query, returning query results determined by identifying values stored in the database that correspond to the object defined in the schema; and
in response to classifying the search query as a keyword query, returning query results determined by comparing terms of the search query to values within records stored in the database.

### Claim 2 (depends on 1)

The non-transitory computer-readable medium of claim 1, wherein the operations further comprise:
maintaining contextual information that is independent of the search query, wherein the classifying is further based on the contextual information.

### Claim 3 (depends on 2)

The non-transitory computer-readable medium of claim 2, wherein the classifying further includes:
determining a first score corresponding to whether one or more terms in the query match within the specified vocabulary;
determining a second score corresponding to whether one or more terms in the query match within the schema of the database;
determining a third score corresponding to the contextual information, wherein the contextual information includes information about categorization of previous search queries from the user; and
using the first, second, and third scores to determine whether to implement the search query as a natural language query or a keyword query.

### Claim 4 (depends on 3)

The non-transitory computer-readable medium of claim 3, wherein the first score and the second score are weighted based on the contextual information.

### Claim 5 (depends on 2)

The non-transitory computer-readable medium of claim 2, wherein the contextual information includes, for the user, historical information indicating how previously-entered queries of the user have been classified.

### Claim 6 (depends on 2)

The non-transitory computer-readable medium of claim 2, wherein the contextual information includes one or more attributes of the user, and wherein the one or more attributes include a geographical location of the user.

### Claim 7 (depends on 1)

The non-transitory computer-readable medium of claim 1, wherein the object defined in the schema of the database is a table that includes one or more records.

### Claim 8

A method, comprising:
receiving, by a computing system from a user, search terms for a query of a database;
evaluating, by the computing system, the query to determine whether to implement the query in a first mode or in a second mode, wherein the evaluating includes:
determining whether one or more of the search terms identifies an object defined in a schema of the database; and
based on the evaluating, implementing the query in the determined mode.

### Claim 9 (depends on 8)

The method of claim 8, further comprising:
generating, based on determining whether to implement the query in the first or second mode, a classification of the query that specifies a set of database search terms that are compatible with an interface of the database;
causing, by the computing system, display of query results and the classification of the query to the user, wherein the query results are generated by the implementing the query in the determined mode; and
in response to receiving user input indicating an alteration of the classification, implementing the query using the altered classification.

### Claim 10 (depends on 8)

The method of claim 8, wherein the first mode classifies the query as a natural language query, and wherein the second mode classifies the query as a keyword query.

### Claim 11 (depends on 8)

The method of claim 8, wherein the evaluating further includes:
determining whether one or more of the search terms is within a vocabulary indicative of a natural language query; and
determining contextual information for the received query, wherein the contextual information is information stored by the computer system that is independent of the query.

### Claim 12 (depends on 11)

The method of claim 11, wherein the vocabulary includes one or more keywords and one or more regular expressions.

### Claim 13 (depends on 11)

The method of claim 11, wherein the contextual information includes, for the user, historical information indicating how previously entered queries of the user have been categorized.

### Claim 14 (depends on 11)

The method of claim 11, further comprising:
classifying, by the computing system, the query entered by a first user as a keyword query; and
classifying, by the computing system, the same query entered subsequently by a second user as a natural language query, wherein the same query is classified differently for the first and second users based on a difference in contextual information stored for the first and second users.

### Claim 15 (depends on 11)

The method of claim 11, further comprising:
determining a first score for the term that is a keyword indicative of the first mode and a second score for the search term that identifies the object defined in the schema of the database, wherein the second score is based on a proximity within the query entered by the user of the term that is a keyword to the term that identifies the object.

### Claim 16

A method, comprising:
receiving, by a computing system from a user, search terms for a query of a database;
evaluating, by the computing system, the query to determine whether to implement the query in a first mode or in a second mode, wherein the evaluating includes:
tagging one or more terms according to a set of tagging criteria, wherein a first one of the tagging criteria specifies whether the query includes one or more terms that identify an object defined in a schema of the database; and
accessing contextual information indicating previously determined search modes for prior queries of the user; and
based on the evaluating, implementing the query in the determined mode.

### Claim 17 (depends on 16)

The method of claim 16, wherein a second one of the tagging criteria specifies whether the query includes one or more terms that are within a specified vocabulary indicative of a natural language query.

### Claim 18 (depends on 17)

The method of claim 17, wherein the vocabulary indicative of a natural language query is different for a first user than for a second user.

### Claim 19 (depends on 17)

The method of claim 17 wherein a third one of the tagging criteria specifies whether the query includes one or more terms that are recognized modifiers for other terms in the query.

### Claim 20 (depends on 16)

The method of claim 16, wherein the evaluating includes implementing the query as a keyword query in response to being unable to tag a threshold number of terms in the query.
