Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update doc to include huggingface space. #77

Merged
merged 2 commits into from
Jul 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@

**Documentation**: <https://k2-fsa.github.io/sherpa/>

Try `sherpa` from within your browser without installing anything:
<https://huggingface.co/spaces/k2-fsa/automatic-speech-recognition>

## Introduction

An ASR server framework in **Python**, supporting both streaming
Expand Down Expand Up @@ -351,4 +354,4 @@ After running the following commands:
$ pip install pre-commit
$ pre-commit install

it will run the checks whenever you run ``git commit`` **automatically**
it will run the checks whenever you run ``git commit`` **automatically**
2 changes: 2 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,5 +113,7 @@ def get_version():
.. _transducer: https://arxiv.org/pdf/1211.3711.pdf
.. _asyncio: https://docs.python.org/3/library/asyncio.html
.. _k2: https://github.com/k2-fsa/k2
.. _icefall: https://github.com/k2-fsa/icefall
.. _PyTorch: https://pytorch.org/
.. _Huggingface: https://huggingface.co
"""
63 changes: 63 additions & 0 deletions docs/source/huggingface/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
.. _try sherpa with huggingface:

Try sherpa with Huggingface
===========================

This page describes how to use `sherpa`_ for automatic speech recognition
with `Huggingface`_.

.. hint::

You don't need to download or install anything. All you need is a browser.


The server is running on CPU within a docker container provided by
`Huggingface`_ and you use a browser to interact with it. The browser
can be run on Windows, macOS, Linux, or even on your phone or iPad.

You can either upload a file for recognition or record your speech via
a microphone from within the browser and submit it for recognition.

Now let's get started.

Visit our Huggingface space
---------------------------

Start your browser and visit the following address:

`<https://huggingface.co/spaces/k2-fsa/automatic-speech-recognition>`_

and you will see a page like the following screenshot:

.. image:: ./pic/hugging-face-sherpa.png
:alt: screenshot of `<https://huggingface.co/spaces/k2-fsa/automatic-speech-recognition>`_
:target: https://huggingface.co/spaces/k2-fsa/automatic-speech-recognition

You can:

1. Select a language for recognition. Currently, we provide pre-trained models
from `icefall`_ for the following languages: ``Chinese``, ``English``, and
``Chinese+English``.
2. After selecting the target language, you can select a pre-trained model
corresponding to the language.
3. Select the decoding method. Currently, it provides ``greedy search``
and ``modified_beam_search``.
4. If you selected ``modified_beam_search``, you can choose the number of
active paths during the search.
5. Either upload a file or record your speech for recognition.
6. Click the button ``Submit for recognition``.
7. Wait for a moment and you will get the recognition results.

The following screenshot shows an example when selecting ``Chinese+English``:

.. image:: ./pic/hugging-face-sherpa-3.png
:alt: screenshot of `<https://huggingface.co/spaces/k2-fsa/automatic-speech-recognition>`_
:target: https://huggingface.co/spaces/k2-fsa/automatic-speech-recognition


In the bottom part of the page, you can find a table of examples. You can click
one of them and then click ``Submit for recognition``.

.. image:: ./pic/hugging-face-sherpa-2.png
:alt: screenshot of `<https://huggingface.co/spaces/k2-fsa/automatic-speech-recognition>`_
:target: https://huggingface.co/spaces/k2-fsa/automatic-speech-recognition
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ for both streaming ASR and offline ASR (i.e., non-streaming ASR).
:maxdepth: 2
:caption: Contents:

./huggingface/index
./installation/index
./streaming_asr/index
./offline_asr/index
Expand Down
2 changes: 1 addition & 1 deletion docs/source/streaming_asr/conv_emformer/index.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ConvEmformer transducer based streaming ASR
=======================================
===========================================

This page describes how to use `sherpa`_ for streaming
ASR with `ConvEmformer`_ transducer models
Expand Down