Wende
Wende(问得) Chinese Question Answering, is a small and simple factoid chinese question answering system written in Python. You ask a chinese natural language question and Wende will try to give a certain answer of the question. This is still a work in progress, currently the system can only judge the type of the question that the user ask, which means, only the question classification module has been implemented.
Run on Windows
Your PC should be 64-bit and at least has 4G RAM!
-
安装 Anaconda。Anaconda 是一个集成的 Python 科学计算环境,可以免去在 Windows 下安装诸如 numpy、scipy 等科学计算类库的烦恼与痛苦。请选择 Python2.7 64-bit 的版本进行安装,安装过程全部默认。
-
安装 Microsoft Visual C++ Compiler for Python 2.7, 由于需要编译安装 pyltp,所以需要安装编译器 VC for Python
-
安装 Git-Bash,安装过程全部默认。然后打开 Git-Bash, 本地新建一个目录并克隆本仓库的源码
$ mkdir -p /c/workspace && cd /c/workspace $ git clone https://github.com/h404bi/wende $ cd wende/ $ git submodule update --init --recursive
稍等片刻克隆完毕后,可以在 Git-Bash 下看看刚才安装的 Anaconda 是否能正常使用。
$ conda -V $ winpty python --version $ conda list
-
配置项目依赖环境
接着上面的 Git-Bash 窗口,安装项目依赖。先更新 conda 自带的类库
$ conda update --all --yes
然后安装 requirements.txt 中的依赖
$ conda install --file requirements_conda.txt --yes $ pip install -r requirements_pip.txt
之后编译安装 pyltp
$ cd pyltp/ && winpty python setup.py install
查看 conda 已安装的类库
$ cd .. && conda list
-
下载相关模型(LTP/Wende/Word2Vec)
LTP(哈工大语言技术平台):原地址,选择模型版本 3.3.0
Wende & Word2Vec:百度云(密码: 1dbm),其中也可以自行训练 Wende 的模型,具体请见wende/classification/model.py
文件 所有模型文件请放到data/models/
下对应的目录 -
测试与运行
直接运行 Web App$ winpty python -m app
Ctrl+C 退出
运行分类器评估测试
$ winpty python -m evaluation.evaluate_models
运行特征提取评估测试
$ winpty python -m evaluation.evaluate_features
Run on Linux / Mac
Coming soon...
License
Code: MIT. Copyright (c) 2016 by Chawye Hsu
Data: CC BY-NC-SA 4.0, except for the ltp model use its original license.
这只是我的学士学位毕业设计项目(This is just the graduation project of my bachelor's degree)