[LIVE WEBINAR] Integrate Visual LANSA with Salesforce. Register to join on April 30.
[LIVE WEBINAR] Integrate Visual LANSA with Salesforce. Register to join on April 30.
Home » Business Intelligence » What is Natural Language Query (NLQ)?
Home / Blog / What is Natural Language Query (NLQ)?

What is Natural Language Query (NLQ)?

by | Feb 21, 2024 | Business Intelligence

Artificial intelligence (AI) and machine learning (ML) have introduced new ways to solve business problems, resulting in more efficient and higher-quality processes. While there are many AI tools in the toolbox, one of the most effective when it comes to performing data analysis is natural language queries (NLQ).

NLQ enables you to ask questions using regular speech — spoken or typed — instead of database-specific query language. Depending on the system, it uses either machine learning algorithms or sets of rules to answer queries, making it possible for everyday people—rather than only database experts—to analyze data and produce business-critical insights.

Here’s a breakdown of what natural language query is, how it works, how it supports business intelligence (BI), and different options and tools you can use to incorporate it into your BI system.

 

Key Insights

  1. NLQ transforms human language into language a database you can use to return answers to user queries.
  2. There are two primary types of NLQ: search-based and guided NLQ. A search-based NLQ system aims to interpret a user request, associating human words with the actions the NLQ process can perform. A guided system leads you through the question-forming process.
  3. While many NLQ systems struggle with properly understanding user queries, LANSA BI provides you with a guided NLQ that eliminates miscommunications without limiting the types of queries users can perform.

 

NLQ in Action

Imagine you’re a sales manager about to head into a meeting. At your disposal, you have a database with detailed sales information covering the last five years. You need to know which customers within 100 miles of Miami purchased products priced above $200 after 12:05 pm but before 5:00 pm in November of 2023. How would you prefer to execute this query?

Option A would be to use a traditional solution. You could do a manual SQL query, starting with something like:

SELECT lastname, firstname

FROM customers

WHERE sale date = ‘November’ AND amount > 200

Then, you have to continue to code in more conditions so the query returns results for the right time and distance from Miami.

On the other hand, consider Option B. You could just say, “Which customers living within 100 miles of Miami purchased products priced above $200 after 12:05 pm but before 5:00 pm in November?” This is what natural language query (NLQ) makes possible.

 

What Is Natural Language Query (NLQ)?

Natural language query(NLQ) is a self service business intelligence (BI) reporting capability enables people to ask questions about data using regular speech. In the context of BI, NLQ streamlines the analytics process by making queries easier and faster, supporting the decision-making process.

The process, at least at a high level, is relatively straightforward. First, a user speaks or types a query. They may also be able to build a query by selecting a series of choices. Then a BI system uses keywords or chooses from a selection of appropriate answers to reply to the query.

The reply may be a written or spoken answer, a chart, or a report, depending on the design of the NLQ system. The user gets a straightforward, actionable answer that’s relatively easy to present to other stakeholders.

 

How does NLQ Work?

NLQ works by transforming natural human language into language a database can understand and use to perform queries. There are different technologies and techniques that help NLQ bridge the gap between human speech and database queries.

In the context of the above NLQ meaning, artificial intelligence and machine learning play a primary role, particularly when it comes to:

  • Natural language processing (NLP). NLP uses the rule of human grammar and lexicology to enable computers to understand regular speech [1]
  • Named entity recognition (NER). NER refers to a component of NLP that can identify categories of words within text [2]

By using these technologies in conjunction with a database, the process of transforming human language queries into structured queries is relatively linear:

  1. An NLP/NER-powered system pinpoints the categories in a human’s question
  2. Using query analysis, the categories get associated with database objects and actions
  3. The query gets translated to a syntax the database software can understand
  4. The database accepts the query and returns an answer

The above NLQ meaning and process describe how some types of natural language queries work, particularly search-based. However, there’s also guided NLQ, where the user is guided through the query process while being shown the categories and actions they can perform. This can add speed and accuracy to the query process.

 

How Does NLQ Support Business Intelligence?

NLQ plays a significant role in integrating business intelligence into your applications because it democratizes analytics. If you know how to Google something, Natural Language Query should have a familiar feel. You simply enter keywords and the system matches them with what it has in its databases and provides answers.

NLQ also makes it easier for novice users to build informative reports they can use to demonstrate their data-driven ideas. This empowers non-technical users to extract actionable insights to make effective decisions — without the help of data scientists.

Because NLQ takes the heavy lifting out of the query process, analysts, managers, and decision-makers can pour more energy into ways of applying their insights and discovering new ways to make the most of their data.

 

How Does NLQ Help Analytics Users?

NLQ helps analytics users because it aligns with the rise of augmented consumer trends, giving users a simple, self-service BI tool. They don’t need technical expertise to use it to make effective decisions, and there’s no need for them to rely on data experts.

This enables several benefits, such as:

  • Attracts users who prefer NLQ to more technical query solutions, such as coding or using business inteligence dashboards
  • Smoother adoption of self-service analytics for users that would normally be resistant to dashboards or other visual-based BI elements
  • Users who aren’t highly skilled get access to self-service analytics
  • Because the tools can present answers in the form of BI reports or charts, they make it easier for teams to discover deep insights
  • They serve as a starting point, providing answers you can then combine with additional tools, including storytelling and dashboards

 

Types of Natural Language Queries

As referenced above, there are two basic kinds of natural language query processing.

Search-Based NLQ

With search-based natural language querying, you type questions into a search box that are matched with elements inside databases. You can often find search-based NLQ tools in the user interface of a BI platform. Each system is different, so you’ll find a variety of capabilities when it comes to the kinds of terms users can use, the kinds of data types the system supports, and the volume of data you can work with.

A search-based NLQ is often embedded in a BI platform, making it possible for a user to type in a question and get a quick answer. At times, this can be problematic because the NLQ system may not support a wide range of questions. You also may not get adequate guidance regarding how to structure your questions — and with some systems, you don’t get any assistance at all.

Guided NLQ

Guided NLQ guides the person making the query by giving them lists of the kinds of questions they can ask and prompting them to choose from actions they can perform on the data.

Circling back to the example used at the outset, suppose a user wants to query information about customers from a specific area. They may begin by selecting “Customers.” The guided NLQ system may then offer querying options such as “living within,” “onboarded before,” “onboarded after,” or “doing business with us for.” The user would then choose “living within.” The system may then offer a set of choices reflecting categories already aligned with each customer, such as “less than 200,” “less than 250,” and so forth.

 

Natural Language Query Examples

Even though there are many applications for NLQ, here are some of the most common uses of a natural language query database:

NLQ in Business Analytics

You can use natural query language to make the business analytics process smoother and more accessible for a wider range of users.

For instance, suppose human resources needs to identify the highest-performing employees on your sales team to help build a performance bonus system.

With NLQ natural language query, HR can determine which associates have the highest sales using straightforward questions. They can also dig a little deeper, asking the system questions about contextual elements as well. For example, they can determine whether the length of time each employee has been with the company impacts performance or if the number of previous years of experience plays a bigger role.

NLQ in Customer Support and Chatbots

NLQ is no stranger to the customer support world, especially when it comes to chatbots. One of the more recent additions to the NLQ-powered customer service game is Amazon Q. It’s designed to support Amazon Web Services (AWS) customers and provides them with a conversational interface where they can ask the bot questions and make requests.

For instance, you can ask the bot for the most recent updates to AWS services or documentation [3]. It can also tell you how to build apps and even analyze code and help you design customized solutions.

NLQ in Voice Assistants and Virtual Assistants

NLQ has also been a mainstay in the voice and virtual assistant sphere for several years. If you’ve ever used Siri or Alexa, for example, you’ve taken advantage of their NLQ tech. When you use Siri to perform functions on your iPhone, for instance, the response you get back stems from an NLQ-powered query.

This is why you may find many of Siri’s responses more limited or rudimentary when compared to applications like ChatGPT. You may have noticed, for example, that Siri gets repetitive at times. When asking the question, “How are you today?” you get the same answer, such as “Not too shabby. Thanks for asking” after only a few tries.

This is because Siri draws from a relatively limited number of responses using the options it has in its NLQ-powered answering system [4].

 

What are the Benefits of Using NLQ?

NLQ adds efficiency and accuracy to the query process for users without the technical expertise of data scientists. This enables organizations to:

  • Empower Analysis – Give more people the power to analyze business data
  • Enhace Efficiency – Spend less time performing queries and more time putting insights to work
  • Accelerate Onboarding– Speed up the onboarding process via faster training periods for new employees hired to analyze data
  • Integrate Analytics– Weave analytics deeper into the fabric of your company culture

 

The Challenges of NLQ

One of the primary challenges of NLQ systems is they provide little or no guidance on which questions to ask while using them. There’s also limited, if any, information available from the tool about how to use it. As a result, users may find themselves wording things in a way that the system misinterprets, resulting in confusing, inaccurate information.

To remedy this challenge, users may be forced to get help from data analysts or other experts. This negates the time-saving and ease-of-use benefits of NLQ. However, the new approach to NLQ aims to eliminate these challenges.

 

NLQ Integration in LANSA BI

For those who want to harness BI from IBM i, LANSA BI overcomes the challenge of miscommunicating with an NLQ system with easy-to-use, guided NLQ. LANSA BI negates the miscommunication obstacle by guiding users through their different choices as they move through the construction of their query.

At each stage, you’re presented with the options available, whether it’s a field or action, and you still end up with a query that’s easy to understand—by both the user and the database. In this way, LANSA BI makes it easier to integrate BI into your IBM I applications, making it accessible to a wide range of users, regardless of their technical expertise. Because LANSA can understand and process natural language queries, users can interact with data intuitively without having to learn coding language or have a deep understanding of how databases work.

 

Key Takeaways

Natural language query enables people to ask questions about data using regular speech. It works by transforming natural human language into language a database can understand and use to perform queries. This makes it an effective tool for non-technical users who want to use deep BI insights to facilitate data-driven decisions across the board.

With search-based natural language querying, you type questions into a search box that are matched with elements inside databases. On the other hand, guided NLQ guides the person making the query by giving them lists of the kinds of questions they can ask and prompting them to choose from actions they can perform on the data.

One of the primary challenges of some NLQ systems is they provide little or no guidance on which questions to ask while using them. For IBM I users, LANSA BI overcomes this obstacle by enabling a system with easy-to-use, guided NLQ.

References

[1] “What is Natural Language Processing? | IBM.” https://www.ibm.com/topics/natural-language-processing

[2] “What is named entity recognition? | IBM.” https://www.ibm.com/topics/named-entity-recognition

[3] “Introducing Amazon Q,” Amazon Web Services, Inc. [Online]. Available: https://aws.amazon.com/q/

[4] “Schema Aware Semantic Reasoning for Interpreting Natural Language Queries in Enterprise Settings.” Sen, Babtiwale, Saxena, Butala, Bhatia, Sankaranarayanan. https://aclanthology.org/2020.coling-main.115.pdf

RECOMMENDED POSTS

0 Comments