k-Nearest Neighbor Augmented Neural Networks for Text Classification

08/25/2017
by   Zhiguo Wang, et al.
0

In recent years, many deep-learning based models are proposed for text classification. This kind of models well fits the training set from the statistical point of view. However, it lacks the capacity of utilizing instance-level information from individual instances in the training set. In this work, we propose to enhance neural network models by allowing them to leverage information from k-nearest neighbor (kNN) of the input text. Our model employs a neural network that encodes texts into text embeddings. Moreover, we also utilize k-nearest neighbor of the input text as an external memory, and utilize it to capture instance-level information from the training set. The final prediction is made based on features from both the neural network encoder and the kNN memory. Experimental results on several standard benchmark datasets show that our model outperforms the baseline model on all the datasets, and it even beats a very deep neural network model (with 29 layers) in several datasets. Our model also shows superior performance when training instances are scarce, and when the training set is severely unbalanced. Our model also leverages techniques such as semi-supervised training and transfer learning quite well.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
02/04/2023

Reducing Nearest Neighbor Training Sets Optimally and Exactly

In nearest-neighbor classification, a training set P of points in ℝ^d wi...
research
02/17/2023

Like a Good Nearest Neighbor: Practical Content Moderation with Sentence Transformers

Modern text classification systems have impressive capabilities but are ...
research
05/29/2022

A Model of One-Shot Generalization

We provide a theoretical framework to study a phenomenon that we call on...
research
01/07/2023

Why do Nearest Neighbor Language Models Work?

Language models (LMs) compute the probability of a text by sequentially ...
research
12/11/2017

Fast Nearest-Neighbor Classification using RNN in Domains with Large Number of Classes

In scenarios involving text classification where the number of classes i...
research
04/01/2022

Estimating the Jacobian matrix of an unknown multivariate function from sample values by means of a neural network

We describe, implement and test a novel method for training neural netwo...
research
03/22/2022

Remember Intentions: Retrospective-Memory-based Trajectory Prediction

To realize trajectory prediction, most previous methods adopt the parame...

Please sign up or login with your details

Forgot password? Click here to reset