Overview
Once you have generated predictions from your unlabelled data source (though the Quick Tag App) you may wish to create a prediction model to use with other data sources, for example in our Quick tag documentation example we took a product catalog and predicted the season in which each product could be sold. Using these predictions as the basis of a prediction model means we can use this to predict seasons on other similar data sources (a new product catalog for example).
Using the Quick tag app and then generating a model for later use allows you to save time and money on labelling your data and also allows you to review and improve predictions and enhance the model built through Active Learning.
This article follows on from the Quick Tag documentation, we would recommend reading this ahead of building out your own App.
This guide is for building custom predict apps from an existing Quick Tag App's predictions, if you need one of Graft's preconfigured prediction apps please see here, or for Custom Predict Apps using other label sources (not a Quick Tag) please see here.
What's going to happen...
- First we will name & configure the Entity with the field(s) (Target) using the Quick Tag App as a data source
- Second we will name & configure the App (classifier) that will be built and then used to generate predictions on the field we selected earlier
- Third we will select the Predictions generated in the Quick Tag App
- Finally we will create your predict App which will generate those predictions on the target field
|
We can then test using the Try It tab in the UI. If the performance of your predict app is not what you are expecting you can use Active Learning to review predictions, update those that need it and retrain the model.
Pre requisites
You will need to have created a project to build your search app in and have used built a Quick Tag App to use as your label source.
App Selection
-
Select the Predict App from the App Library template tab
- Mousing over the App tile will display a short description of the App and its applications
Quick Tag App Selection
Select the Entity that was created when you built your Quick Tag App from the Create an app with an Entity section
(in our example this is my_unlabeled_catalog) |
Entity Configuration
Samples will be shown below the selections allowing you to validate you have made the correct selections
|
|
or
|
If a row in your data is missing an entry for one or more of the fields selected to be predicted against, the row will not be embedded and a prediction can not be generated.
Selecting your label source
Once the basic entity configuration is made (which field(s) we want to generate a prediction for) we now need to provide some labels to show examples of the prediction values we are looking for.
Add a name for the Prediction APP (Graft will default to the selected Entity name followed by _prediction - given character constraints the original Entity name may be truncated) |
|
Choose the field in the entity data source which contains the labels - in this case it is the myquicktagappprediction
|
|
Samples will be shown below the selections allowing you to validate you have made the correct selections
The label field (in this example from the Quick tag app - Season) and the fields selected when configuring the Entity (product_category and product_description) |
Finalize the APP configuration
Once you have completed the configuration and you are happy with the provided samples
-
Click on CREATE APP to start the app creation process or click CANCEL or the
to return to the previous step
Graft will now process all of your data (which may take some time depending on the size of your data set) and upon completion will show the App TRY IT tab. Once the data ingestion has been completed you can navigate away from the App UI and return later to review the completed App if required.
TRY IT
The TRY IT tab allows you to experiment with your new app without the need for any coding skills and allows you to test the configuration, filter results and if necessary adjust the app configuration.
The right hand panel shows the current configuration, the name of the entity which holds your data to be predicted against
The Enrichment name, its current performance see Monitoring for more details
IMPROVE PERFORMANCE shortcut to Active Learning
The fields to be used to generate a prediction
The current status of the data set with options to sync or export data |
- Clicking on IMPROVE PERFORMANCE will start an Active Learning session for the prediction data allowing the user to review and correct predictions and improve their custom prediction model
- Clicking on the EXPORT DATA button will jump to the Project SQL tab allowing the user to export their prediction data, further details below.
- Clicking on the SYNC DATA button will ingest and process all the items associated with the data source, with how the predict app is created all initial data will have been sync'd, however, if further data is added to the source this button can be used when needed.
-
Clicking on the
icon will schedule daily ingestion and processing of your data source. If you would like to configure more frequent data processing you can enable a processing workflow.
Exporting your predictions
Clicking on the EXPORT DATA button will jump to an automatic SQL query of your prediction results
By Default the SQL will include the fields of your data source in order and additional fields related to predictions (appended to the end). This query is limited to 100 entries, but you are able to remove or adjust this line and tweak the SQL as much as you require.
The additional fields included are...
- target_<entity_name>: the value of the field which is going to be labeled
- <entity_name>_prediction: the predicted value
- e.g. my_quick_tag_app_pre_1_prediction
- <entity_name>_pred_prob: the probability of the generated predicted value
- e.g. my_quick_tag_app_pre_1_pred_prob
Once satisfied click RUN QUERY to generate your results which can be exported. Further details on the Managing Results can be found here.
Adhoc
The ADHOC sub tab within TRY IT allows you to query your new app with text that is not within your data set.
For example using our demo product catalog you could add in a short description of a item and see the prediction generated
Search in Data Set
The SEARCH IN DATASET sub tab within TRY IT allows you to see the current predictions and filter on specific text.
Type in a suitable phrase and click FILTER.
The fields are laid out in the following sequence...
- Unique Key: the Unique reference value for each element in your data source (e.g. product_id)
- Prediction: The prediction made by the model (e.g. my_quick_tag_app_pre_1_prediction <enrichment_name>_prediction)
- Embedded Fields: One of more fields used in the creation of the Entity (e.g. product_subcategory & product_description)
- Remaining fields: from the data source: product_title, price etc
API tab
This tab allows you to experiment with an API snippet which can then be copied and used in your own development environment to retrieve the complete prediction results.
You will need an API key to start. If none are available Click on the Create an API key link and follow these instructions. If there are one or more API keys in the project you can switch between then using the API key drop down menu. Click on MANAGE KEYS to add or delete new keys.
The API snippet is controlled from the configuration bar on the right.
Changes made to the configuration are immediately shown in the code.
Use the Output format drop down to switch between CSV (default), TSV or JSONL (JSON Lines) formats
The Entity predict adhoc field allows you to enter your test text for each field you selected earlier in the configuration of the Predict App.
In this example this is 2 fields product_description and product_subcategory. Replace the default "query text" with an appropriate entry
|
|
|
Once you have added an API key click on TEST REQUEST to run the API query.
Copying the Request Code
Click on the icon to the right of the REQUEST heading in the top left hand corner of the code window
Copying the response
Click on the icon to the right of the RESPONSE heading in the top left hand corner of the results window
Settings tab
This tab allows you to delete your app, see which field is being processed for the App and also enable the App for external API access.
You can edit your App's configuration by clicking on the icon, see here for more details on what can be changed.
App API limits
The number of Apps available for external access is limited by your tier. If no APIs are remaining you will need to disable any existing APIs (save the changes) and then enable the App API of interest or consider upgrading to a bigger tier.