I am working in a bot project where it is needed to extract movie titles and tv station from user’s utterances, for example:
"Please, I want to watch "
“” (in this case, the user directly provide the movie title)
"Put on the tv "
"Watch <tv_station>
“<tv_station”
Although I have put the utterance in English the user’s language is in Spanish.
The pipeline that I am intend to use is the following:
“es”
I have several problems that I have not sure how to resolve:
The user can request a tv_station or a movie title directly without using a verb (e.g. saying only “<movie_title>”
The set of tv_stations is a limited and a short one (about 200) but some of them can include normal spanish words (e.g. the equivalent in english would be the article “the”)
The set of “movie_titles” is limited (we have a list) but it is very large (about 100.000) and its vocabulary is totally open.
For the tv_station, I think we can try to use the lookup tables. Because the lookup table do “exact matching” we could inject in them some expected misspelling.
However I dont think that lookup tables is a good solution for the movie titles (e.g. the match is exact and titles can include any word of the language).
Any suggestion about how to proceed in this case? For example, doing a custom entity extractor? If so, any recommendation about how to do it?
Also, any suggestion about the case in which the user does not use a verb and say directly the name of the tv station and/or the movie title?
Lookup tables for the tv_station looks like a good idea. Please keep in mind that we don’t do an exact match if lookup tables are used, e.g. we do not mark an exact match directly as an entity. We rather use those matches as features that go into our machine learning models. Thus, it might nevertheless be a good idea to add a lookup table for movie_title. As the entity extractor only gets the user message, e.g. no surrounding utterances, it might be really hard to figure out whether something like “<movie_title>” is actual a movie_title or not. You should make sure to add some examples to your training data that just list the movie title.
If you want to create a custom entity extractor, please have a look at Custom NLU Components.
Hi,
Thanks for the response.
What I wanted to mean by exact matching is that If I add the entry “MTV” as tv_station and the user says “Put mtv”, there will be no match . I think for tv_stations this can handled (is it possible to provide a regexp in the lookup table itself)?
Anyway I would appreciate a lot any advice about the following:
We have around 200 tv_stations. So, any rough estimation about how many train samples to provide?
We have around 30.000 movie titles (i made a mistake in the previous message). So, any rough estimation about how many train samples to provide?
Do you recommend to have different intentions for utterances related to tv_stations and movie_titles although sometimes the same verb (e.g. put ) is used?
Hi, if you want to have a component that extract entities on exact matches with a lookup table, you should write your own custom component.
(1) Regarding the number of training examples, it is really hard to say. As always, the more the better. Start with 100 examples for each and if the results are not as expected, increase the number of examples where you see the most errors. You can use rasa test for that purpose (Evaluating Models).
(2) Do you need the different intents for your stories? The entity extraction is independent from the intent classification. So there is no benefit in splitting them up just because you want to improve your entity recognition.
Thanks again for your response.
The problem with providing 100 examples is that it is difficult to come with 100 different ways of saying the same thing "Put <station_tv> I mean, I would not want to overfit using the same sentence and varying the entity value.
mmhh… in order for the lookup table to work, you should have a few examples in your training data containing some entities listed in the lookup table. It is always hard to say you need to have x number of training examples to get the bot to work. I’m afraid you simply have to try it out and test your bot until you are satisfied.
I don’t think there is a need for extracting movie titles and TV stations in order to watch the TV series that you like. I had a TV that was getting really old and recently broke but I didn’t really panic because I already had a backup plan. I am now using simplyswitch.com to watch my favorite TV series like Prison Break until I buy a new TV. And speaking of a new TV I would be very grateful if someone could give me some advice on what TV brand to choose for a reasonable price. I will listen to any advice until the end of the month when I will receive my paycheck and will be able to buy the new TV.