What is natural language query (NLQ)?
Natural language query (NLQ) is a capability that enables users to ask questions within their analytics platforms using ordinary human language instead of query language. This self-service business intelligence (BI) reporting capability lets users ask questions consisting solely of terms or phrases spoken normally or entered as they might be spoken, without any nonlanguage characters -- such as a plus symbol or asterisk -- and without any special format or alteration of syntax. Natural language queries can be conducted through a text or voice interface.
Natural language processing (NLP) enables software to understand typical human speech or written content as input and possibly respond to it, depending on the application. A virtual assistant, for example, is designed to respond to spoken input or text. However, no software can actually derive meaning from human language as it's spoken, so NLP involves processes to translate language between the two.
NLP applies syntax techniques such as parsing for grammatical analysis, word segmentation to break text up into smaller units, sentence breaking to apply meaningful boundaries in unbroken text, morphological segmentation to identify the structure and form of words, and stemming, which reduces words to the stems to which suffixes and prefixes attach. NLP also uses techniques including named entity recognition and word sense disambiguation to understand input user queries, translate and return them as human-understandable responses through natural language generation.
What is the purpose of natural language query?
NLQ facilitates the retrieval of information. Typically, when a user wishes to get data from a source, they use a query language of some sort, like a Structured Query Language query. Consumers in general don't know SQL, so companies offering goods, services or information often set up a user interface by which the consumer can specify the information they need with a mouse click or a search. NLQ makes it possible to forego software interfaces, allowing the user to simply ask natural language questions to specify the information they need, using nothing more than simple human language. Artificial intelligence and machine learning algorithms optimize the process by analyzing the text and identifying any patterns and the meaning behind the user responses. Natural language processing takes it from there, reshaping user questions into query language to facilitate data retrieval.
What are the types of natural language queries?
Natural language queries come in two basic flavors -- search-based NLQ and guided NLQ. The two are very different:
Search-based NLQ. The more common of the two main types, search-based NLQ requires the user to enter a natural language question into a search box to submit their query. The query is then matched with elements in the data source to be searched -- or spoken vocally, in the case of audio digital assistants. This approach is more effective when the user is given clear guidance on how best to use the tool.
Guided NLQ. Guided NLQ is both more cumbersome and more precise than search-based NLQ. In guided NLQ, the user is led through a series of prompts in the user interface -- whether as displayed text or audio -- out of which a query language search command is constructed from the user's responses and then sent to the data source. This process increases the accuracy of the query, and therefore the results, but takes more of the user's time.
What are the benefits of natural language queries?
Natural language queries offer an array of benefits, representing a major step forward in the evolution of user interfaces. They make accessible important applications that previously required more knowledge and training on the user's part. The following are some specifics:
- All the questions and answers are already stored and waiting. Most NLQ tools do more than store answers; over time, they also store the most frequently asked questions. This increases the utility of such systems, compared to the more conventional query language retrieval process associated with most data sources, which are notoriously finicky about the precision and syntactic perfection of the query.
- Self-service BI for nonexperts. Replacing query language with natural language questions enables nonexperts to use BI sources more extensively, making self-service analytics more accessible to a broader range of business users. This can be a profound driver of BI adoption.
- NLQ BI tools can deliver answers visually. Available in many BI products with embedded NLQ, the one-step process of generating graphics directly from natural language questions is a major step forward for analytics users.
- NLQ tools can be easily embedded in other processes. The ease with which NLQ tools can be added to other applications makes them more desirable, as they expand the utility of the application without the burden of redesigning or rearchitecting it.
What are the challenges of natural language queries?
Natural language queries aren't without their challenges. As with any new technology or process, there are still features that users haven't fully negotiated. They include the following:
- The potential ambiguity of NLQ questions. Sometimes a question can be vague; some words have more than one meaning, and the nature of a question can change depending on the context in which it's asked. NLQ systems can sometimes be confused by natural language questions.
- Some NLQ tools are domain-specific. Often, an NLQ system can only provide information within a limited domain, making it frustrating for a user to get what they need. A service chatbot, for instance, might only be equipped to respond to customer problems and complaints and be unable to provide information about pricing and terms.
- Modeling data for storage in NLQ systems can be challenging. There's no right way to model data storage for an NLQ system, as the applications that use them and the wide variety of data they can support can cause the storage and input/output requirements to vary widely. This can limit the usefulness of the results and sometimes require data architecture revisions.
Examples of natural language queries
Many applications already use NLQ, including business analytics systems, digital assistants, customer service and decision support systems. The following are some additional application examples:
- Business analytics platforms. Microsoft Power BI is one of a growing number of BI platforms that incorporate NLQ, making them accessible to more business users. Analytics users can simply ask, "What are the total sales for the month of May?" or "Who are our top 10 customers, by volume?" and get an immediate result.
- Healthcare decision support systems. Rapid retrieval of patient information is important in decision-making in healthcare; NLQ makes it as simple as asking, "What are Jane Doe's lab results?" or "How many cases of this disease have been reported this year?"
- Graphic drill-down into financial problems. Financial analysts can drill down into complex analyses by building out graphs with increasingly refined queries, making connections between data points and watching them develop -- and all much faster than doing it by hand.
Although natural language processing and machine learning are talked about relative to AI, there are crucial differences between the two disciplines.