Configuring NLP Settings for a Data Source
Use the NLP Interface to configure natural language processing for a selected data source in your model.
Implementation:
- Switch to the Definition panel.
- Click to open the Model Data Sources dialog.
- (Optional) Create an data connection and a data source, so you can configure its NLP settings.
- Select the intended data source.
- Click the NLP button to open the Data Source Natural Language Definition dialog.
- Switch to the Entity panel.
- Use the Noun field to enter a term that describes the items in the selected data source.
- (Optional) To include more than one descriptive noun, type them one after the other with a pipe symbol to separate them.
A list of suggestions based on the text you have entered in the Noun field will appear below it. These suggestions will be synonyms or other terms related to the nouns already present.
- (Optional) Click any of the suggestions to add it to the Noun list. A separating pipe will automatically be added, and the list of suggestions will update to reflect the new addition.
Suggested nouns are grouped according to their meaning. If a particular word has several definitions, each definition will have the associated nouns shaded in a particular colour. This helps you to identify related nouns and ignore the ones you don't need.
- (Optional) Use the Filter field to enter a logical statement, such as "ProductWidth > 5" that determines which fields in the data source will be excluded from the query results regardless of what the user types. Only rows whose contents satisfy the logical statement will be examined as part of the subsequent NLP query.
- (Optional) Use the Sort field to apply a default ascending sort order to data returned by the NLP query. Type the name of one of your source data's columns into the field provided.
If the data is queried using a term that applies specific sorting - such as "cheapest products" - the user's query will be used to sort the data instead.
- (Optional) Place a minus sign before the name of the Sort column to apply a descending sort order to the data.
- (Optional) As you type terms in the Filter and Sort fields, use the validation message to confirm what you have written is valid before saving, or your changes will have no effect.
- If you do not wish to add or modify the logic that interprets natural language queries to the selected data source, skip to step 19, or switch to the Expression panel.
- Click Add to create a new NLP expression.
To Edit an existing expression, left-click the intended item - adding and editing will open an identical dialog that lets you configure the chosen expression.
- Type a valid expression into the Expressions field. When a valid expression has been entered, a message will appear underneath it stating the assigned type.
- Fill in the associated fields - these will depend on the type of expression you have entered. Your selections will populate the Examples field.
- (Optional) Modify the text in the Examples text box stating how to use the expression, but make sure the new text is valid, and is compatible with the expression.
If you modify the expression in any way, the text you add in the Examples text field will be overwritten.
- (Optional) Switch to the Advanced panel.
- (Advanced panel Only) Click Reset NLP Data to revert the settings to their default values. This will clear all user-defined NLP settings for your selected data source.
- When prompted, click Yes to confirm.
- Click Save when you have finished making changes to the NLP settings for the selected data source, or Cancel to revert them. Either of these options will close the active window, and you will return to the previous one.
Use your model to query an NLP data source by creating a natural language search.