Integrating external ML libraries – a Hugging Face example
Over the last few years, there has been a massive increase in the number of ML models created by startups and institutions. There is one that, in my opinion, has stood out above the rest for prioritizing the open sourcing and sharing of their models and methods, and that is Hugging Face. Hugging Face makes it incredibly easy to use ML models that some of the best researchers in the field have created for your own use cases, and in this bit, we’ll quickly show off how to integrate Hugging Face into Streamlit.
As part of the original setup for this book, we have already downloaded the two libraries that we need: PyTorch (the most popular deep learning Python framework) and transformers (a Hugging Face’s library that makes it easy to use their pre-trained models). So, for our app, let’s try one of the most basic tasks in natural language processing: Getting the sentiment of a bit of text! Hugging...