├── .gitignore
├── META-INF
└── MANIFEST.MF
├── README.md
├── docs
└── 接口调用说明.md
├── pom.xml
└── src
├── main
├── java
│ └── com
│ │ └── qdcz
│ │ ├── App.java
│ │ ├── chat
│ │ ├── allchat
│ │ │ └── AllChatQA.java
│ │ ├── cmbchat
│ │ │ └── CMBQA.java
│ │ ├── controller
│ │ │ └── ChatController.java
│ │ ├── entity
│ │ │ └── RequestParameter.java
│ │ ├── interfaces
│ │ │ └── ChatQA.java
│ │ ├── service
│ │ │ ├── QuestionPaserService.java
│ │ │ └── SmartQAService.java
│ │ ├── socialchat
│ │ │ └── SocialQA.java
│ │ └── tools
│ │ │ ├── Levenshtein.java
│ │ │ ├── MyComparetor.java
│ │ │ └── MyComparetorSJ.java
│ │ ├── common
│ │ ├── CommonTool.java
│ │ ├── ConceptRuler.java
│ │ └── XMLUtil.java
│ │ ├── conf
│ │ ├── DatabaseConfiguration.java
│ │ └── LoadConfigListener.java
│ │ ├── entity
│ │ ├── Edge.java
│ │ ├── Graph.java
│ │ ├── GraphDatabase.java
│ │ ├── IGraphEntity.java
│ │ ├── Project.java
│ │ └── Vertex.java
│ │ ├── graph
│ │ ├── controller
│ │ │ └── GraphControler.java
│ │ ├── interfaces
│ │ │ ├── IGraphBuzi.java
│ │ │ └── IGraphDAO.java
│ │ ├── neo4jcypher
│ │ │ ├── conf
│ │ │ │ └── Neo4jConfiguration.java
│ │ │ ├── connect
│ │ │ │ └── Neo4jClientFactory.java
│ │ │ ├── dao
│ │ │ │ └── Neo4jCYDAO.java
│ │ │ └── service
│ │ │ │ ├── AnalysisListedCoService.java
│ │ │ │ └── Neo4jCYService.java
│ │ ├── service
│ │ │ └── GraphOperateService.java
│ │ └── tools
│ │ │ └── ResultBuilder.java
│ │ ├── index
│ │ ├── elsearch
│ │ │ ├── conf
│ │ │ │ └── ELKConfig.java
│ │ │ ├── dao
│ │ │ │ └── ElasearchDAO.java
│ │ │ ├── elk
│ │ │ │ └── ElasearchClientFactory.java
│ │ │ └── service
│ │ │ │ └── ElasearchService.java
│ │ └── interfaces
│ │ │ ├── IIndexDAO.java
│ │ │ └── IIndexService.java
│ │ └── mongo
│ │ ├── BaseMongoDAL.java
│ │ ├── ConnManager.java
│ │ ├── MyMongo.java
│ │ └── conf
│ │ └── MongoConfiguration.java
└── resources
│ ├── application-dev.properties
│ ├── application-product.properties
│ ├── application.properties
│ ├── concept_rule_simple.txt
│ ├── dev
│ ├── database.xml
│ ├── elasearch.properties
│ ├── log4j2.xml
│ ├── mongo.properties
│ └── neo4j.properties
│ ├── product
│ ├── database.xml
│ ├── elasearch.properties
│ ├── log4j2.xml
│ ├── mongo.properties
│ └── neo4j.properties
│ ├── sougou.dic
│ └── stopword.dic
└── test
└── test
└── com
└── qdcz
├── conf
└── TestLoadConfigListener.java
├── graph
└── neo4jcypher
│ └── service
│ └── TestNeo4jCYService.java
└── other
├── GetLawJson.java
├── GetVertexesEdges.java
├── ImportData.java
├── JustTest.java
├── NumStatistLaws.java
├── StuctData
├── StructCheckCon.java
├── StructListedCom.java
├── StructNewPaper.java
├── StructPaper.java
├── StuctBSData.java
└── cutFile.java
├── hanlp
└── DemoDependencyParser.java
├── parse
├── BytesToHexString.java
├── CreateParse.java
└── GetDocumentInfo.java
├── testMongo.java
├── testRead.java
└── wiki
├── CheckError.java
└── StructWikiData.java
/.gitignore:
--------------------------------------------------------------------------------
1 | # general
2 | hs_err_pid*
3 |
4 | # Idea
5 | .idea/
6 | *.iml
7 |
8 | # Eclipse
9 | .project
10 | .classpath
11 | .settings/
12 |
13 | # maven
14 | target/
15 | pom.xml.tag
16 | pom.xml.releaseBackup
17 | pom.xml.versionsBackup
18 | pom.xml.next
19 | release.properties
20 | dependency-reduced-pom.xml
21 | buildNumber.properties
22 | .mvn/timing.properties
23 |
24 | # java
25 | *.jar
26 | *.war
27 | *.ear
28 | # Package Files #
29 | *.jar
30 | *.war
31 | *.ear
32 | *.zip
33 | *.tar.gz
34 | *.rar
35 |
--------------------------------------------------------------------------------
/META-INF/MANIFEST.MF:
--------------------------------------------------------------------------------
1 | Manifest-Version: 1.0
2 | Class-Path: javax.mail-1.5.6.jar x-pack-api-5.4.0.jar netty-3.10.6.Fin
3 | al.jar hibernate-validator-5.3.5.Final.jar lucene-join-6.5.0.jar luce
4 | ne-spatial-extras-6.5.0.jar spring-test-4.2.7.RELEASE.jar slf4j-api-1
5 | .7.25.jar netty-codec-4.1.9.Final.jar log4j-api-2.7.jar lucene-backwa
6 | rd-codecs-6.5.0.jar jopt-simple-5.0.2.jar spring-boot-autoconfigure-1
7 | .5.6.RELEASE.jar lucene-spatial3d-6.5.0.jar log4j-slf4j-impl-2.7.jar
8 | commons-logging-1.1.3.jar percolator-client-5.4.0.jar netty-transport
9 | -4.1.9.Final.jar x-pack-transport-5.4.0.jar jackson-annotations-2.8.0
10 | .jar transport-netty3-client-5.4.0.jar bcprov-jdk15on-1.55.jar classm
11 | ate-1.3.3.jar lucene-analyzers-common-6.5.0.jar netty-handler-4.1.9.F
12 | inal.jar unboundid-ldapsdk-3.2.1.jar tomcat-embed-websocket-8.5.16.ja
13 | r lang-mustache-client-5.4.0.jar hanlp-1.2.9-SNAPSHOT.jar elasticsear
14 | ch-5.4.0.jar activation-1.1.jar spring-core-4.3.10.RELEASE.jar jackso
15 | n-core-2.8.9.jar lucene-spatial-6.5.0.jar snakeyaml-1.17.jar spring-e
16 | xpression-4.3.10.RELEASE.jar spring-beans-4.3.10.RELEASE.jar rest-5.4
17 | .0.jar jcl-over-slf4j-1.7.25.jar httpclient-4.5.3.jar lucene-suggest-
18 | 6.5.0.jar netty-buffer-4.1.9.Final.jar commons-codec-1.10.jar lombok-
19 | 1.16.2.jar spring-boot-starter-log4j2-1.5.6.RELEASE.jar httpcore-4.4.
20 | 6.jar transport-5.4.0.jar netty-codec-http-4.1.9.Final.jar netty-reso
21 | lver-4.1.9.Final.jar lucene-grouping-6.5.0.jar bcpkix-jdk15on-1.55.ja
22 | r joda-time-2.9.9.jar lucene-memory-6.5.0.jar neo4j-java-driver-1.3.0
23 | .jar tomcat-embed-el-8.5.16.jar lucene-queries-6.5.0.jar owasp-java-h
24 | tml-sanitizer-r239.jar json-20140107.jar log4j-core-2.7.jar securesm-
25 | 1.1.jar spring-boot-starter-web-1.5.6.RELEASE.jar netty-common-4.1.9.
26 | Final.jar spring-boot-starter-1.5.6.RELEASE.jar t-digest-3.0.jar comm
27 | ons-io-2.5.jar httpasyncclient-4.1.3.jar jna-4.4.0.jar tomcat-embed-c
28 | ore-8.5.16.jar jackson-dataformat-yaml-2.8.9.jar lucene-core-6.5.0.ja
29 | r reindex-client-5.4.0.jar junit-4.12.jar lucene-misc-6.5.0.jar mongo
30 | -java-driver-3.4.2.jar spring-aop-4.3.10.RELEASE.jar hamcrest-core-1.
31 | 3.jar jboss-logging-3.3.1.Final.jar transport-netty4-client-5.4.0.jar
32 | sniffer-5.4.0.jar compiler-0.9.3.jar spring-web-4.3.10.RELEASE.jar h
33 | ttpcore-nio-4.4.5.jar jackson-dataformat-smile-2.8.9.jar spring-boot-
34 | starter-tomcat-1.5.6.RELEASE.jar hppc-0.7.1.jar guava-19.0.jar super-
35 | csv-2.4.0.jar delete-by-query-2.4.5.jar jackson-dataformat-cbor-2.8.9
36 | .jar spring-webmvc-4.3.10.RELEASE.jar lucene-queryparser-6.5.0.jar lu
37 | cene-highlighter-6.5.0.jar validation-api-1.1.0.Final.jar spring-cont
38 | ext-4.3.10.RELEASE.jar spring-boot-1.5.6.RELEASE.jar jul-to-slf4j-1.7
39 | .25.jar jackson-databind-2.8.9.jar HdrHistogram-2.1.9.jar lucene-sand
40 | box-6.5.0.jar
41 | Main-Class:
42 |
43 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # **知识图谱管理与智能问答引擎 v2.0**
2 |
3 | # **项目描述**
4 |
5 | - **介绍**:本项目用于操作neo4j数据库,elasticSearch以及与前端交互的服务器app。
6 | - **用途**:对3.2.0版本的neo4j数据库进行增删改查外加索引的操作
7 | - **特性**:
8 | 1.neo4j自带的服务端对中文建立的内置索引分词粒度以字为单位,不太符合实际需求,而且cypher语法没有对分词器的选择操作语句,修改采用elastic做中间业务处理索引内容对接图数据。
9 | 2.本代码选用hanlp分词器做索引分词底层,可扩展词典修改分词粒度。
10 |
11 | # **调用接口文档**
12 | 描述各个功能接口调用方法、参数及响应值,详见:[接口调用文档](docs/接口调用说明.md "接口调用文档")
13 |
14 |
15 | # **版本更新**
16 |
17 | ### 2017-08-28
18 |
19 | 1. 重构第一个版本(v2.0)
20 | 2. 支持多类型图谱检索、管理(由project参数指定,暂时支持银团贷款业务知识图谱、社科知识图谱、金融概念知识图谱)
21 | 3. 图谱查询支持返回节点类型(供前端可视化时筛选)
22 |
23 | ### 2017-08-02
24 |
25 | 1. 支持银行、金融、票据、证券、法律等行业的名词概念问答
26 |
27 | ### 2017-07-20
28 |
29 | 1. 初始版本
30 | 2. 支持银团贷业务指引条款相关内容问答
31 | 3. 针对无法回答的问题,引入图灵机器人
32 |
33 | ------------
34 |
35 | 编译、运行环境说明:
36 | -----------------------------------
37 | 使用JDK1.8.0版本,具体依赖都在pom中,本地nexus没有所需依赖。
38 |
39 | 总体目录
40 | -----------------------------------
41 | + main
42 | + java
43 | + com
44 | + qdcz
45 | * chat
46 | * common
47 | * graph
48 | * index
49 | * mongo
50 | + APP
51 | + resources
52 | + test
53 |
54 | -------------------
55 | **chat**包含智能问答接口与逻辑处理
56 | **common**中包含一些公用静态方法
57 | **graph**neo4j图操作及接口
58 | **index**为elasticSearch建立索引的接口与方法
59 | **sdn**为图边节点的实例化(entity)以及对应所需要的知识库cypher(epository)。
60 | **service**为结合实际所需的服务逻辑编写,分为低中高三层,上层依赖下层。
61 | **Tools**为定义的工具类。
62 | **APP为** `SpringbootSdnEmbeddedApplication`,启动服务主入口。
63 | **resources**为配置文件
64 | 其中`IKAnalyzer.cfg.xml`为IK分词的扩展配置,加载了2个扩展词典`sougou`、 `stopword`、`银团指引词典`
65 | `neo4j.properties`设置了app启动的驱动,访问的数据库的位置,对外端口
66 | `mongo.properties`设置了mongo-driver所需的信息
67 | `hanlp.properties`设置了han分词器加载词典位置
68 | **test**下为各类单元测试时使用的测试。
69 |
70 |
71 |
72 |
--------------------------------------------------------------------------------
/docs/接口调用说明.md:
--------------------------------------------------------------------------------
1 | # **智能问答接口**
2 |
3 | 
4 |
5 | ### **接口描述**
6 | - 该接口对知识库的相关知识提问做相应回答。
7 |
8 | ### **请求URL**
9 | - ` h134:14000/askFromWeChat?question=银团贷款业务借款人需要签署什么?&project=xxxxx `
10 |
11 | ### **请求方式**
12 | - POST/GET
13 |
14 | ### **Header**
15 | 暂无特殊要求
16 |
17 | ### **参数**
18 |
19 | |参数名|必选|类型|说明|
20 | |:---- |:---|:----- |----- |
21 | |question | 是 | string | 对于相关知识点提出的问题 |
22 | |project | 是 | string | 所在工程库 目前有xz(小招) sk(社科) all(所有库 ,此部分未完成,预留接口) |
23 |
24 | ### **参数示例**
25 | ```
26 | question=银团贷款业务借款人需要签署什么?&project=xz
27 | ```
28 |
29 | ### **返回示例**
30 |
31 | ```
32 | {
33 | "title":"银团贷款",
34 | "type":"Graph",
35 | "data":"是由获准经营贷款业务的一家或数家银行牵头,多家银行与非银行金融机构参加而组成的银行集团(Banking Group)采用同一贷款协议,按商定的期限和条件向同一借款人提供融资的贷款方式。国际银团是由不同国家的多家银行组成的银行集团。"
36 | }
37 | ```
38 | 说明:
39 | type为所有调用的返回类型,有**Graph,Turing,law**
40 | title为type是**Law**时候才会有的字段
41 | data为整理返回的展示结果集
42 |
43 |
44 | ------
45 |
46 | # **知识库操作平台接口**
47 |
48 | ### **接口描述**
49 | - 该接口主要是为相关专业人士能够直接操作图谱与前台对接的增删改查的API。
50 | - 根据相应功能传入参入进行不同深度的DFS或BFS将相关结果处理后返回给前台。
51 |
52 | ### **请求URL**
53 | - ` http://h134:14000/graphOp `
54 |
55 | ### **请求方式**
56 | - POST/GET
57 |
58 | ### **Header**
59 | 暂无特殊要求
60 |
61 | ### **参数**
62 | 请求参数为一个整体的Json请求体,整个Json中需包含以下字段参数
63 |
64 | |参数名|必选|类型|说明|
65 | |:---- |:---|:----- |----- |
66 | |type | 是 | string | 对图谱操作调用类型,包括
checkByName(通过名称查询)
checkByIndex(通过索引查询)
checkById(通过节点id查询)
addNode(新增节点)
deleteNode(删除节点)
changeNode(修改节点)
addEdge(新增边)
changeEdge(修改边)
deleteEdge(删除边)
addNodeEdge(新增边和终点)
queryNodeDetail(查看点的详情)
queryEdgeDetail(查看边的详情)
getEdgeAllName(查询边的所有名称) |
67 | |project | 是 | string | 所用的知识库图谱 目前有
ytdkyw(银团贷款业务)
shkx(社会科学知识库)
licom(上市公司分析)
down_2014(2014上市公司担保分析) |
68 | |info.node | 否 | Json | 点相关信息,请求type为点相关则必须填写内部相关信息 |
69 | |info.edge | 否 | Json | 边相关信息,请求type为边相关则必须填写内部相关信息 |
70 | |info.layer | 是 | string | 搜索的深度数量 |
71 | |info.node.name | 否 | string | 节点名称 |
72 | |info.node.id | 否 | string | 删改查时候才会用到,增时为系统自动生成 |
73 | |info.node.root | 否 | string | 节点所在子图 |
74 | |info.node.type | 否 | string | 节点类型 |
75 | |info.node.label | 否 | string | 节点所在的标签 |
76 | |info.node.content | 否 | string | 节点内容,为Json转成的string |
77 | |info.edge.id | 否 | string | 边的图上id,系统自动生成 |
78 | |info.edge.from | 否 | string | 边的起始点id |
79 | |info.edge.to | 否 | string | 边的终点id |
80 | |info.edge.relationship | 否 | string | 边所在的关系标签 |
81 | |info.edge.name | 否 | string | 边的名称 |
82 |
83 | ### **参数示例**
84 | - data= ` json `字符串
85 | - json字符串示例如下:
86 |
87 | ```
88 | {"type":"deleteEdge",
89 | "project":"",
90 | "info":{
91 | "node":{
92 | "name":"",
93 | "id":"",
94 | "root":"",
95 | "type":"",
96 | "label":"edge",
97 | "content":""
98 | },
99 | "edge":{
100 | "id":"",
101 | "from":"",
102 | "to":"",
103 | "relationship":"",
104 | "name":""
105 | },
106 | "layer":"2"
107 | }
108 | }
109 | ```
110 | 说明:
111 | 请求参数名为` data `,后面为一个完整的**json**的` String `类型
112 |
113 | ### **返回示例**
114 | result:
115 | ```
116 | {
117 | "nodeTypeName":[
118 | {
119 | "type_cn":"描述",
120 | "type_en":"desc"
121 | },
122 | {
123 | "type_cn":"别名",
124 | "type_en":"aliases"
125 | },
126 | {
127 | "type_cn":"公司",
128 | "type_en":"com"
129 | }
130 | ],
131 | "nodes":[
132 | {
133 | "identity":"46bf30c1-14fc-4bbe-8727-ac39a4b65a72",
134 | "root":"wiki数据",
135 | "name":"地球",
136 | "name_length":2,
137 | "id":"5443432",
138 | "label":"wikidata_label",
139 | "type":"com",
140 | "content":""
141 | },
142 | {
143 | "identity":"b245c7b2-6946-4a45-bf8c-4292299d9c17",
144 | "root":"wiki数据",
145 | "name":"Sol d",
146 | "name_length":5,
147 | "id":"5443444",
148 | "label":"wikidata_label",
149 | "type":"aliases",
150 | "content":""
151 | }
152 | ],
153 | "center":"5443432",
154 | "edges":[
155 | {
156 | "root":"wiki数据",
157 | "name":"aliases",
158 | "from":"5443432",
159 | "name_length":7,
160 | "to":"5443442",
161 | "id":"534328",
162 | "relationship":"wikidata_relationship"
163 | },
164 | {
165 | "root":"wiki数据",
166 | "name":"aliases",
167 | "from":"5443432",
168 | "name_length":7,
169 | "to":"5443437",
170 | "id":"534323",
171 | "relationship":"wikidata_relationship"
172 | }
173 | ]
174 | }
175 |
176 |
177 | ```
178 | 说明:
179 |
180 | |字段名|类型|说明|
181 | |:---- |:----- |----- |
182 | |nodeTypeName | JsonArray | 结果集合中点的类型集合 |
183 | |nodes | JsonArray | 结果集中所有的点信息 |
184 | |edges | JsonArray | 结果集中所有的边信息 |
185 | |center | String | 结果集子图的中心点的id |
186 | |nodeTypeName.type_cn | String | 节点类型中文描述 |
187 | |nodeTypeName.type_en | String | 节点类型英文描述 |
188 | |identity | String | 外部定义的唯一表示,用于插入时做标示使用 |
189 | |root | String | 所在子项目的名称,主要只是要求任务的名称 |
190 | |name | String | 具体名称 |
191 | |name_length | String | 名称长度 |
192 | |id | String | neo4j产生的内部唯一标示 |
193 | |label | String | 节点所在标签 |
194 | |content | String | 自身其他信息,但是不用于业务中 |
195 | |from | String | 边起始id |
196 | |to | String | 边终点id |
197 | |relationship | String | 边所在的关系标签 |
198 |
199 |
200 | ------
201 |
202 |
203 |
204 |
--------------------------------------------------------------------------------
/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | com.qdcz
7 | KBQA
8 | 1.0-SNAPSHOT
9 |
10 |
11 | org.springframework.boot
12 | spring-boot-starter-parent
13 | 1.5.6.RELEASE
14 |
15 |
16 |
17 | 4.0.0
18 |
19 | UTF-8
20 | 1.8
21 | 1.8
22 | 1.0.0
23 | 1.16.2
24 | 4.1.2.RELEASE
25 | 19.0
26 | 2.0.3
27 | 3.2.2
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 | elasticsearch-releases
37 | https://artifacts.elastic.co/maven
38 |
39 | true
40 |
41 |
42 | false
43 |
44 |
45 |
46 |
47 |
48 |
49 | org.json
50 | json
51 | 20140107
52 |
53 |
54 | org.springframework.boot
55 | spring-boot-starter-test
56 | 1.5.6.RELEASE
57 | test
58 |
59 |
60 | com.vaadin.external.google
61 | android-json
62 |
63 |
64 |
65 |
66 |
72 |
73 |
74 |
75 |
76 |
77 |
78 | org.elasticsearch
79 | elasticsearch
80 | 5.4.0
81 |
82 |
83 | org.elasticsearch.client
84 | x-pack-transport
85 | 5.4.0
86 |
87 |
88 | org.elasticsearch.plugin
89 | delete-by-query
90 | 2.4.5
91 |
92 |
93 |
94 |
95 |
96 | org.springframework.boot
97 | spring-boot-starter-web
98 |
99 |
100 | org.springframework.boot
101 | spring-boot-starter-logging
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 | org.springframework.boot
111 | spring-boot-starter-log4j2
112 | 1.5.6.RELEASE
113 |
114 |
115 |
116 |
117 | org.apache.poi
118 | poi
119 | 3.8
120 | test
121 |
122 |
123 |
124 | org.apache.poi
125 | poi-ooxml
126 | 3.8
127 | test
128 |
129 |
130 |
131 | org.apache.poi
132 | poi-scratchpad
133 | 3.8
134 | test
135 |
136 |
137 |
138 | commons-io
139 | commons-io
140 | 2.5
141 |
142 |
143 |
144 |
145 | pdfbox
146 | pdfbox
147 | 0.7.3
148 | test
149 |
150 |
151 |
152 |
157 |
158 |
159 |
160 | com.hankcs
161 | hanlp
162 | 1.2.9-SNAPSHOT
163 |
164 |
165 |
166 |
167 |
168 | org.mongodb
169 | mongo-java-driver
170 | 3.4.2
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 | org.neo4j.driver
183 | neo4j-java-driver
184 | 1.3.0
185 |
186 |
187 |
188 |
189 | org.projectlombok
190 | lombok
191 | ${lombok.version}
192 |
193 |
194 | com.google.guava
195 | guava
196 | ${guava.version}
197 |
198 |
199 |
200 | net.sourceforge.jexcelapi
201 | jxl
202 | 2.6
203 |
204 |
205 |
206 | org.apache.commons
207 | commons-lang3
208 | 3.6
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 | org.apache.maven.plugins
223 | maven-surefire-plugin
224 | 2.18.1
225 |
226 | true
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 | org.apache.maven.plugins
236 |
237 | maven-jar-plugin
238 |
239 | target/classes/
240 |
241 |
242 |
243 | com.qdcz.App
244 |
245 | false
246 | true
247 | lib/
248 |
249 |
250 | .
251 |
252 |
253 |
254 |
255 |
256 | org.apache.maven.plugins
257 | maven-dependency-plugin
258 |
259 |
260 | copy-dependencies
261 | prepare-package
262 |
263 | copy-dependencies
264 |
265 |
266 | ${project.build.directory}/lib
267 | compile
268 | false
269 | false
270 | true
271 |
272 |
273 |
274 |
275 |
276 |
277 |
278 |
279 | src/main/resources
280 |
281 | **/*
282 |
287 |
288 |
289 |
290 |
291 |
292 |
293 |
--------------------------------------------------------------------------------
/src/main/java/com/qdcz/App.java:
--------------------------------------------------------------------------------
1 | package com.qdcz;
2 |
3 | import com.hankcs.hanlp.utility.Predefine;
4 | import org.springframework.boot.SpringApplication;
5 | import org.springframework.boot.autoconfigure.SpringBootApplication;
6 | import org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration;
7 | import org.springframework.boot.web.servlet.ServletComponentScan;
8 |
9 | /**
10 | *Created by hadoop on 17-6-22.
11 | * APP main
12 | */
13 | @ServletComponentScan
14 | @SpringBootApplication(exclude = {MongoAutoConfiguration.class})
15 | public class App {
16 | public static void main(String[] args){
17 | SpringApplication.run(App.class, args);
18 | }
19 | }
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/main/java/com/qdcz/chat/allchat/AllChatQA.java:
--------------------------------------------------------------------------------
1 | package com.qdcz.chat.allchat;
2 |
3 | import com.qdcz.chat.entity.RequestParameter;
4 | import com.qdcz.chat.interfaces.ChatQA;
5 | import org.neo4j.driver.v1.types.Path;
6 | import org.springframework.stereotype.Service;
7 |
8 | import java.util.List;
9 | import java.util.Map;
10 | import java.util.Set;
11 |
12 | /**
13 | * Created by star on 17-8-11.
14 | */
15 | @Service
16 | public class AllChatQA extends ChatQA {
17 | @Override
18 | public Set MatchPath(List