How to custom train KBQA and ODQA model

How can I custom train a KBQA and ODQA model. Please give me details explanation. How to build from scratch.

  1. which model should I train
  2. how to customize the configs
  3. datasets and it’s format
  4. how to use the custom train model

Tutorial for training a custom ODQA model

For KBQA you can use this config DeepPavlov/kbqa_cq.json at master · deepmipt/DeepPavlov · GitHub
First you should train entity detection model
DeepPavlov/kbqa_cq.json at d73f45733d6b23347871aa293309730303b64450 · deepmipt/DeepPavlov · GitHub
(example of dataset: DeepPavlov/ner_lcquad_bert_ent_and_type.json at d73f45733d6b23347871aa293309730303b64450 · deepmipt/DeepPavlov · GitHub)
The next step - relation ranking model DeepPavlov/kbqa_cq.json at d73f45733d6b23347871aa293309730303b64450 · deepmipt/DeepPavlov · GitHub
(example of dataset: DeepPavlov/rel_ranking.json at d73f45733d6b23347871aa293309730303b64450 · deepmipt/DeepPavlov · GitHub)
Then you should train query template type prediction DeepPavlov/kbqa_cq.json at d73f45733d6b23347871aa293309730303b64450 · deepmipt/DeepPavlov · GitHub
(example of dataset: DeepPavlov/query_pr.json at d73f45733d6b23347871aa293309730303b64450 · deepmipt/DeepPavlov · GitHub)

I have followed this tutorial for ODQA, but please tell me how can I prepare my own dataset for this. what is the format of dataset? I want to train on my custom data. and How to save the model in my own directory?

how to build custom dataset for all these three models