Skip to main content

Feature Extraction by Using Attention Mechanism in Text Classification

  • Conference paper
  • First Online:

Part of the book series: Communications in Computer and Information Science ((CCIS,volume 1258))

Abstract

In recent years, machine learning technology has made great success in fields of computer vision, natural language processing, speech recognition and so on. And machine learning model has been widely used in face recognition, automatic driving, malware detection, intelligent medical analysis and other practical tasks. In this paper, attention mechanism is proposed to combine with LSTM model to extract features in text classification. The results show that, on the one hand, LSTM + Attention can improve classification performance; on the other hand, by sorting by word weights generated by the attention layer, we find some meaningful word features, however, its recognition performance is not good. Some possible reasons were analyzed and it was found that attention mechanism sometimes misjudges wrong word features, resulting from these wrong words often appearing at the same time with meaningful word features.

This work is supported by National Defense Science and Technology Innovation Special Zone Project (No. 18-163-11-ZT-002-045-04).

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

References

  1. Ibrahim, M., et al.: Global explanations of neural networks. In: AAAI/ACM Conference ACM (2019)

    Google Scholar 

  2. Li, J., Ji, S., Du, T., et al.: Text bugger: generating adversarial text against real-world applications. In: Proceedings of the 26th Annual Network and Distributed Systems Security Symposium. ISOC, Reston (2019)

    Google Scholar 

  3. Doshi-Velez, F., Kim, B.: Towards A Rigorous Science of Interpretable Machine Learning (2017)

    Google Scholar 

  4. Riccardo, G., et al.: A survey of methods for explaining black box models. ACM Comput. Surv. 51(5), 1–42 (2018)

    Google Scholar 

  5. Sebastian, B., et al.: On pixel-wise explanations for non-linear classifier decisions by layer-wise relevance propagation. PLoS ONE 10(7), e0130140 (2015)

    Article  Google Scholar 

  6. Ribeiro, M.T., Singh, S., Guestrin, C.: “Why Should I Trust You?”: Explaining the Predictions of Any Classifier (2016)

    Google Scholar 

  7. Vaswani, A., Shazer, N., Parmar, N., et al.: Attention is all you need. In: Proceedings of the 31st International Conference on Neural Information Processing Systems. Curran Associates Inc, Red Hook (2017)

    Google Scholar 

  8. Xu, K., et al.: Show, attend and tell: neural image caption generation with visual attention. In: Computer EnCE, pp. 2048–2057 (2015)

    Google Scholar 

  9. Arras, L., et al.: “What is relevant in a text document?”: an interpretable machine learning approach. PLoS ONE 12(8), e0181142 (2017)

    Article  Google Scholar 

  10. Bahdanau, D., Cho, K., Bengio, Y.: Neural machine translation by jointly learning to align and translate. arXiv preprint arXiv:1409.0473 (2014)

  11. Yang, Z., et al.: Hierarchical attention networks for document classification. In: Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (2016)

    Google Scholar 

  12. Poerner, N., Roth, B., Schütze, H.: Evaluating neural network explanation methods using hybrid documents and morphological agreement (2018)

    Google Scholar 

  13. Malhotra, P., et al.: Long short term memory networks for anomaly detection in time series. In: European Symposium on Artificial Neural Networks (2015)

    Google Scholar 

  14. Deng, X., et al.: Feature selection for text classification: a review. Multimedia Tools Appl. 78(3), 3797–3816 (2019)

    Article  Google Scholar 

  15. Kowsari, et al.: Text classification algorithms: a survey. Information 10(4) (2019)

    Google Scholar 

  16. Xie, J., et al.: Chinese text classification based on attention mechanism and feature-enhanced fusion neural network. Computing 102(3), 683–700 (2019). https://doi.org/10.1007/s00607-019-00766-9

    Article  MathSciNet  MATH  Google Scholar 

  17. Liu, G., Guo, J.: Bidirectional LSTM with attention mechanism and convolutional layer for text classification. Neurocomputing 337, 325–338 (2019)

    Article  Google Scholar 

  18. Tong, X., et al.: Semantic correlations loss: improving model interpretability for multi-class classification. In: 2019 IEEE International Conference on Big Data (Big Data). IEEE (2019)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Yue Wang .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2020 Springer Nature Singapore Pte Ltd.

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Wang, Y., Wang, Y. (2020). Feature Extraction by Using Attention Mechanism in Text Classification. In: Qin, P., Wang, H., Sun, G., Lu, Z. (eds) Data Science. ICPCSEE 2020. Communications in Computer and Information Science, vol 1258. Springer, Singapore. https://doi.org/10.1007/978-981-15-7984-4_6

Download citation

  • DOI: https://doi.org/10.1007/978-981-15-7984-4_6

  • Published:

  • Publisher Name: Springer, Singapore

  • Print ISBN: 978-981-15-7983-7

  • Online ISBN: 978-981-15-7984-4

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics