当前位置:   article > 正文

【开发技术经验分享】计算机毕业设计吊打导师Python+Spark知识图谱微博舆情预警系统 舆情分析 微博推荐系统 微博可视化 微博数据分析 微博大数据 微博爬虫 微博预测系统 大数据毕业设计_微博舆情分析及其知识图谱的构建

微博舆情分析及其知识图谱的构建

开发框架

前端:vue.js element-ui

后端:springboot mybatis

中间件:spark hadoop hive flink

数据库:mysql关系型数据库 neo4j图数据库

算法:协同过滤推荐算法 SVD MLP lstm情感分析

第三方接口:百度AI 阿里云平台

数据采集:Python爬虫

创新点

知识图谱

4种推荐算法

数据可视化大屏

预警预测功能

爬虫

深度学习情感分析

短信验证码修改密码

AI识别身份证认证

爬虫代码

def deleteDate():
    sql = "DELETE FROM news "
    try:
        # 执行SQL语句
        cursor.execute(sql)
        # 提交修改
        db.commit()
    except:
        # 发生错误时回滚
        db.rollback()

def saveDate(title,content,time,recourse,url):
    try:
        cursor.execute("INSERT INTO news(news_title, news_content, type_id, news_creatTime, news_recourse,news_link) VALUES ('%s', '%s', '%s', '%s', '%s' ,'%s')" % \
          (title, content, random.randint(1,8), time, recourse,url))
        db.commit()
        print("执行成功")
    except:
        db.rollback()
        print("执行失败")

def getLink(baseurl):
    html = requests.get(baseurl, headers=hea)
    html.encoding = 'utf8'
    soup = BeautifulSoup(html.text, 'html.parser')
    for item in soup.select('div.content_list > ul > li'):
        # 对不符合的数据进行清洗
        if (item.a == None):
            continue
        data = []
        type = item.div.text[1:3]  # 类型
        link = item.div.next_sibling.next_sibling.a['href']
        data.append(type)
        data.append(link)
        links.append(data)

if __name__ == '__main__':
    main()
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38

scala分析代码

package com.bigdata.spark.reducebykey_sort

import org.apache.spark.{SparkConf, SparkContext}

/**
 * @program: spark-api-demo
 * @description: 类作用描述
 * @author: 小毕
 * @company: 清华大学深圳研究生院
 * @create: 2019-09-02 18:00
 */
object ReduceByKeySortRddDemo {

  def main(args: Array[String]): Unit = {
    val conf=new SparkConf()
      .setAppName("MapFilterApp")
      .setMaster("local")
    val sc=new SparkContext(conf)
    val rdd1=sc.parallelize(List(("tom", 1), ("jerry", 3), ("kitty", 2),  ("shuke", 1)))
    val rdd2=sc.parallelize(List(("jerry", 2), ("tom", 3), ("shuke", 2), ("kitty", 5)))
    val rdd3=rdd1.union(rdd2)
    //按key进行聚合
    val rdd4=rdd3.reduceByKey(_+_)
    rdd4.collect.foreach(println(_))
    //按value的降序排序
    val rdd5=rdd4.map(t=>(t._2,t._1)).sortByKey(false).map(t=>(t._2,t._1))
    rdd5.collect.foreach(println)
  }

}

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31

可视化代码

package com.bigdata.storm.kafka.util;

import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;

/**
 * @program: storm-kafka-api-demo
 * @description: redis工具类
 * @author: 小毕
 * @company: 清华大学深圳研究生院
 * @create: 2019-08-22 17:23
 */
public class JedisUtil {
    
    /*redis连接池*/
    private static JedisPool pool;
    
    /**
    *@Description: 返回redis连接池
    *@Param: 
    *@return: 
    *@Author: 小毕
    *@date: 2019/8/22 0022
    */
    public static JedisPool getPool(){
        if(pool==null){
            //创建jedis连接池配置
            JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();
            //最大连接数
            jedisPoolConfig.setMaxTotal(20);
            //最大空闲连接
            jedisPoolConfig.setMaxIdle(5);
            pool=new JedisPool(jedisPoolConfig,"node03.hadoop.com",6379,3000);
        }
        return pool;
    }

    public static Jedis getConnection(){
        return getPool().getResource();
    }

/*    public static void main(String[] args) {
        //System.out.println(getPool());
        //System.out.println(getConnection().set("hello","world"));
    }*/






    
    
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55

运行截图

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

运行视频

计算机毕业设计吊打导师Python+Spark知识图谱微博预警系统 微博推荐系统 微博可视化 微博数据分析 微博大数据 微博爬虫 微博预测系统 大数据毕业设计

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/凡人多烦事01/article/detail/382863
推荐阅读
相关标签
  

闽ICP备14008679号