Weibo Public Opinion Analysis and Prediction System is a social network public opinion analysis system designed to monitor, analyze, and predict public opinion trends on social media platforms such as Weibo. This system leverages deep learning, natural language processing (NLP), and machine learning technologies to extract valuable public opinion information from vast amounts of social media data, helping governments, enterprises, and other organizations promptly understand public attitudes, respond to emergencies, and optimize decision-making. 📈
Through powerful data collection and processing capabilities, the Weibo Public Opinion Analysis and Prediction System achieves real-time data collection, sentiment analysis, topic classification, and public opinion prediction, ensuring that users can obtain accurate and comprehensive insights into public opinion in the complex and changing social network environment. The system adopts a modular design, making it easy to maintain and expand, aiming to provide users with an efficient and reliable public opinion analysis tool, assisting various organizations in making informed decisions in the information age.
- Real-time Data Collection: Utilize web scraping technologies to obtain user-generated content from social platforms like Weibo in real-time.
- Data Cleaning and Processing: Preprocess collected data, including tokenization, removal of stop words, emojis, and URLs.
- Topic Classification: Automatically classify posts and comments into topics using machine learning and natural language processing techniques.
- Sentiment Analysis: Analyze the sentiment orientation (positive, neutral, negative) within texts to understand public emotions.
- Public Opinion Monitoring and Prediction: Monitor changes in public opinion in real-time and predict future trends based on historical data.
- Data Visualization: Display analysis results through charts and graphics for easy understanding and decision-making.
- User Management: Provide user registration, login, and session management features to ensure system security and personalized services.
Follow the steps below to run the project on your system.
- Python 3.7 or higher
- MySQL Database
- Conda (optional, for environment management)
- A valid Weibo account (for data collection)
-
Clone the repository:
git clone https://github.com/666ghj/Weibo_PublicOpinion_AnalysisSystem.git cd Weibo-Public-Opinion-Analysis-System
-
Create and activate a virtual environment (optional):
conda create -n weibo_opinion_analysis python=3.8 conda activate weibo_opinion_analysis
-
Install dependencies:
pip install -r requirements.txt
-
Configure the MySQL database:
- Run
createTables.sql
to create the necessary database tables. - Modify the database connection settings in
config.py
to match your MySQL configuration.
- Run
-
Start the Flask application:
python app.py
-
Access the application: Open your browser and navigate to http://localhost:5000 to use the system.
The Weibo Public Opinion Analysis and Prediction System employs a range of modern technologies to ensure efficiency and scalability:
- Flask - A lightweight web application framework.
- MySQL - A relational database used to store collected and processed data.
- Scrapy - A powerful web scraping framework used for data collection.
- Jieba - A Chinese text segmentation tool used for text preprocessing.
- SnowNLP - A Chinese natural language processing library used for sentiment analysis.
- BERT - A pre-trained language model used for topic classification.
- Pandas - A data analysis and manipulation library.
- Matplotlib - A data visualization library.
- Scikit-learn - A machine learning library used for model training and evaluation.
- TensorFlow 或 PyTorch - Deep learning frameworks used for advanced model development.
We welcome your contributions! Follow the steps below to participate in the project:
- Fork this repository.
- Create your feature branch (
git checkout -b feature/your-feature
). - Commit your changes (
git commit -m 'Add some feature'
). - Push to the branch (
git push origin feature/your-feature
). - Open a Pull Request.
Please ensure that all tests pass before submitting and follow the project's coding standards.
This project is licensed under the GPL-2.0 License - see the LICENSE file for details.
If you like this project, please give it a star ⭐ on GitHub!
If you have any questions or suggestions, feel free to contact us through the following methods:
- GitHub Issues: Create a new issue
- Email: [email protected]
Thanks to the following contributors: