forked from bootphon/phonemizer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a github action, improved index.rst, added common_issues.rst to…
… the menu.
- Loading branch information
Showing
3 changed files
with
112 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# build the sphinx documentation and pushes it to a doc branch, then used by github pages | ||
|
||
name: Doc | ||
|
||
on: [ push, pull_request ] | ||
|
||
jobs: | ||
docs: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
max-parallel: 4 | ||
matrix: | ||
python-version: [ 3.7 ] | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install .[doc] | ||
- name: Build documentation | ||
run: | | ||
make --directory=docs html | ||
touch ./docs/build/html/.nojekyll | ||
- name: Commit documentation changes | ||
run: | | ||
git clone https://github.com/bootphon/phonemizer.git --branch doc --single-branch doc | ||
cp -r docs/build/html/* doc | ||
cd doc | ||
touch .nojekyll | ||
git config --local user.email "action@github.com" | ||
git config --local user.name "GitHub Action" | ||
git add . | ||
git commit -m "Update documentation" -a || true | ||
# The above command will fail if no changes were present, so we ignore | ||
# the return code. | ||
- name: Push changes | ||
uses: ad-m/github-push-action@master | ||
with: | ||
branch: doc | ||
directory: doc | ||
github_token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,33 @@ | ||
============== | ||
Command Issues | ||
Common Issues | ||
============== | ||
|
||
|
||
Phonemization is slow | ||
--------------------- | ||
|
||
You may have realized that large number of calls to the ``phonemize`` | ||
makes for a very slow execution. It is much more efficient to minimize the number of calls to the phonemize function. | ||
Indeed the initialization of the phonemization backend can be expensive, especially for espeak. | ||
It's much more efficient to either: | ||
|
||
- group all the calls into one using a list of strings | ||
- "manually" instantiate your backend of choice, then call its own ``phonemize`` method | ||
|
||
.. code-block:: python | ||
from phonemizer import phonemize | ||
text = [line1, line2, ...] | ||
# Do this: | ||
phonemized = phonemize(text, ...) | ||
# Not this: | ||
phonemized = [phonemize(line, ...) for line in text] | ||
# An alternative is to directly instanciate the backend and to call the | ||
# phonemize function from it: | ||
from phonemizer.backend import EspeakBackend | ||
backend = EspeakBackend('en-us', ...) | ||
phonemized = [backend.phonemize(line, ...) for line in text] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters