attendee-recognition

Library for recognizing attendees from utterance

Usage no npm install needed!

<script type="module">
  import attendeeRecognition from 'https://cdn.skypack.dev/attendee-recognition';
</script>

README

attendee-recognition

Recognizes attendees from utterance, used in BaM and BaR intents.

Example 1 - attendee history is available:

In this case, attendees are sorted, disambiguated and external attendee names are resolved, all of this is possible thanks to attendee history.

const isUtteranceSpoken = true;
const isAutoDisambiguationEnabled = true;

const attendeeParamsWithAttendees = recognizeAttendeeParams(
  'Book a meeting with Doe and external@example.com',
  isUtteranceSpoken,
  email => findEmployeeByEmail(email),
  (name1: string, name2?: string) => findEmployeesByNames(name1, name2),
  () => getAttendeeHistoryForUser(),
  isAutoDisambiguationEnabled
);

expect(attendeeParamsWithAttendees).toEqual([
  [
    { email: 'external@example.com' },
    [{ email: 'external@example.com', firstName: 'FirstNameFromHistory', lastName: 'LastNameFromHistory' }]
  ],
  [{ name1: 'Doe' }, [{ email: 'john.doe@example.com', firstName: 'John', lastName: 'Doe' }]]
]);

Example 2 - attendee history is unavailable:

In this case, attendees cannot be sorted or disambiguated and external attendee names are not resolved.

const isUtteranceSpoken = true;
const isAutoDisambiguationEnabled = true;

const attendeeParamsWithAttendees = recognizeAttendeeParams(
  'Book a meeting with Doe and external@example.com',
  isUtteranceSpoken,
  email => findEmployeeByEmail(email),
  (name1: string, name2?: string) => findEmployeesByNames(name1, name2),
  () => [],
  isAutoDisambiguationEnabled
);

expect(attendeeParamsWithAttendees).toEqual([
  [
    { name1: 'Doe' },
    [
      { email: 'john.doe@example.com', firstName: 'John', lastName: 'Doe' },
      { email: 'peter.doe@example.com', firstName: 'Peter', lastName: 'Doe' }
    ]
  ],
  [{ email: 'external@example.com' }, [{ email: 'external@example.com' }]]
]);