Family name extraction - Rasa Open Source - Rasa Community Forum

👋 Introducing the Rasa Playground

Family name extraction

post by forwitai on Nov 12, 2020

Hello Rasa Community,

I’m developing a Chatbot and I’m currently designing a form where my bot has to extract different entities starting by first and last names. I’ve managed to extract first names through combining multiple strategies (models & lookup table) and the results are quite good. Now I need to extract family names, but I have no idea how to do this, models don’t perform well and I obviously can’t build a lookup table for this. Did someone manage to do it? Any ideas?

Thanks.

post by Juste on Nov 13, 2020

Hi @forwitai. Are you using SpaCy component to extract names as an entity PERSON? I am pretty sure the pre-trained model should extract names and family names as separate entities (one for a name and another one for a family name). Are you dealing with English names here or a different country names?

post by forwitai on Nov 14, 2020

Hello @Juste, thank you for the reply! In fact, Spacy would have been really helpful if I was dealing with english names, but I’m not. I’m dealing with Arabic, French and English names and Spacy barely extracts some of them. So I’m using a combination of CRFEntityExtractor trained on some NLU data, spacy and lookup tables. The results seem fine by now. The problem is with family names; you just can’t put them in a lookup table, the family name can be in either Arabic, French or English and can be one word, two or even three words.

I ask the user: what is your first name? then what’s your last name? I’m thinking about extracting the whole answer as a last name, but it isn’t a very smart approach, as the user might ask about something else or say whatever crosses his mind.

Can you help me with this? Any ideas?

Thanks a lot!

post by koaning on Nov 16, 2020

Hi @forwitai, my name is Vincent. I’m working on a library that contains NLU components that should make it easier for non-English users to make assistants with Rasa. The project is called rasa nlu examples and it can be found here; Rasa NLU Examples.

I don’t speak Arabic but I’d love to learn more about the problems that you’re encountering. I can’t speak Arabic unfortunately, but I’m trying to support tools to rasa nlu examples covering non-English languages like Arabic.

In particular, I’ve added support for the following tools for Arabic:

If you can share a config.yml pipeline that you’ve tried locally and perhaps part of your nlu.yml file, then I might be able to help you in more detail.

Also, I’ll be speaking at PyData Riyadh this Wednesday. My goal is to have a talk with folks to see if there’s more tools that I can make available for Arabic. Feel free to join in to exchange ideas!

post by forwitai on Nov 19, 2020

I’m actually using a form and trying to extract first and last names inside! The bot first asks what’s your first name? then what’s your last name? and is supposed to extract both separately.

Concerning Spacy, I’m using “fr_core_news_sm”, it gives good results with French and English first names. I use a lookup table to extract Arabic names written in Latin letters; I’ve built a sort of database with around 3000 names.

Here’s an example of my nlu data for first names:

And here’s an example of my nlu data for last names:

I hope my case is clearer now to you, any advice is more than welcome !

post by koaning on Mar 9, 2021

Just wanted to let folks know, this question sparked a blogpost and two tutorial videos. They’re all linked here: Proper Name Detection.