Inspiration
Imagine a situation in which you are chatting with your friends or colleagues in your leisure time. Many times, we talk about very common topics like movies. We, being movies enthusiasts, wanted to make some interesting application about movie suggestion using some cool technologies. I bet you'll be as tempted as we are after reading what is does.
What it does
The application is very simple. You just have to ask Alexa about whatever you remember about any movie and Alexa will give you the up to top five related movies. For example, you can simply ask, 'Alexa, Guess the movie of which the plot is Father of a man suffers from Alzheimer disease.A man loves his father very much' (This is a plot of the movie named 'A separation'). And Alexa would suggest top five movies. Ideally, the first movie should be 'A Separation' in this case and all the others movies will contain similar events. Another functionality which we have added, is about the summary of the movie. When one asks Alexa about the movie summary, Alexa would give a brief story, and some important metadata about the movie like actor, release year and IMDB rating.
Let's discuss how exactly we built it.
How we built it
Well, it seemed simple at the first place when we were thinking about the scope of this app. However, it got complicated as we decided to introduce Natural Language Processing on it. Moreover, none of us had an experience working with Alexa before hand, therefore we took considerable amount of time working with that as well.
In the back end, first of all, we scrapped the data (plot and other metadata) of around 250 movies from IMDB and then we designed few queries based on the available movies' plots. The different steps of algorithm are:
- Named Entity Recognition
- Keyword Extraction
- Semantic Similarity between query and movie plots. We trained a model using above steps on a movie plots and we used this model to get the result of user query. We are communicating to this model using a simple Flask web server through which we exposed an API which will receive the request and send back the results to Alexa.
In the front end, as we used Alexa. We added a new Alexa skill to determine the movie. For which we used AWS Lambda functions which will communicate with our web server.
The whole system is implemented in Python. We love Python :)
Challenges we ran into
Well, the first and biggest challenge was working with Alexa. We did not know how to add skills to Alexa, so we had to do it from scratch.
The biggest challenge was to find similarity between user query and movie plots. Initially, we planned to design our system with comparing the name entities in the user query against name entities in the plots ( and therefore we planned to use Elasticsearch). But this approach could produce very accurate results as it could not consider the semantics of the query. Our ultimate goal was to find a matching movie given a brief summary of the movie irrespective of the words used in plot. Therefore, we had to think of semantic similarity rather than simple text match.
Moreover, while training the NLP model, we struggled to reduce the time taken by model to produce accurate results. Our model is evolved through several phases. We managed to make it more and more efficient and less time consuming. Currently, it is taking around 15 seconds, but partly because we are using an EC2 micro instance and therefore we do not have enough processing power, which is ultimately our next challenge.
The NLP model designed by us requires a significant processing. We did not have any instance which will have a good processing power. So we used the best resources we had, however, if we are given a good resource, our queries will run much faster.
Accomplishments that we're proud of
The proudest thing about our project is the accuracy. We managed to get the accuracy around 90%. Moreover, we built an entire application with Alexa after starting from scratch.
What we learned
- Adding skillset to Alexa.
- Lot of NLP programming and concepts that we brainstormed.
- A good teamwork.
- Project planning, Software designing phases and time management.
What's next for Alexa, Guess the movie!
We would love to work on this brainchild of ours in the future. Some of the upgrades which we thought of are:
- We can use a larger movie dataset.
- We can reduce the response time, probably by using the distributed systems.
- We can incorporate more features while training the model.
- Guess the movie after giving other entities such as Actor / Director's name.
Log in or sign up for Devpost to join the conversation.