Intro to NLP
with IBM Watson
Processing with AI
Are you ready to discover Natural Language Processing? NLP is a subfield of AI that focuses on the analysis of natural language (the language human speak, as opposed to a programming language). In this module, you will learn how NLP works and use IBM Watson to add natural language processing to your projects!
Definitions
- Natural Langage Processing (NLP), is a subfield of AI and computer science that focuses on the interactions between computers and humans using natural language (the language you speak every day).
You are probably using multiple tools based on NLP every day, for example:
- Autocomplete/Word Completion on your phone
- Speech recognition on vocals assistants
- Spell checking
- Computer-assisted translation
- Automatic moderation on social networks
- Newspaper classification
- Natural Language Understanding (NLU), is a subfield of NLP that focuses on the meaning of the analyzed language. This is not the same as NLP, for example OCR, part of speech tagging, or even sentiment analysis is not trying to understand the meaning of a sentence, but is only meant to gather more information about it. (ed. That's why I believe the tool we are using should be named IBM Watson NLP and not NLU!)
- An API (Application Programming Interface), is a tool used by developers to connect different IT tools.
You are provided a template. Read the instructions below before starting to code.
Going further
Tools
- ml5.js is a Javascript framework developed by teachers from NYU. Built on top of TensorFlow.js, it enables you to quickly use a pre-trained model in your browser using Javascript.
- You can also check alternatives to IBM Watson NLU with:
- Runway ML is a desktop app that makes it easy to try a lot of machine learning models.
Resources
- Video by The Coding Train about word2vec, a vector-based representation of words that enables you to make crazy stuff with words (like subtracting them for example!)
- Awesome NLP, a compilation of resources dedicated to NLP.
Projects examples
Quiz
Quiz
Watch the video above first, then answer the quiz to make sure you understand the main notions. Some questions may need to be looked up elsewhere through a quick Internet search!
This quiz is mandatory. You can answer this quiz as many times as you want, only your best score will be taken into account. Simply reload the page to get a new quiz.
The due date has expired. You can no longer answer this quiz.
Let's do it!
You will need:
p5.js Web Editor is a web editor for p5.js, a JavaScript library to make coding accessible to artists, designers, educators, and beginners.
Watson Natural Language Understanding is an API analyzing text to extract metadata from content such as concepts, entities, keywords, categories, sentiment, emotion, relations, and semantic roles using NLP and NLU.
Useful links:
Have a look at the IBM API documentation to learn how to use different analysis functions. Don’t hesitate to pre-fill in the .html part a text relevant to your use case. When you're done, don't forget to submit the link to your p5.js sketch below!
EXERCICE
-
Log in on the p5.js web editor with your GitHub account and create a copy of this project
If you don't have a GitHub account, now is the time to sign up!
- Follow the steps from the video :
- Choose a problematic and define a use case
- Pick at least three analyses returned by the API (sentiment, categories, keywords, etc.) including at least one not present in the video, that are relevant for your app.
- Display the API responses in your webpage using HTML elements.
- Explain why you picked these analyses, as comments in your
sketch.js
file or directly as HTML elements. - Follow the steps from the video: choose a problematic, pick relevant analysis then display the API responses in your webpage using HTML elements.
- Describe a use case for your sketch directly on your webpage. We expect at least an explanation on who would be your users and how they would benefit from your application.
- This is a game for children learning numbers.
- This is an example of a game that could be part of a bigger series on letters, animals, jobs. Children from ages 3 to 6 (kindergarten/pre-school) would play with them at home. To help our model with recognition (and increase revenues!), we could also sell a playing card set so that instead of recognizing a number on any picture, we could focus our work on recognizing perfectly 10 specific cards.
- This is an app for colorblind people to tell them the color of an object.
- This app was made to help colorblind people dress (especially people having a monochromatic vision), by taking a picture of their clothes when they dress in the morning. Using AI we can detect both the color and the type of clothes to suggest an outfit. With further development, we could store all the clothes that a user have to directly suggest things that would work with the clothes in the picture.
The way you present API's output and all explanatory texts needs to be consistent to your use case.
What do we expect when we ask for a "use case"?
Generally explaining at least the problem you are solving, a basic description of your users and how your project will help them is enough.
For example:
Another example:
That does not mean that a long answer is mandatory, but give us a bit of context, if your use case is 50 characters long, there's probably a problem!
If you prefer, you can also follow the Five Ws. method.