Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return new Promise(async (resolve, reject) => {
log.title('NER')
log.info('Searching for entities...')
// Need to instanciate on the fly to flush entities
this.nerManager = new NerManager()
const { entities, classification } = obj
// Remove end-punctuation and add an end-whitespace
const query = `${string.removeEndPunctuation(obj.query)} `
const expressionsObj = JSON.parse(fs.readFileSync(expressionsFilePath, 'utf8'))
const { module, action } = classification
const promises = []
// Verify the action has entities
if (typeof expressionsObj[module][action].entities !== 'undefined') {
const actionEntities = expressionsObj[module][action].entities
/**
* Browse action entities
* Dynamic injection of the action entities depending of the entity type
*/