Skip to main content

a Python library for managing, annotating, and converting natural language corpuses using popular formats (CoNLL, ELAN, Praat, CSV, JSON, SQLite, VTT, Audacity, TTL, TIG, ISF)

Project description

SpeachLogo Speach

ReadTheDocs Badge Total alerts Language grade: Python

Speach (🐍🍑, formerly texttaglib), is a Python 3 library for managing, annotating, and converting natural language corpuses using popular formats (CoNLL, ELAN, Praat, CSV, JSON, SQLite, VTT, Audacity, TTL, TTLIG, ISF, etc.)

Main functions are:

  • Reading, editing, and writing ELAN transcriptions and related media files directly in ELAN Annotation Format (eaf)
  • Cutting, converting, and merging audio/video files
  • TTLIG (or TIG) - A human-friendly linguistic documentation format with intelinear gloss support
  • Text corpus management using texttaglib format
  • Multiple storage formats (text, CSV, JSON, SQLite databases)

Useful Links

Installation

speach is available on PyPI.

pip install speach

Sample codes

Speach can extract annotations and metadata from ELAN transcripts directly, for example:

from speach import elan

# Test ELAN reader function in speach
eaf = elan.read_eaf('./test/data/test.eaf')

# accessing tiers & annotations
for tier in eaf:
    print(f"{tier.ID} | Participant: {tier.participant} | Type: {tier.type_ref}")
    for ann in tier:
        print(f"{ann.ID.rjust(4, ' ')}. [{ann.from_ts} :: {ann.to_ts}] {ann.text}")

Speach also provides command line tools for processing EAF files.

# this command converts an eaf file into csv
python -m speach eaf2csv input_elan_file.eaf -o output_file_name.csv

Processing media files

>>> from speach import media
>>> media.convert("~/Documents/test.wav", "~/Documents/test.ogg")
>>> media.cut("test.wav", "test_10-15.ogg", from_ts="00:00:10", to_ts="00:00:15")

Read Speach documentation for more information.

Contributors

Graphic materials

The Speach logo (SpeachLogo) was created by using the snake emoji (created by Selina Bauder) and the peach emoji (created by Marius Schnabel) from Openmoji project. License: CC BY-SA 4.0

Contributors are welcome! If you want to help developing speach, please visit Contributing page.

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

speach-0.1a15.post1.tar.gz (46.3 kB view details)

Uploaded Source

File details

Details for the file speach-0.1a15.post1.tar.gz.

File metadata

  • Download URL: speach-0.1a15.post1.tar.gz
  • Upload date:
  • Size: 46.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for speach-0.1a15.post1.tar.gz
Algorithm Hash digest
SHA256 65eae939f6982f385efd83ba6a54f2cd7adf68b4656c12835b7b51c13d93b12f
MD5 f292e1209e7146254fced8b7f66d1115
BLAKE2b-256 34915b89325ca1e10aeb2a61f26453c9a160e8aaeac5ffbffcb0d021719d352a

See more details on using hashes here.

Supported by

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