flat-fuchsia•2y ago
Entity recognition
Hi all, I’ve been having some trouble with entity recognition. I’m building a large bot for an Orthodontic practice and have created a few different entities to be used in some intents.
An example is ‘Treatment_Type’ and one of the values is Invisalign, for which I have multiple synonyms.
Each time I test to see if the system picks up Invisalign as a treatment_type, it doesn’t work even though it’s typed exactly the same.
I’ve resorted to using conditions to check for certain words but this doesn’t seem like a sustainable solution.
I could be doing something wrong, so would def appreciate some guidance. I saw that Daniel mentioned using the Set AI step as a workaround but I’m not sure how to use that either so, again, would love some guidance.
Thanks!
7 Replies
dependent-tan•2y ago
Hey James! Are you using it in a capture step?
So the Set AI step uses AI to do this.
Basically what you’d do is
1. Capture step to save whatever a user says to last utterance
2. SET AI step with instructions to extract the treatment type into a variable. Make sure to specify examples in the prompt
This is actually a more robust way to do it
subsequent-cyan•2y ago
Hi James, i was trying something similiar. Were you able to solve this?
flat-fuchsiaOP•2y ago
Ah okay gotcha! Thanks for this
I ended up doing it a different way but will try Daniel’s recommendation (sorry I just saw these messages). Basically I used the regular Set step to assign a variable to the AI response and then used a condition to check if certain key words were present in the AI response variable
optimistic-gold•2y ago
you can just limit the response to the output you want using a good prompt, it's much easier
subsequent-cyan•2y ago
no worries 🙂 I used the setAI step to filter and it is working pretty good. But sometimes the formatting of the values are wrong or there are additional terms. Need to try finding solid prompts
any idea how i can avoid additional terms in the output of the setAi step.
for my use case i am trying to filter out the lectures from the users sentences. But the Ai Step adds the term 'lecture' to the output.
for example: lecture: biology.
Do you have any suggestions for a good prompt in this case?
optimistic-gold•2y ago
maybe something like "Based on the user's last utterance, output only the lecture and nothing else. User's last utterance: {last_utterance}"
i couldn't word it very well though
subsequent-cyan•2y ago
Yes, had the same problem 😄 but thank you will try that as well