Use cases and tools for Natural Language Processing
List of use cases. How to evaluate what to build. Tools and libraries.
Hey reader, welcome to the 💥 free edition 💥 of my weekly newsletter. I write about building machine learning products, working with people, and growing your career. You can learn more about me here. Feel free to send me your questions and I’m happy to offer my thoughts. Subscribe to this newsletter to receive it in your inbox every week.
Natural Language Processing (NLP) is a subfield within AI that deals with making sense of text data. NLP tools enable machines to understand text, interpret its meaning, and then take action based on it. It's used heavily in the real world.
We use products every single day that employ NLP techniques to deliver great user experience. Few of those products will overhear you talking about Chipotle and spam with Chipotle ads across all the apps you use. I already love Chipotle, so the joke’s on them. For unskippable ads, I mute them and close my eyes. Can’t let them win!
For people who're evaluating NLP as a potential career path, I wanted to share a list of real world use cases along with the tools you can use to get started. The job market is amazing for NLP builders. The goal is to understand what use cases can be built and evaluate what interests you as a builder. You should know what tools can be used to accomplish various tasks in NLP.
How is NLP used in the real world?
Here’s a list of use cases that show how NLP is used to build products we use everyday:
Autocorrect: It is perhaps one of the most popular use cases. Autocorrect tools detect spelling/grammar mistakes in our written text. Almost all text editors have this feature e.g. MS Word
Autocomplete: Another popular use case. Autocomplete tools help complete our sentences so that we don’t have to type the whole thing. It helps us write emails faster e.g. Gmail's autocomplete feature
Tools that enhance writing: There are tools that aim to enhance your writing by integrating various features onto a single product. They will spot mistakes, suggest better sentences, and create a better structure overall e.g. Grammarly
Question & Answer platforms: These online platforms allow users to ask questions and then allow other users to answer them e.g. Quora. Given that there can be millions of questions, the tool needs to understand the question and then route it to the right people who can answer them.
Spam detection in emails: Detecting spammy emails is another good use case. All email tools have to do this e.g. Gmail
Conversations with users/customers: These tools are called chatbots. They talk to a user/customer to see if their issue can be resolved easily e.g. Intercom. You can integrate these chatbots into your product to handle simple requests. More complex requests will be routed to human customer-support agents.
Understanding search engine queries: When we type something into the search bar, the tool needs to understand what we typed and then surface relevant content e.g. Google, Bing, DuckDuckGo
Understanding customer intent in eCommerce: This is another variant of the search engine oriented towards eCommerce e.g. Amazon, eBay. The goal is to understand the intent of the query and show relevant products to the potential buyer.
Converting speech to text: Once the words are recognized, these tools make sense of those words and take the right action e.g. Siri, Alexa. Recognizing spoken words is a different field altogether that includes working with audio signals. A tool like Siri integrates both to create a functioning product.
Providing text summary: These tools convert long documents into short summaries. Very useful when you're working in the legal field.
Translating from one language to another: This tools help convert text from one language to another e.g. Google Translate. It's useful for companies that are global and have to work across many languages.
Sentiment analysis: These tools analyze large quantities of text data on platforms like Twitter and understand the sentiment of people for a specific topic e.g. how people feel about a new flavor of ice cream.
Generating human-like text as the output: These tools generate text that mimic human writers e.g. OpenAI GPT transformers.
Generating images based on text input: You can type in text and the tool generates realistic scenes based on that description e.g. Nvidia built a demo that performs this task.
What libraries/APIs can be used to build NLP products
If you're building a product that uses NLP, there are many tools available at your disposal. They provide many pre-trained models that work out of the box, so you don't need to reinvent the wheel.
Nobody cares if you successfully reinvent the wheel.
Wait a minute. What about all my innovative ideas and unlimited creative energy? Use it to build a product to serve a specific need. You can innovate all you want on the customer-facing side of your product.
Here's a list of NLP libraries/APIs that you can use to build a product:
NLTK - Great library for beginners. It's in Python.
TextBlob - It's an interface for NLTK. Provides simple API for many NLP tasks.
SpaCy - Blazing fast. It's aimed at production-ready products as opposed to experimentation/exploration. It doesn't provide dozens of options to do a single task like NLTK. Use SpaCy when you’re ready to deploy into production.
PyTorch-NLP - Deep Learning for NLP. Based on PyTorch framework.
AutoNLP by Hugging Face - Good list of models. Great community. You just need to bring your data to train these models for your specific task.
OpenAI's NLP library - API driven. Good list of pre-trained models.
Apache OpenNLP - Based on Java. Contains many methods to perform common tasks.
Stanford CoreNLP - Based on Java. It's for production-ready tools.
Where to go from here
If you’re building a product that needs to parse and understand text, you don’t need to build anything from scratch. Everything you’d ever need is available in the above mentioned libraries/tools. Use them to your advantage.