# 中文情感分析 **Repository Path**: haulynwu/chinese_sentiment_analysis ## Basic Information - **Project Name**: 中文情感分析 - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 2 - **Forks**: 0 - **Created**: 2020-05-08 - **Last Updated**: 2023-11-12 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 简介 本项目为信息内容安全期末项目,题目为 基于LSTM的中文短文本 爬取及情感分析。 # 内容介绍 各目录内容如下。 ├─sentiment_project sentiment_project 目录为情感分析模块的部分 │ ├─.idea PyCharm 项目信息目录 │ │ └─inspectionProfiles │ ├─data 训练模型所用数据 │ ├─lstm_data 训练好的模型目录 │ └─__pycache__ python运行缓存 └─Weibo-comment ├─.idea │ ├─dictionaries │ └─inspectionProfiles ├─Other ├─README.assets ├─Steam-comment │ └─txt └─Weibo-comment ## Sentiment_project 该部分内容为情感分析部分。各文件描述如下。 | 文件名 | 描述 | | ----------------- | ------------------------------------------------------------ | | lstm_train.py | 执行训练模型的脚本。 | | LstmPredict.py | 执行模型预测的脚本,需要修改脚本中的输入文本进行测试。 | | main.py | 封装好的微博情感分析整合工具,可以根据输入话题名称进行爬取以及情感分类统计。同时支持单独短文本情感分析。直接执行脚本即可。 | | sentiment_lstm.py | 情感分析模块各功能的具体实现代码。 | | weibospider.py | 微博话题爬取模块的具体实现代码。 | ## Weibo-comment Todo # 备注 weibospider.py 文件内的cookie如不能使用则需要更换,可参照代码文件内说明。 执行lstm_train.py文件后会将lstm_data目录下的文件覆盖,如果想保存多个模型建议备份。 模型会默认从lstm_data目录读取。 # 测试环境 ## 硬件环境 * Windows 10 专业版 64位 功能更新至 1903 * Intel® Core™ i7-7700HQ CPU @2.80GHz * 16GB RAM * NVIDIA GeForce 1050 GPU 4GB ## 软件环境 * Python 3.8.2 * CUDA 10.1 * Keras 2.3.1 * TensorFlow 2.2.0 * Gensim 3.8.1 * Jieba 0.42.1 * bs4 4.8.0 * Requests 2.22.0