🍊作者:计算机毕设匠心工作室
🍊简介:毕业后就一直专业从事计算机软件程序开发,至今也有8年工作经验。擅长Java、Python、微信小程序、安卓、大数据、PHP、.NET|C#、Golang等。
擅长:按照需求定制化开发项目、 源码、对代码进行完整讲解、文档撰写、ppt制作。
🍊心愿:点赞 👍 收藏 ⭐评论 📝
👇🏻 精彩专栏推荐订阅 👇🏻 不然下次找不到哟~
🍅 ↓↓文末获取源码联系↓↓🍅
基于大数据的无人驾驶网约车抖音社会舆情可视化分析系统-功能介绍
基于Spark的无人驾驶舆情可视化系统是一个集大数据处理、情感分析与可视化展示于一体的综合性分析平台。该系统采用Hadoop+Spark大数据架构作为核心处理引擎,通过Python进行数据采集与预处理,结合Django后端框架构建稳定的服务层,前端采用Vue+ElementUI+Echarts技术栈实现交互式可视化界面。系统主要针对抖音平台中无人驾驶网约车相关内容进行深度舆情挖掘,运用Spark SQL进行大规模数据查询分析,通过Pandas和NumPy进行数据科学计算,实现评论情感极性分布分析、情感时间演变趋势追踪、用户画像构建、地域分布统计、热点话题识别、视频内容互动关系分析等多维度功能模块。系统能够处理海量社交媒体数据,通过机器学习算法识别公众对无人驾驶技术的真实态度,生成直观的数据图表和分析报告,为相关企业、研究机构和政策制定者提供科学的决策支持,同时也为计算机专业学生提供了一个集成多种前沿技术的实践平台。
基于大数据的无人驾驶网约车抖音社会舆情可视化分析系统-背景意义
选题背景 随着人工智能技术的快速发展,无人驾驶技术逐渐从实验室走向商业化应用,各大科技公司纷纷推出自动驾驶测试车辆和网约车服务试点。抖音作为当前最具影响力的短视频社交平台,承载了大量用户对无人驾驶技术的讨论、体验分享和观点表达,这些UGC内容反映了社会公众对新兴技术的真实认知和接受度。传统的舆情监测方式往往依赖人工统计和简单的关键词匹配,难以处理海量非结构化的视频评论数据,也无法深入挖掘用户情感倾向和话题演变趋势。大数据技术的成熟为解决这一问题提供了新的思路,Spark作为主流的分布式计算框架,具备强大的实时数据处理能力和机器学习支持,能够有效应对社交媒体数据的复杂性和时效性要求。同时,可视化技术的发展使得复杂的数据分析结果能够以直观易懂的方式呈现,帮助决策者快速把握舆情动态和公众态度变化。 选题意义 本课题的研究具有一定的理论价值和实践意义。在理论层面,该系统将大数据处理技术与自然语言处理、情感分析等人工智能方法相结合,探索了社交媒体舆情分析的技术实现路径,为相关领域的研究提供了参考案例。通过构建多维度的分析模型,系统能够从时间演变、地域分布、用户画像等不同角度解读舆情数据,丰富了舆情分析的理论框架。在实践应用方面,系统为无人驾驶行业的发展提供了舆情监测工具,帮助企业了解公众对新技术的接受程度和关注焦点,为产品优化和市场推广提供数据支撑。对于政策制定者而言,系统生成的分析报告可以反映社会对无人驾驶技术的真实态度,为相关法规制定和风险评估提供参考。从技术实现角度来看,该项目整合了当前主流的大数据处理技术和前端开发框架,为计算机专业学生提供了一个较为完整的技术实践平台,有助于加深对分布式计算、数据挖掘和Web开发等知识的理解和应用。
基于大数据的无人驾驶网约车抖音社会舆情可视化分析系统-技术选型
大数据框架:Hadoop+Spark(本次没用Hive,支持定制) 开发语言:Python+Java(两个版本都支持) 后端框架:Django+Spring Boot(Spring+SpringMVC+Mybatis)(两个版本都支持) 前端:Vue+ElementUI+Echarts+HTML+CSS+JavaScript+jQuery 详细技术点:Hadoop、HDFS、Spark、Spark SQL、Pandas、NumPy 数据库:MySQL
基于大数据的无人驾驶网约车抖音社会舆情可视化分析系统-视频展示
基于大数据的无人驾驶网约车抖音社会舆情可视化分析系统-视频展示
基于大数据的无人驾驶网约车抖音社会舆情可视化分析系统-图片展示
基于大数据的无人驾驶网约车抖音社会舆情可视化分析系统-代码展示
from pyspark.sql import SparkSession
from pyspark.sql.functions import col, count, avg, when, regexp_extract, split, explode, desc, asc
from pyspark.ml.feature import Tokenizer, StopWordsRemover
from pyspark.ml.classification import NaiveBayes
from pyspark.ml.feature import HashingTF, IDF, StringIndexer
import pandas as pd
import numpy as np
from collections import Counter
import jieba
import re
spark = SparkSession.builder.appName("UnmannedVehicleSentimentAnalysis").config("spark.sql.adaptive.enabled", "true").config("spark.sql.adaptive.coalescePartitions.enabled", "true").getOrCreate()
def sentiment_analysis_processing():
comment_df = spark.read.format("jdbc").option("url", "jdbc:mysql://localhost:3306/sentiment_db").option("dbtable", "douyin_comments").option("user", "root").option("password", "password").load()
clean_comments = comment_df.filter(col("comment_content").isNotNull() & (col("comment_content") != "")).withColumn("cleaned_content", regexp_extract(col("comment_content"), r"[\u4e00-\u9fa5a-zA-Z0-9,。!?;:""''()]+", 0))
def sentiment_score_udf(text):
positive_words = ['好', '棒', '赞', '支持', '喜欢', '方便', '安全', '先进', '未来', '科技']
negative_words = ['担心', '害怕', '危险', '反对', '不行', '问题', '失业', '替代', '风险', '恐怖']
words = jieba.lcut(str(text))
pos_count = sum(1 for word in words if word in positive_words)
neg_count = sum(1 for word in words if word in negative_words)
if pos_count > neg_count:
return "positive"
elif neg_count > pos_count:
return "negative"
else:
return "neutral"
spark.udf.register("sentiment_udf", sentiment_score_udf)
sentiment_result = clean_comments.withColumn("sentiment", spark.sql("sentiment_udf(cleaned_content)").collect()[0][0])
sentiment_distribution = sentiment_result.groupBy("sentiment").agg(count("comment_id").alias("count"), (count("comment_id") * 100.0 / sentiment_result.count()).alias("percentage"))
time_sentiment = sentiment_result.withColumn("comment_date", col("comment_time").cast("date")).groupBy("comment_date", "sentiment").agg(count("comment_id").alias("daily_count"))
high_interaction = sentiment_result.filter((col("like_count") > 100) | (col("reply_count") > 50)).groupBy("sentiment").agg(count("comment_id").alias("high_interaction_count"), avg("like_count").alias("avg_likes"), avg("reply_count").alias("avg_replies"))
sentiment_words = sentiment_result.filter(col("sentiment") == "positive").select("cleaned_content").rdd.flatMap(lambda x: jieba.lcut(str(x[0]))).filter(lambda word: len(word) > 1).countByValue()
top_positive_words = dict(sorted(sentiment_words.items(), key=lambda x: x[1], reverse=True)[:50])
regional_sentiment = sentiment_result.join(spark.read.format("jdbc").option("url", "jdbc:mysql://localhost:3306/sentiment_db").option("dbtable", "user_info").option("user", "root").option("password", "password").load(), "user_id").groupBy("ip_region", "sentiment").agg(count("comment_id").alias("region_sentiment_count"))
return {"sentiment_distribution": sentiment_distribution.collect(), "time_sentiment": time_sentiment.collect(), "high_interaction": high_interaction.collect(), "positive_words": top_positive_words, "regional_sentiment": regional_sentiment.collect()}
def user_portrait_analysis():
user_df = spark.read.format("jdbc").option("url", "jdbc:mysql://localhost:3306/sentiment_db").option("dbtable", "user_info").option("user", "root").option("password", "password").load()
comment_df = spark.read.format("jdbc").option("url", "jdbc:mysql://localhost:3306/sentiment_db").option("dbtable", "douyin_comments").option("user", "root").option("password", "password").load()
user_activity = comment_df.groupBy("user_id").agg(count("comment_id").alias("comment_count"), avg("like_count").alias("avg_received_likes"), count("comment_time").alias("activity_frequency"))
active_users = user_activity.filter(col("comment_count") >= 5).orderBy(desc("comment_count"))
regional_distribution = user_df.groupBy("ip_region").agg(count("user_id").alias("user_count"), (count("user_id") * 100.0 / user_df.count()).alias("region_percentage")).orderBy(desc("user_count"))
user_signature_analysis = user_df.filter(col("user_signature").isNotNull() & (col("user_signature") != "")).select("user_signature").rdd.flatMap(lambda x: jieba.lcut(str(x[0]))).filter(lambda word: len(word) > 1 and word not in ['的', '是', '在', '了', '和', '就', '都', '有']).countByValue()
signature_keywords = dict(sorted(user_signature_analysis.items(), key=lambda x: x[1], reverse=True)[:30])
regional_activity = user_df.join(user_activity, "user_id").groupBy("ip_region").agg(avg("comment_count").alias("avg_regional_activity"), count("user_id").alias("regional_active_users"), avg("avg_received_likes").alias("avg_regional_likes"))
user_engagement_score = user_activity.withColumn("engagement_score", col("comment_count") * 0.4 + col("avg_received_likes") * 0.3 + col("activity_frequency") * 0.3).orderBy(desc("engagement_score"))
high_engagement_users = user_engagement_score.filter(col("engagement_score") > user_engagement_score.agg(avg("engagement_score")).collect()[0][0])
time_based_activity = comment_df.withColumn("comment_hour", col("comment_time").cast("timestamp").cast("int") % 86400 / 3600).groupBy("comment_hour").agg(count("comment_id").alias("hourly_comments"))
user_loyalty = comment_df.withColumn("comment_date", col("comment_time").cast("date")).groupBy("user_id").agg(count("comment_date").alias("active_days")).filter(col("active_days") >= 3)
regional_sentiment_preference = comment_df.join(user_df, "user_id").join(spark.sql("SELECT comment_id, sentiment_udf(comment_content) as sentiment FROM douyin_comments"), "comment_id").groupBy("ip_region", "sentiment").agg(count("comment_id").alias("sentiment_count"))
return {"user_activity": user_activity.collect(), "regional_distribution": regional_distribution.collect(), "signature_keywords": signature_keywords, "regional_activity": regional_activity.collect(), "high_engagement_users": high_engagement_users.collect(), "time_activity": time_based_activity.collect(), "user_loyalty": user_loyalty.collect(), "regional_sentiment": regional_sentiment_preference.collect()}
def topic_content_analysis():
video_df = spark.read.format("jdbc").option("url", "jdbc:mysql://localhost:3306/sentiment_db").option("dbtable", "douyin_videos").option("user", "root").option("password", "password").load()
comment_df = spark.read.format("jdbc").option("url", "jdbc:mysql://localhost:3306/sentiment_db").option("dbtable", "douyin_comments").option("user", "root").option("password", "password").load()
content_keywords = comment_df.select("comment_content").rdd.flatMap(lambda x: jieba.lcut(str(x[0]))).filter(lambda word: len(word) > 1 and '无人驾驶' in word or '自动驾驶' in word or '网约车' in word or '安全' in word or '技术' in word).countByValue()
hot_topics = dict(sorted(content_keywords.items(), key=lambda x: x[1], reverse=True)[:20])
video_interaction = video_df.withColumn("interaction_rate", (col("like_count") + col("reply_count")) / (col("view_count") + 1)).orderBy(desc("interaction_rate"))
content_sentiment_relation = comment_df.join(video_df, "video_id").select("video_content", "video_attitude", "comment_content").rdd.map(lambda x: (x[1], jieba.lcut(str(x[2])))).filter(lambda x: any(word in ['好', '赞', '支持'] for word in x[1])).countByKey()
safety_concerns = comment_df.filter(col("comment_content").rlike("安全|危险|事故|风险|担心")).groupBy().agg(count("comment_id").alias("safety_mention_count"))
technical_discussions = comment_df.filter(col("comment_content").rlike("技术|算法|传感器|激光雷达|AI|人工智能")).groupBy().agg(count("comment_id").alias("tech_mention_count"))
employment_concerns = comment_df.filter(col("comment_content").rlike("失业|工作|司机|职业|饭碗")).groupBy().agg(count("comment_id").alias("employment_mention_count"))
controversial_topics = comment_df.filter(col("reply_count") > 20).select("comment_content").rdd.flatMap(lambda x: jieba.lcut(str(x[0]))).filter(lambda word: len(word) > 1).countByValue()
controversy_keywords = dict(sorted(controversial_topics.items(), key=lambda x: x[1], reverse=True)[:15])
video_author_influence = video_df.groupBy("author").agg(count("video_id").alias("video_count"), avg("like_count").alias("avg_likes"), avg("reply_count").alias("avg_replies"), avg("view_count").alias("avg_views")).orderBy(desc("avg_likes"))
content_type_analysis = video_df.groupBy("video_form", "video_attitude").agg(count("video_id").alias("form_attitude_count"), avg("like_count").alias("avg_form_likes"))
topic_evolution = comment_df.withColumn("comment_month", col("comment_time").cast("date").cast("string").substr(1, 7)).select("comment_month", "comment_content").rdd.map(lambda x: (x[0], jieba.lcut(str(x[1])))).flatMapValues(lambda words: words).filter(lambda x: len(x[1]) > 1).map(lambda x: (x[0], x[1])).countByKey()
seasonal_topics = dict(sorted(topic_evolution.items(), key=lambda x: x[1], reverse=True)[:25])
return {"hot_topics": hot_topics, "video_interaction": video_interaction.collect(), "content_sentiment": dict(content_sentiment_relation), "safety_concerns": safety_concerns.collect(), "tech_discussions": technical_discussions.collect(), "employment_concerns": employment_concerns.collect(), "controversy_keywords": controversy_keywords, "author_influence": video_author_influence.collect(), "content_type": content_type_analysis.collect(), "seasonal_topics": seasonal_topics}
基于大数据的无人驾驶网约车抖音社会舆情可视化分析系统-结语
👇🏻 精彩专栏推荐订阅 👇🏻 不然下次找不到哟~
🍅 主页获取源码联系🍅