未验证 提交 d4e84f9b 编写于 作者: H Hui Zhang 提交者: GitHub

fix doc link and enhance install (#570)

* fix doc link

* fix install

* fix install doc

* fix typo

* fix lm doc
上级 e0a87a5a
...@@ -9,7 +9,7 @@ abort(){ ...@@ -9,7 +9,7 @@ abort(){
unittest(){ unittest(){
cd $1 > /dev/null cd $1 > /dev/null
if [ -f "setup.sh" ]; then if [ -f "setup.sh" ]; then
sh setup.sh bash setup.sh
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
fi fi
if [ $? != 0 ]; then if [ $? != 0 ]; then
......
...@@ -18,30 +18,16 @@ ...@@ -18,30 +18,16 @@
* python>=3.7 * python>=3.7
* paddlepaddle>=2.0.0 * paddlepaddle>=2.0.0
- Run the setup script for the remaining dependencies Please see [install](docs/install.md).
```bash
git clone https://github.com/PaddlePaddle/DeepSpeech.git
cd DeepSpeech
pushd tools; make; popd
source tools/venv/bin/activate
bash setup.sh
```
- Source venv before do experiment.
```bash
source tools/venv/bin/activate
```
## Getting Started ## Getting Started
Please see [Getting Started](docs/geting_started.md) and [tiny egs](examples/tiny/README.md). Please see [Getting Started](docs/getting_started.md) and [tiny egs](examples/tiny/README.md).
## More Information ## More Information
* [Install](docs/install.md) * [Install](docs/install.md)
* [Getting Started](docs/geting_stared.md) * [Getting Started](docs/getting_started.md)
* [Data Prepration](docs/data_preparation.md) * [Data Prepration](docs/data_preparation.md)
* [Data Augmentation](docs/augmentation.md) * [Data Augmentation](docs/augmentation.md)
* [Ngram LM](docs/ngram_lm.md) * [Ngram LM](docs/ngram_lm.md)
......
...@@ -14,33 +14,20 @@ ...@@ -14,33 +14,20 @@
* [Baidu's Deep Speech2](http://proceedings.mlr.press/v48/amodei16.pdf) * [Baidu's Deep Speech2](http://proceedings.mlr.press/v48/amodei16.pdf)
## 安装 ## 安装
* python>=3.7 * python>=3.7
* paddlepaddle>=2.0.0 * paddlepaddle>=2.0.0
- 安装依赖 参看 [安装](docs/install.md)
```bash
git clone https://github.com/PaddlePaddle/DeepSpeech.git
cd DeepSpeech
pushd tools; make; popd
source tools/venv/bin/activate
bash setup.sh
```
- 开始实验前要source环境.
```bash
source tools/venv/bin/activate
```
## 开始 ## 开始
请查看 [Getting Started](docs/geting_started.md)[tiny egs](examples/tiny/README.md) 请查看 [Getting Started](docs/getting_started.md)[tiny egs](examples/tiny/README.md)
## 更多信息 ## 更多信息
* [安装](docs/install.md) * [安装](docs/install.md)
* [开始](docs/geting_stared.md) * [开始](docs/getting_started.md)
* [数据处理](docs/data_preparation.md) * [数据处理](docs/data_preparation.md)
* [数据增强](docs/augmentation.md) * [数据增强](docs/augmentation.md)
* [语言模型](docs/ngram_lm.md) * [语言模型](docs/ngram_lm.md)
......
# Prepare Language Model # Prepare Language Model
A language model is required to improve the decoder's performance. We have prepared two language models (with lossy compression) for users to download and try. One is for English and the other is for Mandarin. Users can simply run this to download the preprared language models: A language model is required to improve the decoder's performance. We have prepared two language models (with lossy compression) for users to download and try. One is for English and the other is for Mandarin. The bash script to download LM is example's `local/download_lm_*.sh`.
For example, users can simply run this to download the preprared mandarin language models:
```bash ```bash
cd examples/aishell cd examples/aishell
...@@ -8,7 +10,9 @@ source path.sh ...@@ -8,7 +10,9 @@ source path.sh
bash local/download_lm_ch.sh bash local/download_lm_ch.sh
``` ```
If you wish to train your own better language model, please refer to [KenLM](https://github.com/kpu/kenlm) for tutorials. Here we provide some tips to show how we preparing our English and Mandarin language models. You can take it as a reference when you train your own. If you wish to train your own better language model, please refer to [KenLM](https://github.com/kpu/kenlm) for tutorials.
Here we provide some tips to show how we preparing our English and Mandarin language models.
You can take it as a reference when you train your own.
## English LM ## English LM
......
#! /usr/bin/env bash #! /usr/bin/env bash
source utils/log.sh
SUDO='sudo' SUDO='sudo'
if [ $(id -u) -eq 0 ]; then if [ $(id -u) -eq 0 ]; then
SUDO='' SUDO=''
fi fi
if [ -e /etc/lsb-release ];then if [ -e /etc/lsb-release ]; then
${SUDO} apt-get install -y pkg-config libflac-dev libogg-dev libvorbis-dev libboost-dev swig python3-dev ${SUDO} apt-get install -y pkg-config libflac-dev libogg-dev libvorbis-dev libboost-dev swig python3-dev
else
error_msg "Please using Ubuntu or install `pkg-config libflac-dev libogg-dev libvorbis-dev libboost-dev swig python3-dev` by user."
exit -1
fi fi
# install python dependencies # install python dependencies
...@@ -14,17 +20,17 @@ if [ -f "requirements.txt" ]; then ...@@ -14,17 +20,17 @@ if [ -f "requirements.txt" ]; then
pip3 install -r requirements.txt pip3 install -r requirements.txt
fi fi
if [ $? != 0 ]; then if [ $? != 0 ]; then
echo "Install python dependencies failed !!!" error_msg "Install python dependencies failed !!!"
exit 1 exit 1
fi fi
# install package libsndfile # install package libsndfile
python3 -c "import soundfile" python3 -c "import soundfile"
if [ $? != 0 ]; then if [ $? != 0 ]; then
echo "Install package libsndfile into default system path." info_msg "Install package libsndfile into default system path."
wget "http://www.mega-nerd.com/libsndfile/files/libsndfile-1.0.28.tar.gz" wget "http://www.mega-nerd.com/libsndfile/files/libsndfile-1.0.28.tar.gz"
if [ $? != 0 ]; then if [ $? != 0 ]; then
echo "Download libsndfile-1.0.28.tar.gz failed !!!" error_msg "Download libsndfile-1.0.28.tar.gz failed !!!"
exit 1 exit 1
fi fi
tar -zxvf libsndfile-1.0.28.tar.gz tar -zxvf libsndfile-1.0.28.tar.gz
...@@ -42,6 +48,10 @@ if [ $? != 0 ]; then ...@@ -42,6 +48,10 @@ if [ $? != 0 ]; then
sh setup.sh sh setup.sh
cd - > /dev/null cd - > /dev/null
fi fi
python3 -c "import pkg_resources; pkg_resources.require(\"swig_decoders==1.1\")"
if [ $? != 0 ]; then
error_msg "Please check why decoder install error!"
exit -1
fi
info_msg "Install all dependencies successfully."
echo "Install all dependencies successfully."
_HDR_FMT="%.23s %s[%s]: "
_ERR_MSG_FMT="ERROR: ${_HDR_FMT}%s\n"
_INFO_MSG_FMT="INFO: ${_HDR_FMT}%s\n"
error_msg() {
printf "$_ERR_MSG_FMT" $(date +%F.%T.%N) ${BASH_SOURCE[1]##*/} ${BASH_LINENO[0]} "${@}"
}
info_msg() {
printf "$_INFO_MSG_FMT" $(date +%F.%T.%N) ${BASH_SOURCE[1]##*/} ${BASH_LINENO[0]} "${@}"
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册