NLP Operator

Prev Next

The NLP (natural language processing) operator compares two inputs to identify and interpret language patterns.

  • Text dynamically added into the operator. For example, a Text Field or Text Area component sends data into the NLP operator’s upper input port.

  • Text stored in a data table. For example, a Data Table component sends data into the operator’s lower input port.

When you enter text into the operator, it looks for a keyword match from your data table. Then the operator outputs that keyword and any value associated with it. That associated value is its sentiment. So, let’s say you create a data table with two columns of information: a Keyword column and a Sentiment column. Your Keyword column stores text that the operator compares to the input text. Your Sentiment column stores the sentiment text corresponding to the keyword.

Let's say you want to apply that to a real-world scenario. A good example could include collecting feedback on an application. You set up a review template that you ask end-users to complete. To gather the results, you use an NLP operator to search for keywords in these reviews. When the operator finds a match, it outputs a sentiment for that keyword. For example, you can set up a sentiment that identifies positive feedback. If a user mentions the word Helpful in their review, the NLP operator returns Helpful and Positive.

You can find the NLP operator under the Value/String group to the left of the Data Workflow canvas.

About the Info Window

Here's a breakdown of each setting in the Info window:

Setting

Description

Category

Grayed out and non-adjustable setting indicating the operation type.

Label

Sets the label for your operator, displaying below the operator on your Data Workflow canvas.

This field is optional, but set a label if you use more than one of the same operator type. A label helps you identify your operators without opening any Info windows.

Preserve Argument Type

When selected, this setting ensures the argument data type is respected when the operator executes.

Source Column

Enter the key you want the operator to reference data from your data table. This value is typically the header of your keyword table column.

Adding an NLP Operator

In this example, you'll use a Data Table component with a variety of feelings (keywords) and moods (sentiments). You'll configure a Text Area component so you can input as many keywords as you want. You'll then set up a Data Workflow with an NLP operator to compare the data. If a match exists between the Text Area and Data Table components, the operator outputs the results. You’ll also configure the Data Workflow to view the results in the DevTools Console.

These instructions assume you have a module open, saved, and with a title.

Configure the Text Area Component

Begin by adding a Text Area component to dynamically input keywords into your NLP operator.

  1. In the Module Builder, drag and drop a Text Area component onto your canvas.

  2. In the Property ID field, enter review.

  3. In the Label Text field, enter Review.

  4. Set Required to (ON).

  5. Click Save Component.

Configure the Data Table Component

Next, configure a Data Table component to store your keywords and sentiments.

  1. Drag and drop a Data Table component onto your canvas, placing it below your review Text Area component.

  2. In the Property ID field, enter dtMoods.

  3. In the data table, enter the following:

    keyword

    mood

    Amazing

    Happy

    Fantastic

    Happy

    Love

    Happy

    Over the Moon

    Happy

    Perfect

    Happy

    Wonderful

    Happy

    Devastating

    Sad

    Rude

    Angry

    Terrible

    Angry

    Unprofessional

    Angry

    Upset

    Angry

    Waste of money

    Angry

  4. Click Save Component.

Configure the Button Component

Now, configure a Button component to trigger your Data Workflow.

  1. Drag and drop a Button component onto your canvas, placing it below your dtMoods Data Table component.

  2. In the Property ID field, enter btnNLP.

  3. In the Label Text field, enter Submit Review & Analyze.

  4. From the Action Type drop-down, select Event.

  5. From the Triggers OnClick drop-down, select dwfNLP.

  6. Click Save Component.

Configure the Hidden Component

Next, configure a Hidden component to output the data from your Data Workflow.

  1. Drag and drop a Hidden component onto your canvas, placing it below your btnNLP Button component.

  2. In the Property ID and the Label Text fields, enter outputNLP.

  3. Click Save Component.

Configure the Data Workflow Component

Lastly, configure a Data Workflow. Begin by configuring an NLP operator and input your Text Area and Data Table components. You'll connect the inputs as follows:

  1. Drag and drop a Data Workflow component onto your canvas, placing it between your btnNLP Button and outputNLP Hidden components.

  2. In the Property ID and Canvas Label Text fields, enter dwfNLP.

Configure the Input Operators

First, you'll configure two Input operators. One operator brings in data from your Text Area component. The other operator brings in data from your Data Table component.

  1. Drag and drop two Input operators onto your Data Workflow canvas.

  2. Configure the first Input operator's Info window as follows:

    Setting

    Value

    Category

    Input

    Component

    review

    Required

    Yes

    Source

    Default

  3. Configure the second Input operator's Info window as follows:

    Setting

    Value

    Category

    Input

    Component

    dtMoods

    Required

    Yes

    Source

    Default

Configure the NLP Operator

Next, you'll configure the NLP operator to dynamically compare values entered in the module's Text Area component to those stored in the Data Table component.

  1. Drag and drop an NLP operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    NLP

    Label

    keyword

    Source Column

    keyword

    The Source Column is case-sensitive. Be sure that you enter it exactly as it's written in your Data Table column header.

  3. Connect the output port (right) of the review Input operator to the upper input port (left) of the keyword NLP operator.

  4. Connect the output port (right) of the dtMoods Input operator to the lower input port (left) of the keyword NLP operator.

Configure the Output Operator

Lastly, configure an Output operator to view the results of your NLP operator in the DevTools Console.

  1. Drag and drop an Output operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Output

    Component

    outputNLP

    Action

    value

  3. Connect the output port (right) of the keyword NLP operator to the input port (left) of the outputNLP Output operator.

  4. Click Save Component.

  5. Save your module.

Here's how the completed example looks in the Module Builder:

Preview your module in Express View and open the  DevTools Console. Enter one or more of your created keywords into the Review field and click Submit Review & Analyze. Run the Angular command and expand the data array in the DevTools Console to view your keywords with their respective moods.

The NLP (natural language processing) operator compares two inputs to identify and interpret language patterns.

  • Text dynamically added into the operator. For example, a Text Field or Text Area component sends data into the NLP operator’s upper input port.

  • Text stored in a data table. For example, a Data Table component sends data into the operator’s lower input port.

When you enter text into the operator, it looks for a keyword match from your data table. Then the operator outputs that keyword and any value associated with it. That associated value is its sentiment. So, let’s say you create a data table with two columns of information: a Keyword column and a Sentiment column. Your Keyword column stores text that the operator compares to the input text. Your Sentiment column stores the sentiment text corresponding to the keyword.

Let's say you want to apply that to a real-world scenario. A good example could include collecting feedback on an application. You set up a review template that you ask end-users to complete. To gather the results, you use an NLP operator to search for keywords in these reviews. When the operator finds a match, it outputs a sentiment for that keyword. For example, you can set up a sentiment that identifies positive feedback. If a user mentions the word Helpful in their review, the NLP operator returns Helpful and Positive.

You can find the NLP operator under the Value/String group to the left of the Data Workflow canvas.

About the Info Window

Here's a breakdown of each setting in the Info window:

Setting

Description

Category

Grayed out and non-adjustable setting indicating the operation type.

Label

Sets the label for your operator, displaying below the operator on your Data Workflow canvas.

This field is optional, but set a label if you use more than one of the same operator type. A label helps you identify your operators without opening any Info windows.

Preserve Argument Type

When selected, this setting ensures the argument data type is respected when the operator executes.

Source Column

Enter the key you want the operator to reference data from your data table. This value is typically the header of your keyword table column.

Adding an NLP Operator

In this example, you'll use a Data Table component with a variety of feelings (keywords) and moods (sentiments). You'll configure a Text Area component so you can input as many keywords as you want. You'll then set up a Data Workflow with an NLP operator to compare the data. If a match exists between the Text Area and Data Table components, the operator outputs the results. You’ll also configure the Data Workflow to view the results in the DevTools Console.

These instructions assume you have a module open, saved, and with a title.

Configure the Text Area Component

Begin by adding a Text Area component to dynamically input keywords into your NLP operator.

  1. In the Module Builder, drag and drop a Text Area component onto your canvas.

  2. In the Property ID and the Label Text fields, enter review.

  3. Set the Required toggle (ON).

  4. Click Save & Close.

Configure the Data Table Component

Next, configure a Data Table component to store your keywords and sentiments.

  1. Drag and drop a Data Table component onto your canvas, placing it below your review Text Area component.

  2. In the Label and Property Name fields, enter dtMoods.

  3. In the data table, enter the following:

    keyword

    mood

    Amazing

    Happy

    Fantastic

    Happy

    Love

    Happy

    Over the Moon

    Happy

    Perfect

    Happy

    Wonderful

    Happy

    Devastating

    Sad

    Rude

    Angry

    Terrible

    Angry

    Unprofessional

    Angry

    Upset

    Angry

    Waste of money

    Angry

  4. Click Save.

Configure the Button Component

Now, configure a Button component to trigger your Data Workflow.

  1. Drag and drop a Button component onto your canvas, placing it below your dtMoods Data Table component.

  2. In the Property ID field, enter btnNLP.

  3. In the Label Text field, enter Submit Review & Analyze.

  4. From the Action Type drop-down, select Event.

  5. From the Triggers OnClick drop-down, select  dwfNLP.

  6. Click Save & Close.

Configure the Hidden Component

Next, configure a Hidden component to output the data from your Data Workflow.

  1. Drag and drop a Hidden component onto your canvas, placing it below your btnNLP Button component.

  2. In the Property ID and the Canvas Label Text fields, enter outputNLP.

  3. Click Save.

Configure the Data Workflow Component

Lastly, configure a Data Workflow. Begin by configuring an NLP operator and input your Text Area and Data Table components. You'll connect the inputs as follows:

  1. Drag and drop a Data Workflow component onto your canvas, placing it between your btnNLP Button and outputNLP Hidden components.

  2. In the Canvas Label Text and Property Name fields, enter dwfNLP.

Configure the Input Operators

First, you'll configure two Input operators. One operator brings in data from your Text Area component. The other operator brings in data from your Data Table component.

  1. Drag and drop two Input operators onto your Data Workflow canvas.

  2. Configure the first Input operator's Info window as follows:

    Setting

    Value

    Category

    Input

    Component

    review

    Required

    Yes

    Source

    Default

  3. Configure the second Input operator's Info window as follows:

    Setting

    Value

    Category

    Input

    Component

    dtMoods

    Required

    Yes

    Source

    Default

Configure the NLP Operator

Next, you'll configure the NLP operator to dynamically compare values entered in the module's Text Area component to those stored in the Data Table component.

  1. Drag and drop an NLP operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    NLP

    Label

    keyword

    Source Column

    keyword

    The Source Column is case-sensitive. Ensure you enter the values as you configured it in your Data Table column header.

  3. Connect the output port (right) of the review Input operator to the upper input port (left) of the keyword NLP operator.

  4. Connect the output port (right) of the dtMoods Input operator to the lower input port (left) of the keyword NLP operator.

Configure the Output Operator

Lastly, configure an Output operator to view the results of your NLP operator in the DevTools Console.

  1. Drag and drop an Output operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Output

    Component

    outputNLP

    Action

    value

  3. Connect the output port (right) of the keyword NLP operator to the input port (left) of the outputNLP Output operator.

  4. Click Save.

  5. Save your module.

Here's how the completed example looks in the Module Builder:

Preview your module in Express View and open the  DevTools Console. Enter one or more of your created keywords into the Review field and click Submit Review & Analyze. Run the Angular command and expand the data array in the DevTools Console to view your keywords with their respective moods.

To open the Console in Google Chrome, you can use the Ctrl + Shift + J (Windows/Linux) or Option + Command + J (Mac OS) shortcut.