Determining focus of conversation + extracting entities w/out specific words & phrases

Hello! :wave:

I’m building a coachbot that begins by assessing what the person wants to focus on. So, for example if they say “I need help staying motivated” the focus is set as “motivation” and it takes them to a conversational flow designed to help with motivation challenges.

Here’s a sample of the current implementation:


First question: is this a good way to go about it? When should I write more specific intents (like choose_focus_motivation) vs. use entities in a more generalized intent?

Second question: what about when the entity doesn’t show up in any specific word or phrase in the sentence? Is there a way to extract entities in this case? example:


  • I can’t get myself to keep working
  • I’m just laying in bed all day
  • I haven’t been able to get started

I suppose we could code those as synonyms, but that doesn’t seem sustainable.


Hey @captain-curious, to me these examples all seem to mean the same thing - trouble staying focused. Would you suggest something different dependent on whether the user says “procrastinating” or “motivation”? And what should in the situation that they say “I can’t get myself to keep working” (without entities)?

1 Like

Hi @akelad! Thanks so much for your response.

The examples above do all mean the same thing, which is trouble staying focused.

My current implementation is to determine the “choose_focus” intent and look for an entity that captures what kind of focus the user is describing. Our two starter focuses are “Motivation” and “Conflict”.

So that looks something like this…

## intent:choose_focus
- I need help staying [motivated](focus:motivation)
- I need help with [motivation](focus)
- I keep [procrastinating](focus:motivation)
- I'm experiencing [conflict](focus) with a colleague
- I'm having [trouble working with](focus:conflict) my boss
- I [don't get along with](focus:conflict) my new coworker

When these intent entity pairs are detected, it should proceed with one of these two stories…

## focus on motivation
* choose_focus{"focus":"motivation"}
- utter_focus_motivation_confirmation <!-- e.g. "I have an exercise that can help with motivation. Want to try it?" -->
* ...

## focus on conflict
* choose_focus{"focus":"conflict"}
- utter_focus_conflict_confirmation <!-- e.g. "I some questions that can help resolve conflicts with colleagues. Want to try it?" -->
* ...

This isn’t working currently, and I’m not sure why. It’s detecting the intent entity pair, but going to the same response for both motivation and conflict.

Should I change the intents to choose_focus_motivation and choose_focus_conflict and not be using entities at all here?

No, you shouldn’t need to switch to intents. What you need to do is create a categorical slot to store this information though, otherwise the featurization just cares about whether any value is present in the entity or not.

1 Like

Got it. Thanks @akelad!

And how about when the entity isn’t present as a specific word or phrase? Like extracting {“focus”:“motivation”} from statements like “My mind keeps wandering off” “It’s been hard to get started on my work”. Is this possible? What’s the recommended method?

i would say you can handle this in your stories. So if no clear entity is present (and therefore the slot doesn’t get filled), perform a different action

1 Like

Gotcha. Thanks @akelad!