Skip to content

研一人工智能原理大作业:基于垂直领域的电影查询问答系统,采用Neo4j、jieba分词和朴素贝叶斯分类算法实现

Notifications You must be signed in to change notification settings

junezds/Q-A-Movie-System

 
 

Repository files navigation

基于垂直领域的电影查询问答系统

1、安装neo4j

2、将数据集放入安装包的import目录

3、命令行输入neo4j start 启动数据库

4、打开http:https://localhost:7474,设置密码为123456

5、执行以下代码导入数据集

//导入节点 电影类型 == 注意类型转换 LOAD CSV WITH HEADERS FROM "file:https:///genre.csv" AS line MERGE (p:Genre{gid:toInteger(line.gid),name:line.gname})

//导入节点 演员信息 LOAD CSV WITH HEADERS FROM 'file:https:///person.csv' AS line MERGE (p:Person { pid:toInteger(line.pid),birth:line.birth, death:line.death,name:line.name, biography:line.biography, birthplace:line.birthplace})

// 导入节点 电影信息 LOAD CSV WITH HEADERS FROM "file:https:///movie.csv" AS line
MERGE (p:Movie{mid:toInteger(line.mid),title:line.title,introduction:line.introduction, rating:toFloat(line.rating),releasedate:line.releasedate})

// 导入关系 actedin 电影是谁参演的 1对多 LOAD CSV WITH HEADERS FROM "file:https:///person_to_movie.csv" AS line match (from:Person{pid:toInteger(line.pid)}),(to:Movie{mid:toInteger(line.mid)})
merge (from)-[r:actedin{pid:toInteger(line.pid),mid:toInteger(line.mid)}]->(to)

//导入关系 电影是什么类型 == 1对多 LOAD CSV WITH HEADERS FROM "file:https:///movie_to_genre.csv" AS line match (from:Movie{mid:toInteger(line.mid)}),(to:Genre{gid:toInteger(line.gid)})
merge (from)-[r:is{mid:toInteger(line.mid),gid:toInteger(line.gid)}]->(to)

6、在python IDE中运行代码

About

研一人工智能原理大作业:基于垂直领域的电影查询问答系统,采用Neo4j、jieba分词和朴素贝叶斯分类算法实现

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.5%
  • Other 0.5%