Build a Serverless Question-Answering API using the Serverless Framework, AWS Lambda, AWS EFS, efsync, Terraform, the transformers Library from HuggingFace

Photo by Jean-Philippe Delberghe on Unsplash

Originally published at https://www.philschmid.de on November 15, 2020.

Introduction

4 months ago I wrote the article “Serverless BERT with HuggingFace and AWS Lambda”, which demonstrated how to use BERT in a serverless way with AWS Lambda and the Transformers Library from HuggingFace.

In this article, I already predicted that “BERT and its fellow friends RoBERTa, GPT-2, ALBERT, and T5 will drive business and business ideas in the next few years and will change/disrupt business areas like the internet once did.”

Since then the usage of BERT in Google Search increased from 10% of English queries to almost 100% of English-based queries


Learn how to build a Multilingual Serverless BERT Question Answering API with a model size of more than 2GB and then testing it in German and France

Photo by Timon Klauser on Unsplash

Introduction

Currently, we have 7.5 billion people living on the world in around 200 nations. Only 1.2 billion people of them are native English speakers. This leads to a lot of unstructured non-English textual data.

Most of the tutorials and blog posts demonstrate how to build text classification, sentiment analysis, question-answering, or text generation models with BERT based architectures in English. In order to overcome this missing, we are going to build a multilingual Serverless Question Answering API.

Multilingual models describe machine learning models that can understand different languages. An example of a multilingual model is mBERT from Google research.


Making Sense of Big Data

Learn how to use the newest cutting edge computing power of AWS with the benefits of serverless architectures to leverage Google’s “State-of-the-Art” NLP Model

Photo by Kyle Glenn on Unsplash

Introduction

It’s the most wonderful time of the year. Of course, I’m not talking about Christmas but re:Invent. It is re:Invent time.

In the opening keynote, Andy Jassy presented the AWS Lambda Container Support, which allows us to use custom container (docker) images up to 10GB as a runtime for AWS Lambda. With that, we can build runtimes larger than the previous 250 MB limit, be it for “State-of-the-Art” NLP APIs with BERT or complex processing.

Furthermore, you can now configure AWS Lambda functions with up to 10 GB of Memory and 6 vCPUs.

For those who are not that familiar…


Learn how to build and deploy an AWS Lambda function with a custom python docker container as runtime with the use of Amazon ECR

Photo by Bernd Dittrich on Unsplash

Originally published at https://www.philschmid.de on December 2, 2020.

Introduction

It’s the most wonderful time of the year. Of course, I’m not talking about Christmas but re:Invent. It is re:Invent time. Due to the current situation in the world, re:Invent does not take place like every year in Las Vegas but is entirely virtual and for free. This means that it is possible for everyone to attend. In addition to this, this year it lasts 3 weeks from 30.11.2020 to 18.12.2020. If you haven´t already registered do it here.

In the opening keynote, Andy Jassy presented the AWS Lambda Container Support, which…


Automatically Sync Python Dependencies and ML models to AWS EFS for your AWS Lambda function

Photo by T.H. Chia on Unsplash

Originally published at https://www.philschmid.de.

Introduction

Part of using Machine Learning successfully in production is the use of MLOps. MLOps enhances DevOps with continuous training (CT). The main components of MLOps therefore include continuous integration (CI), continuous delivery (CD), and continuous training (CT). Nvidia wrote an article about what MLOps is in detail.

My Name is Philipp and I live in Nuremberg, Germany. Currently, I am working as a machine learning engineer at a technology incubation startup. At work, I design and implement cloud-native machine learning architectures for fin-tech and insurance companies. I am a big fan of Serverless and providing machine…


This is the Story of how I became a certified solution architect within 28 hours of preparation

Photo by Fidel Fernando on Unsplash

Introduction

Hello, my name is Philipp and I am working as a machine learning engineer at a technology incubation startup. At work, I design and implement cloud-native machine learning architectures for fin-tech and insurance companies.

I started to work with AWS 2 1/2 years ago. Since then I had built many projects both privately and at work using AWS Services. I like the Serverless services of aws the most. For me, Serverless first always applies.

In short, I have several years of professional and part-time experience with AWS, but no certificate. I know that hands-on experience and knowledge are more important…


Create an action, test it offline, and publish it in the GitHub Action Marketplace

Person holding clapperboard.
Person holding clapperboard.
Photo by Jakob Owens on Unsplash.

Originally published at https://www.philschmid.de on September 25, 2020.

Introduction

Automation, complexity reduction, reproducibility, and maintainability are all advantages that can be realized by a continuous integration (CI) pipeline. With GitHub Actions, you can build these CI pipelines.

“You can create workflows using actions defined in your repository, open-source Actions in a public repository on GitHub, or a published Docker container image.” — GitHub Docs

I recently started a new project at work where I had to implement a new CI pipeline. In this process, I had to call an API, validate the result, and pass it on. I ended up with…


Fine-tune non-English, German GPT-2 model with Huggingface on German recipes. Using their Trainer class and Pipeline objects

Photo by Peter Dawn on Unsplash

Originally published at https://www.philschmid.de on September 6, 2020.

introduction

Unless you’re living under a rock, you probably have heard about OpenAI’s GPT-3 language model. You might also have seen all the crazy demos, where the model writes JSX, HTML code, or its capabilities in the area of zero-shot / few-shot learning. Simon O'Regan wrote an article with excellent demos and projects built on top of GPT-3.

A Downside of GPT-3 is its 175 billion parameters, which results in a model size of around 350GB. For comparison, the biggest implementation of the GPT-2 iteration has 1,5 billion parameters. …


Leverage your Serverless architectures with mounting your AWS EFS volume into your AWS Lambda with the Serverless Framework.

Photo by Jonathan Wolf on Unsplash

Originally published at https://www.philschmid.de on August 12, 2020.

Introduction

Just like wireless internet has wires somewhere, serverless architectures still have servers somewhere. What ‘serverless’ really means is that as a developer you don’t have to think about those servers. You just focus on code.” serverless.com

This focus is only possible if we make some tradeoffs. Currently, all Serverless FaaS Services like AWS Lambda, Google Cloud Functions, Azure Functions are having limits. For example, there is no real state or no endless configurable memory.

These limitations have led to serverless architectures being used more for software development and less for…


Build a serverless question-answering API with BERT, HuggingFace, the Serverless Framework, and AWS Lambda.

Photo by Samule Sun on Unsplash

Originally published at https://www.philschmid.de on June 30, 2020.

Introduction

“Serverless” and “BERT” are two topics that strongly influenced the world of computing. Serverless architecture allows us to provide dynamically scale-in and -out the software without managing and provisioning computing power. It allows us, developers, to focus on our applications.

BERT is probably the most known NLP model out there. You can say it changed the way we work with textual data and what we can learn from it. “BERT will help [Google] Search [achieve a] better understand[ing] one in 10 searches”. …

Philipp Schmid

👨🏻‍💻 Machine Learning Engineer & Cloud enthusiast | 📍Nuremberg 🇩🇪 | https://twitter.com/_philschmid | 📕 https://www.philschmid.de

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store