AWS Startups Blog

Hugging Face and AWS: Democratizing Natural Language Processing for Businesses and Developers Worldwide

Hugging Face and AWS partner to bring over 7,000 NLP models to Amazon SageMaker with accelerated inference and distributed training

The increasing integration of voice-enabled digital assistants into devices like smartphones and speakers makes it easy to take the technology for granted, but the software and processing that enable devices to recognize and execute seemingly simple commands like, “Volume up two” or “Dim the lights” have deep roots. That holds true as well for the related technology behind machine translation and speech-to-text

processing. For example, this technology enables someone to speak into a phone in English and have it speak out your text translated into a different language like Korean, or for a surgeon to dictate notes aloud in an operating room and have a computer accurately transcribe and file them.

Collectively, these capabilities depend on a technology called Natural Language Processing (NLP) that— at a basic level—builds and trains machine learning models on large data sets of speech and text to recognize individual words, understand the structure and context in which they’re presented, and derive meaning from that presentation in order to take some sort of action. Engineers have worked for decades to refine NLP capabilities by making the technology more accurate, expanding the number of languages, dialects, and accents supported, and growing the lexicon it can recognize.

Language constantly evolves, however, and NLP models must also evolve to remain effective, a process that can involve costly and time-consuming retraining. In addition, as organizations around the world seek to integrate NLP capabilities into their operations, they must often build and train new NLP models to account for the specialized terminology used within industries like healthcare, manufacturing, and financial services. These hurdles make it expensive and difficult for startups and other small and medium-sized businesses to take advantage of NLP and scale it across their global operations, especially when they don’t have in-house access to machine learning expertise and resources.

Enter Hugging Face, a global leader in open-source machine learning (ML) that was founded in 2016 and is headquartered in New York and Paris. Hugging Face Transformers is one of the most popular open-source ML libraries ever developed, offering more than 7,000 state of the art NLP models, known as transformers, fine-tuned in over 140 languages, with offerings as diverse as Ndonga, a Bantu dialect spoken in Namibia and parts of Angola, Breton, a Celtic-derived language spoken in parts of France, and Esperanto, a constructed, international language spoken in various parts of the world. “We’re on a mission to advance and democratize NLP for everyone,” said Clement Delangue, CEO of Hugging Face. The company is fast growing and recently completed a $40 million Series B funding round.

Students and developers from across the globe have downloaded Hugging Face models and training datasets more than 1 million times per month, to put them to work for everyday use cases. For example, in a matter of just days, a pizza company could train a Hugging Face model for pizza terminology, developed from domain-specific examples, to build a conversational chat bot that is an “expert” in pizza sizes, crusts, toppings, and delivery times to conveniently answer customer questions through an app.

Now, AWS and Hugging Face are announcing that Hugging Face has selected AWS as its preferred cloud provider, and Hugging Face recently introduced AutoNLP and the Accelerated Inference API, new hosted services built on AWS using Amazon SageMaker—an ML service that makes it easy to quickly build, train, and deploy ML models in the cloud and at the edge.

AWS has also made generally available Hugging Face Deep Learning Containers (DLC) so developers can quickly get started building applications with state-of the-art language models available through Hugging Face on Amazon SageMaker. With SageMaker, customers can take NLP model experimentation from days to minutes using its easy-to-use integrated development environment (IDE) to track and compare training experiments. Users can also take advantage of advanced distributed training capabilities in SageMaker—the same capabilities that have for two consecutive years made possible record training time for the T5-3B language model on PyTorch.

“Hugging Face is a resource for startups and other businesses around the world. Our transformers can help them build virtually any natural language processing application at a fraction of the time, cost, and complexity they’d could achieve their own, helping organizations take their solutions to market quickly,” Delangue said.

Numerous joint customers of Hugging Face and AWS are already putting NLP to work to improve their customer experience. For instance, Quantum Health, a company that makes healthcare navigation smarter, simpler, and more cost-effective for everyone, using artificial intelligence for text classification, text summarization, and question-answering. “For some use cases we just use the Hugging Face models directly, and for others, we fine tune them on Amazon SageMaker,” said Jorge Grisman who is an NLP data scientist at Quantum Health. “We are excited about the integration of Hugging Face Transformers into Amazon SageMaker to make use of Amazon SageMaker distributed training to shorten the training time for our larger datasets.”

“Running on Amazon SageMaker goes even a step further in making it easy for organizations to customize and deploy advanced NLP applications at scale with minimal effort,” said Julien Chaumond, CTO at Hugging Face.

Another example of deploying NLP is Kustomer, a customer service CRM platform for managing high support volume effortlessly. “In our business, we use machine learning models to contextualize conversations, remove time-consuming tasks, and deflect repetitive questions,” said Victor Peinado, ML Software Engineering Manager at Kustomer. “We use Hugging Face and Amazon SageMaker extensively, and we are excited about the integration of Hugging Face Transformers into Amazon SageMaker since it will simplify the way we fine tune machine learning models for text classification and semantic search.”

By leveraging the full capabilities of Amazon SageMaker Studio, Hugging Face and AWS are also enabling developers to choose their own machine learning framework such as PyTorch or TensorFlow for running NLP containers with one or multiple GPUs.

Through this collaboration, AWS and Hugging Face’s customers will now be able to easily train their state-of-the-art language models and take advantage of everything from text generation to summarization to translation to conversational chat bots, reducing the impacts of language barriers and lack of internal machine learning expertise on a business’s ability to expand. To learn more, visit the documentation.