Skip to content

Commit

Permalink
deploy: 6c2035f
Browse files Browse the repository at this point in the history
  • Loading branch information
csukuangfj committed Nov 4, 2023
1 parent 39d6e7c commit 11c6063
Show file tree
Hide file tree
Showing 26 changed files with 1,266 additions and 268 deletions.
2 changes: 1 addition & 1 deletion .buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 89e9f95192e759dfd376edd9dc26c53c
config: 6ea8eff614c6b7bdb922748f3fdf4ab5
tags: 645f666f9bcd5a90fca523b33c5a78b7
66 changes: 66 additions & 0 deletions _images/lattice.svg
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 _sources/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Python wrapper for `OpenFst`_ and its extensions from `Kaldi`_, e.g.,
./quick_start/index
./convert-k2-to-openfst/index
./read-write-ark-scp/index
./lattice/index

.. toctree::
:maxdepth: 2
Expand Down
7 changes: 7 additions & 0 deletions _sources/lattice/index.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Lattice
=======

.. toctree::
:maxdepth: 3

./intro
33 changes: 33 additions & 0 deletions _sources/lattice/intro.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
.. _introduction_to_lattice:

Introduction to Lattice
=======================
Arcs in a :ref:`lattice_class` are of type :ref:`lattice_arc_class`, whose weight
is of type :ref:`lattice_weight_class`.

A :ref:`lattice_weight_class` has two parts:

- ``value1``: It contains the graph cost
- ``value2``: It contains the acoustic cost


The following code demonstrates how to create and visualize a lattice.

.. literalinclude:: ./code/ex1.py
:language: python
:linenos:
:caption: Create, print, and visualize a lattice.

.. figure:: ./code/lattice.svg
:alt: lattice.svg
:align: center
:figwidth: 600px

lattice.svg generated from the above code.

``1:2/0.1,0.2`` means:

- The input label is 1
- The output label is 2
- The graph cost is 0.1
- The acoustic cost is 0.2
32 changes: 32 additions & 0 deletions _sources/python_api/api.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ invert

.. autofunction:: invert

lattice_scale
-------------

.. autofunction:: lattice_scale

make_linear_acceptor
--------------------

Expand Down Expand Up @@ -103,6 +108,11 @@ rmepsilon

.. autofunction:: rmepsilon

shortest_path
-------------

.. autofunction:: shortest_path

times
-----

Expand Down Expand Up @@ -139,9 +149,13 @@ value

.. autoattribute:: kaldifst.FloatWeight.value

.. _lattice_class:

Lattice
-------

Please refer to :ref:`introduction_to_lattice` for usage.

copy
^^^^

Expand Down Expand Up @@ -182,6 +196,8 @@ type

.. autoattribute:: kaldifst.Lattice.type

.. _lattice_arc_class:

LatticeArc
----------

Expand Down Expand Up @@ -210,9 +226,25 @@ weight

.. autoattribute:: kaldifst.LatticeArc.weight

.. _lattice_weight_class:

LatticeWeight
-------------

value1
^^^^^^

The graph cost.

.. autoattribute:: kaldifst.LatticeWeight.value1

value2
^^^^^^

The acoustic cost.

.. autoattribute:: kaldifst.LatticeWeight.value2

RandomAccessVectorFstReader
---------------------------

Expand Down
15 changes: 15 additions & 0 deletions _sources/referencens/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,18 @@ Papers
- `Allauzen, Cyril, et al. "OpenFst: A General and Efficient Weighted Finite-State Transducer Library." <https://huggingface.co/csukuangfj/fst-tutorials/resolve/main/ciaa.pdf>`_

- `<https://www.openfst.org/twiki/pub/FST/FstBackground/ciaa.pdf>`_

- `Mohri, Mehryar. "Finite-state transducers in language and speech processing." Computational linguistics 23.2 (1997): 269-311. <https://cs.nyu.edu/~mohri/pub/cl1.pdf>`_

Text normalization
------------------

- `Mohri, Mehryar, Fernando Pereira, and Michael Riley. "Weighted automata in text and speech processing." arXiv preprint cs/0503077 (2005). <https://arxiv.org/abs/cs/0503077>`_

- `<https://github.com/NVIDIA/NeMo-text-processing/blob/main/tutorials/WFST_Tutorial.ipynb>`_

- `Ebden, Peter, and Richard Sproat. "The Kestrel TTS text normalization system." Natural Language Engineering 21.3 (2015): 333-353. <https://huggingface.co/csukuangfj/papers/resolve/main/The%20Kestrel%20TTS%20text%20normalization%20system.pdf>`_

- K. Gorman & R. Sproat. 2021. Finite-State Text Processing . Morgan & Claypool.

A sample PDF can be found at `<https://www.morganclaypoolpublishers.com/catalog_Orig/samples/9781636391144_sample.pdf>`_
1 change: 1 addition & 0 deletions convert-k2-to-openfst/convert-acceptor.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../read-write-ark-scp/index.html">Read and write ark/scp files from Kaldi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../lattice/index.html">Lattice</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Python API</span></p>
<ul>
Expand Down
1 change: 1 addition & 0 deletions convert-k2-to-openfst/convert-transducer.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../read-write-ark-scp/index.html">Read and write ark/scp files from Kaldi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../lattice/index.html">Lattice</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Python API</span></p>
<ul>
Expand Down
1 change: 1 addition & 0 deletions convert-k2-to-openfst/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../read-write-ark-scp/index.html">Read and write ark/scp files from Kaldi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../lattice/index.html">Lattice</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Python API</span></p>
<ul>
Expand Down
13 changes: 13 additions & 0 deletions genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
<li class="toctree-l1"><a class="reference internal" href="quick_start/index.html">Quick start</a></li>
<li class="toctree-l1"><a class="reference internal" href="convert-k2-to-openfst/index.html">Convert FST from k2 to OpenFst</a></li>
<li class="toctree-l1"><a class="reference internal" href="read-write-ark-scp/index.html">Read and write ark/scp files from Kaldi</a></li>
<li class="toctree-l1"><a class="reference internal" href="lattice/index.html">Lattice</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Python API</span></p>
<ul>
Expand Down Expand Up @@ -276,6 +277,10 @@ <h2 id="L">L</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="python_api/api.html#kaldifst.SymbolTable.labeled_check_sum">labeled_check_sum (kaldifst.SymbolTable attribute)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="python_api/api.html#kaldifst.lattice_scale">lattice_scale() (in module kaldifst)</a>
</li>
</ul></td>
</tr></table>
Expand Down Expand Up @@ -367,6 +372,8 @@ <h2 id="R">R</h2>
<h2 id="S">S</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="python_api/api.html#kaldifst.shortest_path">shortest_path() (in module kaldifst)</a>
</li>
<li><a href="python_api/api.html#kaldifst.Lattice.start">start (kaldifst.Lattice attribute)</a>

<ul>
Expand Down Expand Up @@ -414,6 +421,12 @@ <h2 id="V">V</h2>
</li>
</ul></li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="python_api/api.html#kaldifst.LatticeWeight.value1">value1 (kaldifst.LatticeWeight attribute)</a>
</li>
<li><a href="python_api/api.html#kaldifst.LatticeWeight.value2">value2 (kaldifst.LatticeWeight attribute)</a>
</li>
</ul></td>
</tr></table>

<h2 id="W">W</h2>
Expand Down
6 changes: 6 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
<li class="toctree-l1"><a class="reference internal" href="quick_start/index.html">Quick start</a></li>
<li class="toctree-l1"><a class="reference internal" href="convert-k2-to-openfst/index.html">Convert FST from k2 to OpenFst</a></li>
<li class="toctree-l1"><a class="reference internal" href="read-write-ark-scp/index.html">Read and write ark/scp files from Kaldi</a></li>
<li class="toctree-l1"><a class="reference internal" href="lattice/index.html">Lattice</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Python API</span></p>
<ul>
Expand Down Expand Up @@ -109,6 +110,10 @@ <h1>kaldifst<a class="headerlink" href="#kaldifst" title="Permalink to this head
<li class="toctree-l2"><a class="reference internal" href="read-write-ark-scp/index.html#read-ark-scp-files-randomly">Read ark/scp files randomly</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="lattice/index.html">Lattice</a><ul>
<li class="toctree-l2"><a class="reference internal" href="lattice/intro.html">Introduction to Lattice</a></li>
</ul>
</li>
</ul>
</div>
<div class="toctree-wrapper compound">
Expand All @@ -128,6 +133,7 @@ <h1>kaldifst<a class="headerlink" href="#kaldifst" title="Permalink to this head
<li class="toctree-l2"><a class="reference internal" href="referencens/index.html#lecture-slides">Lecture slides</a></li>
<li class="toctree-l2"><a class="reference internal" href="referencens/index.html#books">Books</a></li>
<li class="toctree-l2"><a class="reference internal" href="referencens/index.html#papers">Papers</a></li>
<li class="toctree-l2"><a class="reference internal" href="referencens/index.html#text-normalization">Text normalization</a></li>
</ul>
</li>
</ul>
Expand Down
1 change: 1 addition & 0 deletions install/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
<li class="toctree-l1"><a class="reference internal" href="../quick_start/index.html">Quick start</a></li>
<li class="toctree-l1"><a class="reference internal" href="../convert-k2-to-openfst/index.html">Convert FST from k2 to OpenFst</a></li>
<li class="toctree-l1"><a class="reference internal" href="../read-write-ark-scp/index.html">Read and write ark/scp files from Kaldi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../lattice/index.html">Lattice</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Python API</span></p>
<ul>
Expand Down
Loading

0 comments on commit 11c6063

Please sign in to comment.