Abstract
Traditional Natural Language Understanding (NLU) systems often treat intent detection and slot filling as independent or loosely coupled tasks, failing to capture the inherent hierarchical relationship between words, slots, and intents. This paper introduces Capsule-NLU, a novel architecture leveraging Capsule Neural Networks and a dynamic routing-by-agreement mechanism. By introducing a unique re-routing schema, the model allows global intent information to refine local slot predictions. Experimental results on SNIPS and ATIS datasets demonstrate that Capsule-NLU outperforms state-of-the-art joint models and commercial NLU services.
Introduction
In NLU, systems must simultaneously identify a user's goal (Intent Detection) and extract relevant entities (Slot Filling). For example, in the utterance "Put Sungmin into my summer playlist," the intent is AddToPlaylist, while "Sungmin" is an artist and "summer playlist" is a playlist.
Standard joint models using RNNs or CNNs often struggle to explicitly model the "part-whole" hierarchy: Words → Slots → Intents. A model that recognizes an "Artist" slot should be more confident in a "PlayMusic" intent, and vice versa. Capsule-NLU addresses this by using capsules to represent these hierarchical levels and routing mechanisms to manage their interactions.
Methodology: Capsule-NLU
The proposed architecture consists of three hierarchical layers of capsules:
- WordCaps: Context-aware word representations generated via a Bi-LSTM layer.
- SlotCaps: Capsules representing specific slot types. They use Dynamic Routing-by-Agreement to aggregate WordCaps. If a word's representation aligns with a slot capsule's properties, it receives a higher routing weight.
- IntentCaps: These capsules represent the overall intent, aggregating information from the SlotCaps.
The Re-Routing Schema
A key innovation is the re-routing schema. After the IntentCaps determine the most likely intent, this global signal is fed back to the SlotCaps. This top-down feedback nudges the model to re-evaluate word-to-slot assignments, helping resolve local ambiguities based on the overall sentence context.
Experimental Results
The model was evaluated on the SNIPS-NLU and ATIS benchmarks. Capsule-NLU achieved a Slot F1 of 91.8% and Intent Accuracy of 97.3% on SNIPS, significantly outperforming the Slot-Gated baseline (88.8% F1).
As shown in the figure above, Capsule-NLU is highly competitive with, and often superior to, major commercial NLU providers like Amazon Lex, Microsoft LUIS, and Google Dialogflow across diverse intents. Ablation studies further confirmed that the synergy between intent and slot tasks, facilitated by joint training and the intent signal, is critical for these performance gains.
Conclusion and Future Work
Capsule-NLU demonstrates that modeling language as a hierarchy of parts and wholes via capsule networks is highly effective for NLU. The re-routing mechanism provides a powerful way to integrate global and local information. Future work includes integrating pre-trained transformers like BERT to enhance word representations and exploring the model's capability in few-shot learning scenarios for new domains.
Summary updated