4,942 research outputs found
Not All Attention Is Needed: Gated Attention Network for Sequence Data
Although deep neural networks generally have fixed network structures, the
concept of dynamic mechanism has drawn more and more attention in recent years.
Attention mechanisms compute input-dependent dynamic attention weights for
aggregating a sequence of hidden states. Dynamic network configuration in
convolutional neural networks (CNNs) selectively activates only part of the
network at a time for different inputs. In this paper, we combine the two
dynamic mechanisms for text classification tasks. Traditional attention
mechanisms attend to the whole sequence of hidden states for an input sentence,
while in most cases not all attention is needed especially for long sequences.
We propose a novel method called Gated Attention Network (GA-Net) to
dynamically select a subset of elements to attend to using an auxiliary
network, and compute attention weights to aggregate the selected elements. It
avoids a significant amount of unnecessary computation on unattended elements,
and allows the model to pay attention to important parts of the sequence.
Experiments in various datasets show that the proposed method achieves better
performance compared with all baseline models with global or local attention
while requiring less computation and achieving better interpretability. It is
also promising to extend the idea to more complex attention-based models, such
as transformers and seq-to-seq models
Recommended from our members
Adverse Drug Reaction Classification With Deep Neural Networks
We study the problem of detecting sentences describing adverse drug reactions (ADRs) and frame the problem as binary classification. We investigate different neural network (NN) architectures for ADR classification. In particular, we propose two new neural network models, Convolutional Recurrent Neural Network (CRNN) by concatenating convolutional neural networks with recurrent neural networks, and Convolutional Neural Network with Attention (CNNA) by adding attention weights into convolutional neural networks. We evaluate various NN architectures on a Twitter dataset containing informal language and an Adverse Drug Effects (ADE) dataset constructed by sampling from MEDLINE case reports. Experimental results show that all the NN architectures outperform the traditional maximum entropy classifiers trained from n-grams with different weighting strategies considerably on both datasets. On the Twitter dataset, all the NN architectures perform similarly. But on the ADE dataset, CNN performs better than other more complex CNN variants. Nevertheless, CNNA allows the visualisation of attention weights of words when making classification decisions and hence is more appropriate for the extraction of word subsequences describing ADRs
Toxic comment classification using convolutional and recurrent neural networks
This thesis aims to provide a reasonable solution for categorizing automatically sentences into types of toxicity using different types of neural networks. There are six types of categories: Toxic, severe toxic, obscene, threat, insult and identity hate. Three different implementations have been studied to accomplish the objective: LSTM (Long Short-Term Memory), GRU (Gated Recurrent Unit) and convolutional neural networks. The thesis is not thought to aim on improving the performance of every individual model but on the comparison between them in terms of natural language processing adequacy. In addition, one differential aspect about this project is the research of LSTM neurons activations and thus the relationship of the words with the final sentence classificatory decision. In conclusion, the three models performed almost equally and the extraction of LSTM activations provided a very accurate and visual understanding of the decisions taken by the network.Esta tesis tiene como objetivo aportar una buena solución para la categorización automática de comentarios abusivos haciendo uso de distintos tipos de redes neuronales. Hay seis categorías: Tóxico, muy tóxico, obsceno, insulto, amenaza y racismo. Se ha hecho una investigación de tres implementaciones para llevar a cabo el objetivo: LSTM (Long Short-Term Memory), GRU (Gated Recurrent Unit) y redes convolucionales. El objetivo de este trabajo no es intentar mejorar al máximo el resultado de la clasificación sino hacer una comparación de los 3 modelos para los mismos parámetros e intentar saber cuál funciona mejor para este caso de procesado de lenguaje. Además, un aspecto diferencial de este proyecto es la investigación sobre las activaciones de las neuronas en el modelo LSTM y su relación con la importancia de las palabras respecto a la clasificación final de la frase. En conclusión, los tres modelos han funcionado de forma casi idéntica y la extracción de las activaciones han proporcionado un conocimiento muy preciso y visual de las decisiones tomadas por la red.Aquesta tesi té com a objectiu aportar una bona solució per categoritzar automàticament comentaris abusius usant diferents tipus de xarxes neuronals. Hi ha sis tipus de categories: Tòxic, molt tòxic, obscè, insult, amenaça i racisme. S'ha fet una recerca de tres implementacions per dur a terme l'objectiu: LSTM (Long Short-Term Memory), GRU (Gated Recurrent Unit) i xarxes convolucionals. L'objectiu d'aquest treball no és intentar millorar al màxim els resultats de classificació sinó fer una comparació dels 3 models pels mateixos paràmetres per tal d'esbrinar quin funciona millor en aquest cas de processat de llenguatge. A més, un aspecte diferencial d'aquest projecte és la recerca sobre les activacions de les neurones al model LSTM i la seva relació amb la importància de les paraules respecte la classificació final de la frase. En conclusió, els tres models han funcionat gairebé idènticament i l'extracció de les activacions van proporcionar un enteniment molt acurat i visual de les decisions preses per la xarxa
- …