使用循环神经网络的文本情感分类器的设计与实现

 2022-12-24 10:12

论文总字数:21440字

摘 要

快速增长的互联网信息使得自然语言处理(NLP)的位置越来越重要,对大量文本数据的处理无论对学术界亦或是工业界都显得尤其重要。文本情感分析是自然语言处理的一部分,它的发展不仅在NLP领域有重大的影响,而且在经济、政治、社会科学等领域有着特别深远的影响。文本情感分析就是对含有人们表示的情感、爱好、观点等的文本进行分析、挖掘以及检测,随着互联网的不断发展,越来越多的用户对产品、新闻、话题、实事等各个方面的内容都开始愿意发表各自的观点和看法,然后对这些数据进行分析,这种文本情感分析已经成为了最近几年研究的热点问题。

本文设计了一个使用循环神经网络的中英文文本情感分类器,以实现对中文和英文文本进行情感分类的功能。首先将准备好的数据集进行预处理,然后对分词后生成的每个单词或词语进行标识,把表达积极情感的标识为1,把代表消极情感的标识为1。接着构建长短期记忆神经网络模型,并通过训练构建情感分类模型。最后通过实验,测试情感分类器能否对文本进行准确地情感分析。

关键字互联网;自然语言处理;文本情感分析;深度学习;循环神经网络

Design and implementation of text sentiment classifier

based on recurrent neural network

Abstract

With the rapid growth of Internet information, the position of natural language processing (NLP) is becoming more and more important, and the processing of large amount of text data is becoming more and more important in both academic and industrial fields. Text sentiment analysis is a part of natural language processing , and its development has great influence not only in the field of NLP, but also in the fields of economy, politics and social science. Text sentiment analysis is the analysis, mining, and detection of text that contains people's expressed emotions, interests, and opinions, more and more users are willing to express their opinions and opinions on products, news, topics, facts, and so on, and then analyze these data, this kind of text sentiment analysis has become a hot topic in recent years.

This paper presents a Chinese and English text sentiment classifier based on recurrent neural network to realize sentiment classification of Chinese and English texts.First, the data set is preprocessed, and then each word or word generated after word segmentation is identified as 1 for positive emotion and 1 for negative emotion. Then Long Short-Term Memory was built and an emotion classification model was built through training. Finally, experiments are carried out to test whether the emotion classifier can accurately analyze the emotion of the text.

Keywords: Internet; Natural Language Processing; text sentiment analysis; deep learning; Recurrent Neural Network

目录

摘 要 I

Abstract II

第一章 绪论 1

1.1 选题背景 2

1.2 选题意义 2

1.3 相关研究现状 3

1.4 课题工作内容 3

第二章 系统关键技术及平台介绍 5

2.1 Anaconda简介 5

2.2 Pytorch简介 5

2.3 Jupyter Notebook 简介 5

第三章 设计方案及设计任务综述 6

3.1 设计任务与要求 6

3.2 设计方案论述 6

3.3 设计的开发环境 6

第四章 系统设计 8

4.1 系统设计原理 8

4.1.1 RNN与LSTM 8

4.1.2 LSTM训练模型流程 9

4.1.3 情感分类流程 9

4.2 系统实现 10

4.2.1读取数据 10

4.2.2数据预处理 10

4.2.3 创建数据迭代器 12

4.2.4 使用循环神经网络模型 12

4.2.5 加载预训练的词向量 13

4.2.6训练和评估模型 14

第五章 系统调试与测试 15

5.1 系统调试 15

5.2 系统测试结果分析 19

第六章 总结与展望 20

致谢 21

参考文献 22

第一章 绪论

1.1 选题背景

快速增长的互联网信息使得自然语言处理的位置越来越重要,对大量文本数据的处理无论对学术界亦或是工业界都显得尤其重要。文本情感分析是自然语言处理(NLP, Nature Language Process)[[1]]的一部分,它的发展不仅在NLP领域有重大的影响,而且在经济、政治、社会科学等领域有着特别深远的影响。

文本情感分析就是对含有人们表示的情感、爱好、观点等的文本进行分析、挖掘以及检测,随着互联网的不断发展,越来越多的用户对产品、新闻、话题、实事等各个方面的内容都开始愿意发表各自的观点和看法,然后对这些数据进行分析,这种文本情感分析已经成为了最近几年研究的热点问题。

剩余内容已隐藏,请支付后下载全文,论文总字数:21440字

您需要先支付 80元 才能查看全部内容!立即支付

该课题毕业论文、开题报告、外文翻译、程序设计、图纸设计等资料可联系客服协助查找;