Introduction
I believe sentiments towards the power of projects in landing your first job have aligned among Data Science practitioners. A project is near enough essential if you want to stand a chance of breaking into Data Science, and many people are beginning to clock on which means you ought to do something different to stand out.
Since many Data Scientists don’t have great software engineering skills – unless you’ve transitioned from software engineering of course – creating a graphical user interface (GUI) for your project would instantly set you miles ahead of many other candidates.
If you fall into the category of Data Scientists that lack the software engineering knack, like myself, don’t feel discouraged. There are many open-source platforms that could help you. Streamlit is a very popular one, but for this project, I decided to play around with Gradio for no reason other than the fact that the CEO, Abubakar Abid, connected with me on LinkedIn and I was curious to see what he created.
Note: I was not asked to create this demo by anyone at Gradio.
What is Gradio?
Gradio is a free open-source package. It permits people to quickly create customizable user interface components around their machine learning models and arbitrary functions. The great thing about Gradio is that it’s compatible with many Machine Learning frameworks, so my Tensorflow Keras model can slip right in there.
Building the Interface
To follow along, you could simply fork the Github repository:
Follow the instructions within the README.md file to install the requirements, data, and models – See my post discussing the importance of ReadME files and how you could write one for your next project. Doing this would install all the necessary packages you need.
Many of you have been following my Sentiment Analysis: Predicting Whether A Tweet is About a Disaster project. The goal was to determine whether a tweet was talking about a disaster or not. The goal of our interface is to test new and unseen instances with our Deep Learning model. In this instance, I used a Tensorflow Keras BiLSTM model, but you can decide to switch the model.
- To do this you would need to train a new model on the
train.py
script and change the model path in theuser_interface.py
script.
In order to create our GUI with Gradio, we simply make the call to the interface function and pass three parameters:
- fn: A function the interface is wrapped around. This function would be called automatically when a user interacts with the user interface so that we could get a prediction for our model.
- inputs: The input could be a single Gradio input component or a list of Gradio input components. Essentially, we are defining the type of input that Gradio should expect from the UI.
-
outputs: Depending on your problem, the output could be a single Gradio output component or a list of Gradio output components. We must tell Gradio in advance what the returned output by our function should be. This allows Gradio to determine how to represent our output on the user interface.
Now that we’ve created the function and the Gradio interface. We just need to launch it and run the script.

Conclusion
When seeking to break into Data Science, it’s important to do as much as you can to stand out from the pack. Creating interfaces for your Data Science projects brings your source code to life, making the experience for hiring managers, recruiters, and other Data Scientists in some instances, more real. To further add, your capabilities as a Data Scientists also become more accessible to the less technical people that cannot read code which is something that you’ve got to take into consideration.
Thanks for reading. Be sure to connect with me on LinkedIn and Twitter!
Related Posts:
7 Free Online Resources For NLP Lovers