fix doc link and enhance install (#570)

* fix doc link

* fix install

* fix install doc

* fix typo

* fix lm doc
pull/573/head
Hui Zhang 4 years ago committed by GitHub
parent e0a87a5ab1
commit d4e84f9b9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -9,7 +9,7 @@ abort(){
unittest(){
cd $1 > /dev/null
if [ -f "setup.sh" ]; then
sh setup.sh
bash setup.sh
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
fi
if [ $? != 0 ]; then

@ -18,30 +18,16 @@
* python>=3.7
* paddlepaddle>=2.0.0
- Run the setup script for the remaining dependencies
```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
```
Please see [install](docs/install.md).
## 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
* [Install](docs/install.md)
* [Getting Started](docs/geting_stared.md)
* [Getting Started](docs/getting_started.md)
* [Data Prepration](docs/data_preparation.md)
* [Data Augmentation](docs/augmentation.md)
* [Ngram LM](docs/ngram_lm.md)

@ -14,33 +14,20 @@
* [Baidu's Deep Speech2](http://proceedings.mlr.press/v48/amodei16.pdf)
## 安装
* python>=3.7
* paddlepaddle>=2.0.0
- 安装依赖
```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
```
参看 [安装](docs/install.md)。
## 开始
请查看 [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/geting_stared.md)
* [开始](docs/getting_started.md)
* [数据处理](docs/data_preparation.md)
* [数据增强](docs/augmentation.md)
* [语言模型](docs/ngram_lm.md)

@ -1,6 +1,8 @@
# 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
cd examples/aishell
@ -8,7 +10,9 @@ source path.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

@ -1,12 +1,18 @@
#! /usr/bin/env bash
source utils/log.sh
SUDO='sudo'
if [ $(id -u) -eq 0 ]; then
SUDO=''
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
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
# install python dependencies
@ -14,17 +20,17 @@ if [ -f "requirements.txt" ]; then
pip3 install -r requirements.txt
fi
if [ $? != 0 ]; then
echo "Install python dependencies failed !!!"
error_msg "Install python dependencies failed !!!"
exit 1
fi
# install package libsndfile
python3 -c "import soundfile"
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"
if [ $? != 0 ]; then
echo "Download libsndfile-1.0.28.tar.gz failed !!!"
error_msg "Download libsndfile-1.0.28.tar.gz failed !!!"
exit 1
fi
tar -zxvf libsndfile-1.0.28.tar.gz
@ -42,6 +48,10 @@ if [ $? != 0 ]; then
sh setup.sh
cd - > /dev/null
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
echo "Install all dependencies successfully."
info_msg "Install all dependencies successfully."

@ -0,0 +1,11 @@
_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]} "${@}"
}
Loading…
Cancel
Save