Intel‘s NLP Architect: A Powerful Open Source Library for State-of-the-Art Natural Language AI
Natural language processing (NLP) is one of the hottest areas in artificial intelligence today. From virtual assistants to chatbots to machine translation, NLP technologies are becoming increasingly sophisticated and ubiquitous. Tech giants like Google, Facebook, Microsoft and Amazon are heavily investing in NLP research and development.
In 2018, Intel launched its own open source NLP library called NLP Architect. According to Intel, NLP Architect aims to provide a platform for both research explorations and practical applications of state-of-the-art language models and techniques. Today, NLP Architect is an awesome tool that benefits both beginners getting started with NLP as well as advanced developers and researchers pushing the boundaries of language AI.
In this article, we‘ll take a deep dive into NLP Architect. We‘ll explore what it is, how it works, and how you can start using it for your own projects and applications. I‘ll share some of the latest updates and most exciting features in the current version, as well as what‘s on the roadmap for the future. By the end, you‘ll have a solid understanding of NLP Architect and why it‘s a game-changer for NLP.
What is NLP Architect?
NLP Architect is an open source Python library developed by Intel AI Lab for NLP and natural language understanding (NLU). It leverages leading deep learning frameworks including Intel nGraph, Intel neon, TensorFlow/Intel-Optimized TensorFlow, DyNet and Keras. The library implements core NLP models, high-performance NLU modules, semantic understanding components, and end-to-end deep learning applications.
One of the key advantages of NLP Architect is that it integrates a variety of state-of-the-art techniques into a unified framework. This allows developers and researchers to quickly prototype and compare different approaches. The library also includes pre-trained models that deliver leading performance on several standard NLP benchmarks.
Here are some of the main features and modules in NLP Architect:
- Core NLP models for linguistic feature extraction:
— Dependency parsing (BIST parser) to analyze syntactic sentence structure
— Noun phrase chunking to identify phrases that function as nouns - High-performance NLU modules:
— Intent extraction to classify the user‘s intent from an utterance
— Named entity recognition to locate and classify named entities - Semantic understanding components:
— Collocation extraction to identify commonly co-occurring word pairs
— Word sense disambiguation to identify the meaning of a word in context
— Noun phrase embedding representations - Tools for conversational AI:
— Chatbot dialogue system
— Sequence chunking
— Intent extraction - End-to-end deep learning models:
— Question answering
— Machine reading comprehension
The library also comes with the NLP Architect Server, which provides a web API for accessing the models, as well as a slick visualizer for exploring the model annotations and results. This makes it easy to integrate NLP Architect into applications and interactively experiment with the models.
According to Intel, the models and components in NLP Architect reflect their latest research as well as active collaborations with academia and industry partners. The goal is for NLP Architect to serve as a platform for advancing the state of the art in language AI. At the same time, the library is also designed to be accessible and easy to use for developers building real-world NLP applications.
Getting Started with NLP Architect
To get started with NLP Architect, you‘ll first need to clone the GitHub repository and install the library and its dependencies. See the official documentation for detailed instructions.
Once you have NLP Architect set up, you can start exploring the various models and modules. Let‘s walk through a quick example of using the named entity recognition model.
First, we‘ll import the necessary modules:
from nlp_architect.models.ner_crf import NERCRF
from nlp_architect.utils.io import download_unlicensed_file
from nlp_architect.utils.text import SpacyInstance
Next, we‘ll download the pre-trained model:
ner_model_path = download_unlicensed_file(‘ner-model.h5‘, ‘https://d2zs9tzlek599f.cloudfront.net/models/ner/model.h5‘)
We‘ll instantiate a SpaCy NLP engine for pre-processing the input text:
nlp = SpacyInstance(disable=["tagger", "parser", "vectors", "textcat"])
And then instantiate the NERCRF model, loading the pre-trained weights:
ner_model = NERCRF()
ner_model.load(ner_model_path)
Finally, we can use the model to extract entities from text:
text = "Intel‘s NLP Architect is an open source Python library for NLP developed by Intel AI Lab."
doc = nlp.tokenize(text)
entities = ner_model.predict(doc)
print(entities)
This will output:
[(‘Intel‘, ‘ORG‘), (‘NLP Architect‘, ‘PRODUCT‘), (‘Intel AI Lab‘, ‘ORG‘)]
As you can see, the model was able to correctly identify and classify the relevant named entities in the text. This is just a small taste of what you can do with NLP Architect. Be sure to check out the other models and examples in the official repo.
What‘s New in NLP Architect
NLP Architect continues to evolve with the latest techniques and models from Intel‘s ongoing research. The most recent updates to the library include:
-
BERT models for NLP Architect: Intel added support for Google‘s popular BERT language models, including pre-trained models, fine-tuning examples, and end-to-end models for specific tasks like NER and sentiment analysis.
-
Aspect-based sentiment analysis: This model aims to extract opinion phrases from text and determine the sentiment toward specific aspects. It uses a combination of CNN and Bi-LSTM with attention.
-
Unsupervised aspect-based sentiment analysis: Performs the same task as above, but without the need for labeled training data. It uses an autoencoder approach based on Variational Autoencoders (VAEs) and LSTMs.
-
Supervised sentiment analysis: A CNN-based model for classifying the sentiment of input text into positive and negative categories.
-
Language modeling with TCN: Temporal Convolutional Network (TCN) is a new approach for language modeling tasks, offering advantages like longer effective memory and faster training times compared to RNNs.
-
End-to-end memory networks: Implementation of MemN2N, a memory network for reasoning over inputs in a story and answering questions about it.
-
ChatBot with Persona: A conversational agent that aims to be consistent to a given personality. It is based on transfer learning conversations from a large dialogue corpus.
To see the full release notes and latest updates, check out the releases page on GitHub.
The Future of NLP Architect
According to Intel, they have big plans for the future of NLP Architect. The long-term vision is for it to be the most widely used library for NLP research and development. To get there, they are working on a number of exciting updates and new features:
- More pre-trained models, especially in the areas of conversational AI, question answering, and text generation
- Interactive model demos and visualizations to make it easy to explore and experiment with the models
- End-to-end tutorials and examples of using NLP Architect for real-world applications
- Support for more languages and text formats
- Tighter integration with other Intel AI technologies like nGraph for multi-framework model support
- Optimization for distributed training and inference on Intel hardware
Of course, as an open source project, the roadmap is also driven by community feedback and contributions. Intel is actively encouraging NLP researchers and developers to get involved, whether by submitting issues, contributing code, or collaborating on new models and techniques.
Takeaways and Implications
NLP Architect is an exciting development for anyone interested in natural language AI. It provides a powerful, flexible platform for exploring state-of-the-art techniques and rapidly prototyping new ideas. The fact that it is open source and backed by Intel makes it especially compelling.
Some key takeaways:
-
NLP Architect makes advanced NLP more accessible by packaging state-of-the-art models into an easy to use library. This lowers the barrier to entry for developers and researchers.
-
The library is great for educational purposes, as it allows beginners to experiment with complex language models without having to implement everything from scratch. At the same time, it provides a foundation for more advanced research.
-
For companies and developers building NLP applications, NLP Architect can significantly speed up development time and make it easier to incorporate the latest techniques. The pre-trained models offer a jump start on common tasks.
-
From a strategic perspective, NLP Architect represents Intel‘s big bet and investment in AI. It positions Intel as a leader and innovator in NLP, not just a hardware vendor. This could translate into competitive advantages for Intel as language AI becomes increasingly important.
NLP Architect is part of a broader trend in AI toward open, collaborative ecosystems. To truly advance the field, we need common tools, frameworks and datasets. By open-sourcing NLP Architect and inviting community contributions, Intel is helping to accelerate progress in NLP for all.
It will be exciting to see what new models and breakthroughs come out of NLP Architect in the months and years ahead. I‘m confident that it will play an important role in ushering in the next generation of language AI, with transformative implications across industries.
Given Intel‘s track record and commitment, I expect NLP Architect to be a leading platform for a long time to come. If you‘re serious about NLP and language AI, I recommend checking it out and getting involved with the community. The future looks very bright indeed.