Skip to main content

Pipeline STT complet du francais — audio vers texte (CTC + P2G)

Project description

Lectura STT — Pipeline STT complet du francais

Pipeline de transcription automatique du francais : audio vers texte. Chaine le decodeur CTC medium (10.6M params, PER ~4.34%) avec le pipeline P2G (phones → orthographe).

WER benchmark : ~23.5% (all) / ~19.7% (parole courante).

Installation

# Mode minimal (CTC uniquement, transcription phonetique)
pip install lectura-stt

# Avec pipeline P2G complet (formules + noms propres)
pip install lectura-stt[p2g]

# Avec backend ONNX (inference locale rapide)
pip install lectura-stt[onnx]

# Avec support micro
pip install lectura-stt[micro]

Exemple

import numpy as np
from lectura_stt import creer_engine

engine = creer_engine()

# Charger un fichier WAV
import wave
with wave.open("bonjour.wav", "rb") as wf:
    sr = wf.getframerate()
    audio = np.frombuffer(
        wf.readframes(wf.getnframes()), dtype=np.int16
    ).astype(np.float32) / 32768.0

result = engine.transcrire(audio, sr=sr)
print(result.ipa)    # "b ɔ̃ ʒ u ʁ | l ə | m ɔ̃ d ."
print(result.texte)  # "Bonjour le monde."

Architecture

Pipeline optimal (avec PhoneLexicon)

Lorsqu'un PhoneLexicon est disponible (via le graphemiseur), le pipeline optimal est active automatiquement :

Audio 16kHz mono
     |
     v
[lectura-ctc]       --> IPA phones "b ɔ̃ ʒ u ʁ | l ə | m ɔ̃ d ."
     |
     v
[parse_ctc_v2]      --> segments enrichis (mots, liaisons, composes, ponctuation)
     |
     v
[strip_liaisons]    --> supprime les liaisons erronees (via lexique phonetique)
     |
     v
[split_elisions]    --> separe les clitiques elides (l'ami → l + ami)
     |
     v
[split_merged_words] --> decoupe les mots sur-segmentes
     |
     v
[P2G analyser_v2]   --> conversion IPA → orthographe avec lex_select
     |
     v
[merge_and_rescore]  --> fusionne les mots sur-segmentes (rescoring lexical)
     |
     v
[try_elision_merges] --> fusionne les clitiques elides adjacents
     |
     v
[rejoin_elisions]    --> reconstruction texte final avec apostrophes et tirets
     |
     v
"Bonjour le monde."

Pipeline simplifie (sans PhoneLexicon)

Audio 16kHz mono
     |
     v
[lectura-ctc]  --> IPA phones "b ɔ̃ ʒ u ʁ | l ə | m ɔ̃ d ."
     |
     v
[_parse_ctc]   --> mots IPA ["bɔ̃ʒuʁ", "lə", "mɔ̃d"] + ponctuation ["."]
     |
     v
[lectura-p2g]  --> ortho ["bonjour", "le", "monde"]
     |
     v
[_assembler]   --> "Bonjour le monde."

Licence

AGPL-3.0-or-later — voir LICENCE.txt. Licence commerciale disponible — voir LICENCE-COMMERCIALE.md.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lectura_stt-3.0.1.tar.gz (37.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lectura_stt-3.0.1-py3-none-any.whl (35.4 kB view details)

Uploaded Python 3

File details

Details for the file lectura_stt-3.0.1.tar.gz.

File metadata

  • Download URL: lectura_stt-3.0.1.tar.gz
  • Upload date:
  • Size: 37.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for lectura_stt-3.0.1.tar.gz
Algorithm Hash digest
SHA256 2a9f8fee45b62469d38330b6502dc1d5147660db203dcbc81f465a021548ed17
MD5 a746a75c00b2f1d07b58e01f1971978f
BLAKE2b-256 077e9a9da0ff8703c4187d75f1788c831650079edc547dcb63e862295d0a6d20

See more details on using hashes here.

File details

Details for the file lectura_stt-3.0.1-py3-none-any.whl.

File metadata

  • Download URL: lectura_stt-3.0.1-py3-none-any.whl
  • Upload date:
  • Size: 35.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for lectura_stt-3.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d8d9469c5fedd72048464fff6484fbaf1146ba2ed90f4e1a3d8f1804379d87dc
MD5 1a74a703b3100cb20f81bb0ac661e461
BLAKE2b-256 8af83583254082d7c567621441ac4bfa6eb9bb1c2fab1c3acd797963d194d741

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page