Unknown intent found, while trying to train model using rest api

130 views Asked by At

I was trying to make a panel through which the user can train the model using rest API. But while using the API given for train the model I got the issue “Found unknown Intent”. Below is the code what I have tried

const json2md = require("json2md");

fs.writeFileSync('./domain.yml', params.domain2)
fs.writeFileSync('./responses.yml', params.responses2)
fs.writeFileSync('./nlu.md', json2md(params.nlu.data));
fs.writeFileSync('./stories.md', json2md(params.stories.data));

let req_domain = await processLineByLine('domain.yml');
let req_response = await processLineByLine('responses.yml');
let req_nlu = await processLineByLine('nlu.md');
let req_stories = await processLineByLine('stories.md');
let req_config = await processLineByLine(path.join(__dirname,'../../../../', 'public/apiDocsV1', 'config.yml'));

async function processLineByLine(fileName) {
  const fileStream = fs.createReadStream(fileName);

  const rl = readline.createInterface({
      input: fileStream,
      crlfDelay: Infinity
  });

  let arr = [];
  for await (const line of rl) {
      arr.push(line + '\n');
  }
  return arr.join('')

}

await axios.post('http://localhost:5002/model/train', {
    domain: req_domain,
    config: req_config,
    nlu: req_nlu,
    responses: req_response,
    stories: req_stories,
    force: false,
    save_to_default_model_directory: true
});

And here is the screenshot from the rasa endpoint screenshot

The files look good and even the domain file is also good but unable to create and train the model. Please help

1

There are 1 answers

0
Prometheus On

The domain.yml file seems to be not formatted correctly. Use the site https://www.yamllint.com for checking whether the YML formatting is correct or not.I can see the error Invalid domain file from the screenshot.