What in the “Hello World” is Natural Language Processing (NLP)?
Tags: Naturallanguageprocessing, Deep Learning, Software Development, Artificial Intelligence, Machine Learning

Alright. You have delivered some fancy hype and the nuts and bolts of NLP. What about the essential niche that powers NLP?

In NLP, the data is normally audio or text data. Sometimes it may involve pictures or video that needs to be transformed into text. The technology that powers an NLP solution depends highly on the application area and the solution usage. For example, if an NLP solution should work in a mobile application, it would require the basic components of a traditional mobile application with frontend and backend logic. If high processing power is needed, the NLP components could reside in a cloud environment, such as AWS, MS Azure, or Google Cloud. Some of these technologies even include ready-made components for NLP. In fact, it is quite straightforward to build a prototype NLP solution using these tools by the cloud providers. Amazon Transcribe is a ready-made tool to add speech-to-text capability to applications, and Amazon Transcribe Medical is able to transform medical speech to text. MS Azure also has tools for Cognitive Services.

On the other hand, if the NLP solution is placed in a scarce environment, such as a mine or a forest, in which very rudimentary network connections are available, the NLP logic should reside in the device that reads the needed data, such as a cell phone or some other audio or Internet of Things (IoT) device. In such a case, where Machine Learning (ML) or DL is required, TensorFlow Lite is a promising solution. It can be used to deploy machine learning models on mobile and IoT devices.

Python is the de-facto tool for NLP. It is widely used as a general programming language and includes numerous NLP libraries. The most popular NLP library for Python is the Natural Language Toolkit (NLTK) that states to be the leading platform for building Python programs to work with human language data. Additionally, Apache OpenNLP is a machine learning-based toolkit for NLP. It has support for the most common NLP tasks.

Photo by Kevin Ku on Unsplash

However, there are other programming languages besides Python that can be used for NLP, the other two popular being Java and Julia. Java has been around for many years, while Julia is slowly gaining momentum and popularity among data scientists and NLP practitioners. It is nevertheless still in its infancy at the moment. The choice of programming language for NLP depends on numerous factors: what is the processing power requirement, what NLP tools are needed, what is the community support for the language, and how the solution can be deployed and functions in a production environment.

Another league of its own is using NLP for the Finnish language. Yes, our very own unique language with lots of double consonants, umlaut letters, and peculiar sentence structures. At the moment there aren’t that many NLP libraries aimed specifically for Finnish. This is an area that has a lot of potential in the future. The blog post here details the steps required in building a Finnish Part of Speech Tagger.

But what about audio data?

This deals with recognizing certain patterns from speech that are well known. The first step is always extracting the necessary features from the audio signal and doing subsequent analysis on them. Which features to analyze depends again on the use case. Writing a synopsis from a spoken narrative may include first transforming the audio data into text data and doing follow-up synopsis writing on it. In terms of technologies, neural networks have become handy in these. Popular Python libraries include Keras, Sklearn, and Tensorflow. Also, pandas, numpy and matplotlib can be used for data extraction, analysis, and visualization.

Photo by metamorworks

Automatic speech recognition system (ASR) takes into account the phonemes of a language.

For example, in Finnish there are 21 phonemes, consisting of 13 consonants and 8 vowels. However, the exact number may depend on the spoken dialect. After gathering all phonemes from a sound wave, the ASR software uses statistical probability analysis to deduce whole words and from there, form complete sentences. Check out this awesome infographic for more information. Using phonemes to form speech is also common in concatenation based speech synthesizers.

So what’s the conclusion?

I have delivered a no-frills introduction to NLP and its various applications and technologies. NLP has a lot of potential to revolutionize industries and application areas. However, NLP practitioners are a scarce resource and more training and development with practical real-world applications need to be done.

As a statistical and linguistic data nerd, I am looking forward to exciting things to come. I will be digging more deeply into NLP methods in the upcoming posts, so stay tuned.