Overview: Knowledge Graph Training
This document outlines the complete process to train the Knowledge Graph with e-commerce data, covering:
- Extracting structured data using WooCommerce APIs
- Crawling supplemental web content
- Uploading AI model configurations
- Loading enriched product/category data into the Knowledge Graph
-
Extract records from woocommerce
-
Upload your WooCommerce store configuration file to:
[POST]: /woocommerce-store/config.
Click here to view sample file. -
Upload your post entity extraction config file to:
[POST]: /woocommerce-store/entity/records/extract/config.
Click here to view sample file. -
In this step we will extract entity(products, categories, posts) records from woocommerce store.
Use the following API endpoint three times, once for each entity:
[PUT]: /woocommerce-store/entity/records/extract.
Each call requires the following parameters:entity: Type of data to extract (products,categories, orposts)key_fields:- For
products:"id", "slug", "sku"- add all of this string as one by one. - For
categoriesandposts:"id"
- For
store_name: Always use"casters"max_records: Always use8000
-
-
AI training configuration
-
Upload your vector store configuration to:
[POST]: /vector-store/config.
Click here to view sample file. -
Upload your knowledge graph product attributes configurations.
Use the following API endpoint two times, once for each sample file given:
[POST]: /kg/config.
Click here to view sample file 1.
Click here to view sample file 2. -
Upload your ai-search configuration to:
[POST]: /search/config.
Click here to view sample file
-
-
Load data to knowledge graph
- Load your e-commerce products and categories extracted from woocommerce apis to the knowledge graph using the endpoint:
[PUT]: /kg/train.
Use "casters" as value of the parameter "store_name".
- Load your e-commerce products and categories extracted from woocommerce apis to the knowledge graph using the endpoint:
-
Now, you have done with the training process in kray ai model training, then go to the parse tree service.
-
Natural Language Processing
-
NER (Named Entity Recognition) training:
[POST]: /train/ner.
Use "casters" as value of the parameter "namespace". -
Train NER synonyms:
[POST]: /ner/synonyms/many.
Click here to view sample file. -
Verify Synonyms are trained properly:
Go to the Kray ai model training interface and hit thesearchendpoint with the following configuration:- Use "casters" as value for the parameter "namespace".
- And here is the sample request body for this endpoint with the alternate name for 'heavy duty casters'
{ "user_query": "heavy load casters", "user": "site-search", "limit": 10, "whitelabel_domain": "", "group": { "filter": "all", "sources": [ "string" ] } }
-
Now you are done with the Knowledge Graph Training 🎉.