The goal of this homework assignment is for you to use the knowledge gained in the HTTP Trigger lesson and get hands-on.
For this assignment we will create a Serverless Function which removes the English list of stopwords from a given text. The code for the stop words remove function will be provided for you here. We also uploaded a test data sample file that you can use to test your Serverless Function.
Let's begin!
-
For the sake of this tutorial, we’re going to install the Natural Language Processing library nltk. Create new Function project and run:
pip install nltk pip install numpy
-
Move
nlp_text_processing.py
to your new function directory. -
Import
nlp_text_processing.py
in your Serverless Function. You can call the relevant functions using:processed_text = remove_stop_words(text) tokens = tokenize_text(processed_text) entities = get_entities(tokens)
-
Adjust the Serverless Function so it returns
processed_text
,tokens
and entities as aresponse
. -
Start the function, go to Postman and make the following POST request using the data_sample file as input:
Test if your function works as expected.
-
Solution can be found here, try to accomplish it on your own first.
Please share you solutions on LinkedIn and Twitter using the #AzFuncUni hashtag and mention us. We would love to see it!