Skip to content
This repository has been archived by the owner on Jan 1, 2025. It is now read-only.

Update Entity Extraction Logic in firstEntity Function #120

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions services/receive.js
Original file line number Diff line number Diff line change
Expand Up @@ -407,8 +407,14 @@ module.exports = class Receive {

setTimeout(() => GraphApi.callSendApi(requestBody), delay);
}
firstEntity(nlp, name) {
return nlp && nlp.entities && nlp.entities[name] && nlp.entities[name][0];
firstEntity(nlp, name) {
if (nlp && nlp.entities && nlp.entities[`wit$${name}:${name}`]) {
return nlp.entities[`wit$${name}:${name}`][0];
} else if (nlp && nlp.traits && nlp.traits[`wit$${name}`]) {
return nlp.traits[`wit$${name}`][0];
} else {
return null;
}
}

handleReportLeadSubmittedEvent() {
Expand Down