Natural Language Processing

Knowi's Natural Language capabilities is a powerful way to enable self-service analytics to non-technical users, by asking questions in plain English to drive insights and visualizations quickly. This empowers any member and individual the ability to make better, data-driven decisions, any time.

Natural Language capabilities are available for use across all datasets and widgets within a dashboard. It can be accessed using the Natural Language/Self Serve Analytics icon on a widget. As you explore your data with natural language, Knowi recommends questions based on your input and the data source available. The technology works by translating your natural language query to Cloud9QL statement to resolve your request.

NLP Across Datasets

Using natural language processing at the dashboard queries across all datasets within your account. Auto-complete suggestions will be recommended as you type based on the associated dataset. For example, if you had multiple datasets powering a single sales and marketing dashboard, and you wanted answer on the latest marketing information, typing your query matches the requested fields and aggregation to the datasets the user has access to.

Natural Language Processing

When using NLP across datasets, you can explicitly request which datasets/query to use by incorporating "from" at the end of your query. For example,

what is the average revenue by sales_representation by region from product sales (prod)

From the example above, product sales (prod) is the name of the dataset/query containing the sales information.

NLP From

Enable NLP Usage Across Datasets

Using NLP across datasets is a customer user feature that must be enabled by an admin-role. To enable this feature for users:

  1. From the Knowi panel, click Settings and navigate to the User Settings page
  2. In the Account Settings tab, click the NLP ACCESS switch to ENABLE/DISABLE the feature

Enable NLP Dash

NLP Within Widgets

Unlike across datasets, for use within widgets, natural language queries are applied directly on the dataset powering that widget.

NLP is available on all widgets inside a dashboard from the widget menu and available to all users, regardless of user role/permission.

NLP Widget

Examples

The following are examples of natural language query to get you started:

Sample field selection
"bounced, sent, customer"

"bounced and sent and customer"

"Show me all for Wells Fargo"

"all for customer Wells Fargo"

"all fields for customer like Wells Fargo"

"bounced and sent for Wells Fargo"
Aggregations
"Sum of sent sum of open by customer"

"Total sent by customer by week"

"Total sent, Total bounced for Wells Fargo"

"Average Sent, Total bounced by customer by campaign_name for newsletter"
Dates
"all for date after January this year"

"average close monthly"

"close by date for january this year"

"close by date between january and march this year"

Slack Integration

Slack is where the people you need, the information you share, and the tools you use come together to get things done. With Knowi's Slack integration, its powerful Search-based analytics (or Natural Language Processing) capabilities combine with Slack's intuitive messaging UI, allowing you to ask questions from your Knowi data directly from the Slack app and get answers back instantly. This allows you to obtain quick insights from your data, optimize by integrating it into your workflows, and enhance collaboration within your team.

Installing the Knowi bot

1. To get started, add the Knowi bot to your workspace by clicking on the link below.

2. After clicking the link, you will then be guided through the authentication flow to connect your Knowi and Slack accounts.

The previous authentication flow grants the Knowi app access to your Slack workspace. The following authentication flow will grant your Slack workspace access to your Knowi account.

3. Back in your workspace, enter the command /knowi. You will then be prompted to connect to your Knowi account. Click the link and enter your Knowi credentials. 

4. In the following screen, click Allow to grant your workspace permission to access Knowi, then click Get Started in the next screen.

5. Once redirected back to your Slack workspace, enter the command /knowi again. Now that your Slack workspace has been connected to your Knowi account, you will receive the following response:

This confirms a successful connection to your Knowi account and you are now ready to start asking questions from your Knowi data via Slack.

Enable/Disable Slack Integration

Knowi's NLP Slack Integration is enabled for each account by default. Admin users can enable/disable the feature by navigating to Settings > User Settings > NLP Slack Integration

Enable Slack File Sharing

Typically "On" by default, in some cases, you may need to manually enable file sharing for your Slack workspace to complete the integration. To enable it in your workspace, navigate to Settings & Permissions > Permissions Tab > Enable Public File Sharing. Or use the link format: https://<WORKSPACE_NAME>.http://slack.com/admin/settings#publicfileurls

Hands-on With Knowi's Search-based Analytics

Fundamentally, Knowi's Search-based analytics (NLP) capabilities with Slack integration function similarly to how it works when using NLP within the Knowi UI. It allows you to ask questions in plain English from your data and queries across all datasets within your account.

Once you type in a question, Knowi will detect and query the dataset that best matches the question asked and return a visualization most appropriate for the data being returned. 

In the following examples, we'll be using Knowi's Search-based analytics via Slack to ask questions and retrieve data pertaining to an email marketing campaign.

Example 1:

We want to know the total emails delivered for each of the customers. So in Slack, we'll type:

/knowi total emails delivered by customer

Knowi will briefly process your question, then return an answer in the form of a visualization.

Notice that the answer returned is in the form of a Pie Chart, so you can quickly visualize the proportion of delivered emails for each customer. Use the magnifying glass to zoom in to the visualization.

Data Preview

The results will also return a Data Preview table, right below the visualization. By default, it will include the first ten records of your query results.

Download Results

You have the option to download your query results as a CSV by clicking the Download results button:

Explore Analysis

You'll also notice the Explore this Analysis button below the results. Clicking on this will take you another screen that shows the visualization settings for the results. This interface will look familiar to what you see when working within the Knowi UI.

From here, you can do further analysis by clicking the Data tab to see how the results were initially aggregated and make any changes as needed. You can also change the type of visualization to display the results. Finally, you can use the NLP text bar to edit your question, or ask a brand new question all together.

Note: In the NLP text bar, hit the space bar following your question to see the dataset name displayed to the right.

Example 2:

Let's ask another question from our data. This time, to find out the average converted emails by campaign name on a weekly basis. Back in Slack, type:

/knowi avg conversions by campaign name weekly

The results return an Area Chart visualization, with each line area representing the different email campaigns and their average conversions over the past several weeks. Exploring the analysis further shows that the ?30% off Limited Sale? email campaign had the most conversions per email in the most recent week.

Example 3 - Select a Dataset

Knowi's Search-based analytics (NLP) also gives you the option to ask questions from a specific dataset in your connected account by specifying a flag (-d) at end of your query to return a matching dataset suggestion. You can then select the dataset from the list of suggestions to execute your query. Note that the first dataset listed is the default it will use, unless you choose another one. 

Format:

/knowi <query/question> -d <dataset name>

Example:

/knowi total tickets this week -d zendesk

Example 4 - "All Details" Command

A handy query for getting detailed results for a particular entity (i.e. customer, sales associate, email address, etc.) in your dataset is by including "all details for..." in your question. This will return all fields in the dataset for the given entity.

Format:

/knowi <"all details for.."> <entity> -d <dataset name>

Example:

/knowi /knowi all details for Wells Fargo -d sending activity

You can also add conditions (i.e. rolling date ranges) to the "all details for..." command to refine your results. Below are some examples:

/knowi all details for Wells Fargo since yesterday -d sending activity

/knowi all details since last 4 months for campaign like Newsletter -d sending activity

/knowi all details for Wells Fargo where message type is Marketing -d sending activity

Embedding Search-based Analytics (NLP)

Using Knowi's Search Analytics can be embedded in your application through Single Sign-On. Try it out.

Similar to embedding with SSO and the Javascript API, the steps to embedding Search Analytics is almost identical and can be achieved in three steps:

1. User Token: Create a Knowi user token for a new or existing user

curl -i -X POST -d "user=email@domain.com&ssoCustomerToken=<SSO_TOKEN>" https://knowi.com/sso/user/create

2. Session Token: Create a Knowi session token with the user token from step 1

curl -i -X POST -d "user=email@domain.com&userToken=<USER_TOKEN>" https://knowi.com/sso/session/create

3. Embed: Write a Javascript file with the session token returned from step 2

function loadSearchAnalytics() {
    Knowi.render('#knowi-div', {
        type: 'nlp',
        token: "BYhXXCeu0Ego8zA1FqtLOOM4BDWot5AYBLI7PWrQTbsie",
        url: 'https://www.knowi.com',
        view: {
            nlpOptions: {
                icon: "off",
                css: {
                    background: 'transparent'
                },
                placeholder: "Try: total sales for canada this week",
            }
        }
    }, function () {
    });
}

Note: For embedding Search Analytics, type must be nlp

Search-Analytics Resources:

  • Javascript API Reference | link
  • Search Analytics code samples | link