自动问答系统开源轮子简介

本文对自动问答系统相关的开源轮子做简单的对比,包括全套的问答系统实现和纯粹的NLP框架。
对比的指标很简单:能不能跑起来、能不能正常交互。虽然指标很简单,但是实际上很多开源项目并不能达标……

1 开源的自动问答系统

下面这些东西都很难跑起来,基本上都要安装一大堆依赖,每个至少几百兆。

1.1 DrQA

1.1.1 简介

Facebook在2017年发表的成果

系统组成:

  • Document Retriever
    • 将数据集训练成模型
  • Document Reader
    • 抽取答案
  • DrQA Pipline
    • 连接各组件
  • Distant Supervision(DS)
    • 远程监督
  • Tokenizers
    • 分词、命名实体标识

依赖pytorch,装这个东西很耗时间。装的时候不要编译源码,编译既耗时也耗内存,很容易失败,可以采用以下两种方式之一:

  • pip install torch torchversion
  • pip3 install torch torchversion

注意python的版本,官方文档里运行DrQA的demo是用python 命令来运行的,实际上是python3,如果你的系统没有对python3做别名或者链接为python,那么如果用pip3来安装pytorch是没用的(因为输入python命令的时候调用的是python2),然后我也试过用python3来运行DrQA的demo,有部分模块是安装不了的,所以还是要用pip来安装(虽然pytorch的官方安装命令用的是pip3)

1.1.2 配置要求

这东西应该是将数据集全部加载到内存里的,很吃内存。wikipedia的数据集下载下来的压缩包有7G+,解压之后有25G,所以硬盘的可用空间起码要有33G,运行的时候大概用了15G内存,因此内存+swap要大于15G。

1.1.3 效果

效果貌似也不太好,文档搜索的准确度挺好,但是从目标文档里提取的答案却不太好:

1.2 QuestionAnsweringSystem

QuestionAnsweringSystem技术实现分析.pdf

  • Java实现
  • 2015年的工程,没有经受生产验证,也没有论文发表
  • 响应速度太慢了,单机单个访问的响应时间都超过10秒
    • 这一点其实是预热的问题,第一个问题进来之后会解压一个东西,然后加载,这里会占用比较长的时间,之后的响应其实都挺快的
  • 原理其实就是接受问题,用问题去搜索引擎搜索答案,拿到第一页结果,然后解析html标签将摘要解析为段落文本,然后评价、返回。
    • 解析的摘要其实并不准确,这就导致了后面不会准确,可以构造一个语料库来测试

1.3 OpenEphyra

在线: http://www.ephyra.info/
https://github.com/TScottJ/OpenEphyra

首个QA系统,很久没维护了,在线网站的域名都被别人买走了。

开源的项目代码还是用eclipse开发的,所有配置文件都放到github了,用到的库全塞到lib目录一并上传了,可见工程经验很不足,估计代码性能也是不行的。用到的库也是很旧的版本,大部分版本在公共的maven仓库上是没有的。

代码跑起来了,但是输入很简单的问题『What is car?』都给不出答案:

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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
Question: What is car?

+++++ Analyzing question (2018-06-27 14:26:40) +++++
Normalization: what be car

Answer types:
-

Interpretations:
Property: DEFINITION
Target: car
Property: NAME
Target: car

Predicates:
-

+++++ Generating queries (2018-06-27 14:26:40) +++++
Query strings:
"car" car
"car" car

+++++ Searching (2018-06-27 14:26:40) +++++

Search error:
java.net.SocketTimeoutException: connect timed out

Search error:
java.net.SocketTimeoutException: connect timed out

Search error:
java.net.SocketTimeoutException: connect timed out

Search error:
java.net.SocketTimeoutException: connect timed out

Search error:
java.net.SocketTimeoutException: connect timed out

Search error:
java.net.SocketTimeoutException: connect timed out

Search error:
java.net.SocketTimeoutException: connect timed out

Search error:
java.net.SocketTimeoutException: connect timed out

Search error:
java.net.SocketTimeoutException: connect timed out

Search error:
java.net.SocketTimeoutException: connect timed out

+++++ Selecting Answers (2018-06-27 14:26:56) +++++
Filter "AnswerTypeFilter" started, 0 Results (2018-06-27 14:26:56)
Filter "AnswerTypeFilter" finished, 0 Results (2018-06-27 14:26:56)
Filter "AnswerPatternFilter" started, 0 Results (2018-06-27 14:26:56)
Filter "AnswerPatternFilter" finished, 0 Results (2018-06-27 14:26:56)
Filter "WebDocumentFetcherFilter" started, 0 Results (2018-06-27 14:26:56)
Filter "WebDocumentFetcherFilter" finished, 0 Results (2018-06-27 14:26:56)
Filter "PredicateExtractionFilter" started, 0 Results (2018-06-27 14:26:56)
Filter "PredicateExtractionFilter" finished, 0 Results (2018-06-27 14:26:56)
Filter "FactoidsFromPredicatesFilter" started, 0 Results (2018-06-27 14:26:56)
Filter "FactoidsFromPredicatesFilter" finished, 0 Results (2018-06-27 14:26:56)
Filter "TruncationFilter" started, 0 Results (2018-06-27 14:26:56)
Filter "TruncationFilter" finished, 0 Results (2018-06-27 14:26:56)
Filter "StopwordFilter" started, 0 Results (2018-06-27 14:26:56)
Filter "StopwordFilter" finished, 0 Results (2018-06-27 14:26:56)
Filter "QuestionKeywordsFilter" started, 0 Results (2018-06-27 14:26:56)
Filter "QuestionKeywordsFilter" finished, 0 Results (2018-06-27 14:26:56)
Filter "ScoreNormalizationFilter" started, 0 Results (2018-06-27 14:26:56)
Filter "ScoreNormalizationFilter" finished, 0 Results (2018-06-27 14:26:56)
Filter "ScoreCombinationFilter" started, 0 Results (2018-06-27 14:26:56)
Filter "ScoreCombinationFilter" finished, 0 Results (2018-06-27 14:26:56)
Filter "FactoidSubsetFilter" started, 0 Results (2018-06-27 14:26:56)
Filter "FactoidSubsetFilter" finished, 0 Results (2018-06-27 14:26:56)
Filter "DuplicateFilter" started, 0 Results (2018-06-27 14:26:56)
Filter "DuplicateFilter" finished, 0 Results (2018-06-27 14:26:56)
Filter "ScoreSorterFilter" started, 0 Results (2018-06-27 14:26:56)
Filter "ScoreSorterFilter" finished, 0 Results (2018-06-27 14:26:56)

Answer:

看了下代码,这些socket timeout发生的地方其实都是去请求搜索引擎拿答案的。。。。。

1.4 Watsonsim

https://github.com/SeanTater/uncc2014watsonsim/

gradle构建失败:

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
FAILURE: Build failed with an exception.

* What went wrong:
Could not resolve all dependencies for configuration ':compile'.
> Could not find :libsvm:.
Searched in the following locations:
https://repo1.maven.org/maven2//libsvm//libsvm-.pom
https://repo1.maven.org/maven2//libsvm//libsvm-.jar
https://repo.eclipse.org/content/groups/releases//libsvm//libsvm-.pom
https://repo.eclipse.org/content/groups/releases//libsvm//libsvm-.jar
file:/home/gordon/Documents/repo/github/uncc2014watsonsim/lib/libsvm-.jar
file:/home/gordon/Documents/repo/github/uncc2014watsonsim/lib/libsvm.jar
file:/home/gordon/Documents/repo/github/uncc2014watsonsim/data/lib/libsvm-.jar
file:/home/gordon/Documents/repo/github/uncc2014watsonsim/data/lib/libsvm.jar
Required by:
edu.uncc:uncc2014watsonsim:0.4.0
> Could not find lemurproject.indri:indri:5.7.
Searched in the following locations:
https://repo1.maven.org/maven2/lemurproject/indri/indri/5.7/indri-5.7.pom
https://repo1.maven.org/maven2/lemurproject/indri/indri/5.7/indri-5.7.jar
https://repo.eclipse.org/content/groups/releases/lemurproject/indri/indri/5.7/indri-5.7.pom
https://repo.eclipse.org/content/groups/releases/lemurproject/indri/indri/5.7/indri-5.7.jar
file:/home/gordon/Documents/repo/github/uncc2014watsonsim/lib/indri-5.7.jar
file:/home/gordon/Documents/repo/github/uncc2014watsonsim/lib/indri.jar
file:/home/gordon/Documents/repo/github/uncc2014watsonsim/data/lib/indri-5.7.jar
file:/home/gordon/Documents/repo/github/uncc2014watsonsim/data/lib/indri.jar
Required by:
edu.uncc:uncc2014watsonsim:0.4.0
> Could not find :stanford-srparser-2014-08-28-models:.
Searched in the following locations:
https://repo1.maven.org/maven2//stanford-srparser-2014-08-28-models//stanford-srparser-2014-08-28-models-.pom
https://repo1.maven.org/maven2//stanford-srparser-2014-08-28-models//stanford-srparser-2014-08-28-models-.jar
https://repo.eclipse.org/content/groups/releases//stanford-srparser-2014-08-28-models//stanford-srparser-2014-08-28-models-.pom
https://repo.eclipse.org/content/groups/releases//stanford-srparser-2014-08-28-models//stanford-srparser-2014-08-28-models-.jar
file:/home/gordon/Documents/repo/github/uncc2014watsonsim/lib/stanford-srparser-2014-08-28-models-.jar
file:/home/gordon/Documents/repo/github/uncc2014watsonsim/lib/stanford-srparser-2014-08-28-models.jar
file:/home/gordon/Documents/repo/github/uncc2014watsonsim/data/lib/stanford-srparser-2014-08-28-models-.jar
file:/home/gordon/Documents/repo/github/uncc2014watsonsim/data/lib/stanford-srparser-2014-08-28-models.jar
Required by:
edu.uncc:uncc2014watsonsim:0.4.0

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 38.667 secs

1.5 YodaQA

https://github.com/brmson/yodaqa/

  • 2015年搞的
  • 在线的示例没响应

1.5.1 原理

http://ailao.eu/yodaqa/science.html

1.5.2 运行

构建失败(卡在test那一步):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
➜  yodaqa git:(master) ./gradlew check
:generateTypeSystem UP-TO-DATE
:compileJava UP-TO-DATE
:compileGroovy UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:generateTestTypeSystem UP-TO-DATE
:compileTestJava UP-TO-DATE
:compileTestGroovy UP-TO-DATE
:processTestResources UP-TO-DATE
:testClasses UP-TO-DATE
:test

cz.brmlab.yodaqa.provider.rdf.DBpediaTypesTest > testQueryTitleForm STARTED
> Building 83% > :test

可以跳过这一步,直接运行./gradlew web -q,这样开启了web服务,访问4567端口,输入问题,提交之后可以从后台的日志里面看到还是需要下载一大堆东西(100MB左右)。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
                           rx         |       tx
--------------------------------------+------------------
bytes 108.95 MiB | 9.99 MiB
--------------------------------------+------------------
max 6.96 Mbit/s | 574 kbit/s
average 361.95 kbit/s | 33.19 kbit/s
min 0 kbit/s | 1 kbit/s
--------------------------------------+------------------
packets 92679 | 51726
--------------------------------------+------------------
max 635 p/s | 451 p/s
average 36 p/s | 20 p/s
min 0 p/s | 0 p/s
--------------------------------------+------------------

然而即使下完了,还是会出错:

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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
INFO ResourceObjectProviderBase - Producing resource from jar:file:/home/gordon/.ivy2/cache/de.tudarmstadt.ukp.dkpro.core/de.tudarmstadt.ukp.dkpro.core.opennlp-upstream-ner-en-time/jars/de.tudarmstadt.ukp.dkpro.core.opennlp-upstream-ner-e
n-time-20100907.jar!/de/tudarmstadt/ukp/dkpro/core/opennlp/lib/ner-en-time.bin
INFO ResourceObjectProviderBase - Producing resource took 400ms
java.net.ConnectException: Connection timed out (Connection timed out)
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at java.net.Socket.connect(Socket.java:538)
at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:463)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:558)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:242)
at sun.net.www.http.HttpClient.New(HttpClient.java:339)
at sun.net.www.http.HttpClient.New(HttpClient.java:357)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1202)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1138)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1032)
at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:966)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1546)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1474)
at cz.brmlab.yodaqa.provider.rdf.DBpediaTitles.queryFuzzyLookup(DBpediaTitles.java:256)
at cz.brmlab.yodaqa.provider.rdf.DBpediaTitles.query(DBpediaTitles.java:102)
at cz.brmlab.yodaqa.analysis.question.CluesToConcepts.process(CluesToConcepts.java:104)
at org.apache.uima.analysis_component.JCasAnnotator_ImplBase.process(JCasAnnotator_ImplBase.java:48)
at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.callAnalysisComponentProcess(PrimitiveAnalysisEngine_impl.java:385)
at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.processAndOutputNewCASes(PrimitiveAnalysisEngine_impl.java:309)
at cz.brmlab.yodaqa.flow.asb.MultiprocessingAnalysisEngine_MultiplierOk.processAndOutputNewCASes(MultiprocessingAnalysisEngine_MultiplierOk.java:218)
at cz.brmlab.yodaqa.flow.asb.MultiThreadASB$AggregateCasIterator$1.call(MultiThreadASB.java:772)
at cz.brmlab.yodaqa.flow.asb.MultiThreadASB$AggregateCasIterator$1.call(MultiThreadASB.java:754)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
*** http://yodaqa.felk.cvut.cz/dbp-labels1 or http://yodaqa.felk.cvut.cz/dbp-labels2 label lookup query (temporarily?) failed, retrying in a moment...
ALERT: main seems stuck for more than 300s waiting for a job delivery.
Thread[main,5,main] - Future java.util.concurrent.FutureTask@42ca6733 done false canc false :: AE cz.brmlab.yodaqa.analysis.question.QuestionAnalysisAE from CAS org.apache.uima.cas.impl.CASImpl@2006673c (CIF cz.brmlab.yodaqa.flow.asb.MultiThreadASB$CasInFlow@749aa36f)

ALERT: pool-2-thread-1 seems stuck for more than 300s waiting for a job delivery.
Thread[pool-2-thread-1,5,main] - Future java.util.concurrent.FutureTask@4d50917f done false canc false :: AE cz.brmlab.yodaqa.analysis.question.CluesToConcepts from CAS org.apache.uima.cas.impl.CASImpl@2006673c (CIF cz.brmlab.yodaqa.flow.asb.MultiThreadASB$CasInFlow@521a63df)

java.net.ConnectException: Connection timed out (Connection timed out)
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at java.net.Socket.connect(Socket.java:538)
at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:463)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:558)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:242)
at sun.net.www.http.HttpClient.New(HttpClient.java:339)
at sun.net.www.http.HttpClient.New(HttpClient.java:357)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1202)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1138)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1032)
at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:966)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1546)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1474)
at cz.brmlab.yodaqa.provider.rdf.DBpediaTitles.queryFuzzyLookup(DBpediaTitles.java:256)
at cz.brmlab.yodaqa.provider.rdf.DBpediaTitles.query(DBpediaTitles.java:102)
at cz.brmlab.yodaqa.analysis.question.CluesToConcepts.process(CluesToConcepts.java:104)
at org.apache.uima.analysis_component.JCasAnnotator_ImplBase.process(JCasAnnotator_ImplBase.java:48)
at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.callAnalysisComponentProcess(PrimitiveAnalysisEngine_impl.java:385)
at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.processAndOutputNewCASes(PrimitiveAnalysisEngine_impl.java:309)
at cz.brmlab.yodaqa.flow.asb.MultiprocessingAnalysisEngine_MultiplierOk.processAndOutputNewCASes(MultiprocessingAnalysisEngine_MultiplierOk.java:218)
at cz.brmlab.yodaqa.flow.asb.MultiThreadASB$AggregateCasIterator$1.call(MultiThreadASB.java:772)
at cz.brmlab.yodaqa.flow.asb.MultiThreadASB$AggregateCasIterator$1.call(MultiThreadASB.java:754)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
*** http://yodaqa.felk.cvut.cz/dbp-labels1 or http://yodaqa.felk.cvut.cz/dbp-labels2 label lookup query (temporarily?) failed, retrying in a moment...

这里应该是问题所在:https://github.com/brmson/yodaqa/issues/81
然而删掉了那两个label的url之后还是出错,再删掉solr那一行和前面的逗号之后,还是同样的错:

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
INFO CoreContainer - Loading CoreContainer using Solr Home: 'collection1/'
INFO SolrResourceLoader - new SolrResourceLoader for directory: 'collection1/'
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/lucene/index/FilterIndexReader
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.apache.solr.core.CoreContainer.load(CoreContainer.java:265)
at org.apache.solr.core.CoreContainer$Initializer.initialize(CoreContainer.java:165)
at cz.brmlab.yodaqa.provider.solr.Solr.createEmbeddedSolrServer(Solr.java:70)
at cz.brmlab.yodaqa.provider.solr.Solr.<init>(Solr.java:51)
at cz.brmlab.yodaqa.provider.solr.SolrNamedSource.register(SolrNamedSource.java:18)
at cz.brmlab.yodaqa.pipeline.YodaQA.<clinit>(YodaQA.java:59)
at cz.brmlab.yodaqa.YodaQA_Web.main(YodaQA_Web.java:37)
Caused by: java.lang.ClassNotFoundException: org.apache.lucene.index.FilterIndexReader
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 19 more

弃了。。。

1.6 QA-基于LSTM的中文问答系统

https://github.com/S-H-Y-GitHub/QA

数据集下载地址:
https://pan.baidu.com/s/1FzkR0Q9RrKzj4pa2uD1BYw#list/path=%2F%E6%95%B0%E6%8D%AE%2FQA&parentPath=%2F%E6%95%B0%E6%8D%AE

放好了数据之后,直接运行的话运行时会报错,打印一大堆数字,解决方法:
https://github.com/S-H-Y-GitHub/QA/issues/27

把wiki 詞向量的第一行兩個數字刪掉,然後不要保留空行

这个东西运行要跑很久,需要训练

训练完也没什么用,不能提问,只生成了一个评分文件,对测试集里的数据进行了评分。

1.7 OpenQA

http://openqa.aksw.org

源码:https://bitbucket.org/emarx/openqa

openQA is a framework and platform for Question Answering development and publication.

  • 文档不太详细,没法直接跑一个直观问答的例子
  • 源码体积很大,1.22G

1.99 对比结果

这个阶段只能做这么初步的考量了……

- 可运行 能正常问答
DrQA
QuestionAnsweringSystem
OpenEphyra
Watsonsim
YodaQA
QA
OpenQA ? ?

2 开源NLP工具

2.1 LTP

http://ltp.ai/docs/index.html

LTP提供了一系列中文自然语言处理工具,用户可以使用这些工具对于中文文本进行分词、词性标注、句法分析等等工作。从应用角度来看,LTP为用户提供了下列组件:

  • 针对单一自然语言处理任务,生成统计机器学习模型的工具
  • 针对单一自然语言处理任务,调用模型进行分析的编程接口
  • 使用流水线方式将各个分析工具结合起来,形成一套统一的中文自然语言处理系统
  • 系统可调用的,用于中文语言处理的模型文件
  • 针对单一自然语言处理任务,基于云端的编程接口

如果你的公司需要一套高性能的中文语言分析工具以处理海量的文本,或者你的在研究工作建立在一系列底层中文自然语言处理任务之上,或者你想将自己的科研成果与前沿先进工作进行对比,LTP都可能是你的选择。

这个工具的协议需要注意一下,商用需要付费。

2.2 HanLP

http://www.hankcs.com/nlp/hanlp.html
GitHub: https://github.com/hankcs/HanLP

HanLP是一系列模型与算法组成的NLP工具包,由大快搜索主导并完全开源,目标是普及自然语言处理在生产环境中的应用。HanLP具备功能完善、性能高效、架构清晰、语料时新、可自定义的特点。

HanLP提供下列功能:

2.3 THUCTC

THUCTC: 一个高效的中文文本分类工具包

THUCTC(THU Chinese Text Classification)是由清华大学自然语言处理实验室推出的中文文本分类工具包,能够自动高效地实现用户自定义的文本分类语料的训练、评测、分类功能。

2.4 Deeplearning4j (DL4J)

https://deeplearning4j.org/cn/

DeepLearning4J(DL4J)是一套基于Java语言的神经网络工具包,可以构建、定型和部署神经网络。DL4J与Hadoop和Spark集成,支持分布式CPU和GPU,为商业环境(而非研究工具目的)所设计。Skymind是DL4J的商业支持机构。

Deeplearning4j包括了分布式、多线程的深度学习框架,以及普通的单线程深度学习框架。定型过程以集群进行,也就是说,Deeplearning4j可以快速处理大量数据。神经网络可通过[迭代化简]平行定型,与 Java、 Scala 和 Clojure 均兼容。Deeplearning4j在开放堆栈中作为模块组件的功能,使之成为首个为微服务架构打造的深度学习框架。

GitHub:https://github.com/deeplearning4j/deeplearning4j

其他参考