Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

bifonia

bifonia picks the reading of a European-Portuguese heterophonic homograph from its sentence. These are words spelled the same way whose pronunciation depends on meaning, such as sede (thirst ˈsedɨ or headquarters ˈsɛdɨ). It returns the meaning, the IPA, or the sentence with a disambiguating diacritic, for text-to-speech front ends. Its one runtime dependency is linguatag, for language tags.

Try it in your browser: TigreGotico/bifonia on Hugging Face.

Install

uv pip install --prerelease=allow bifonia

Quickstart

from bifonia import tokenize, guess_sense, disambiguate

words = tokenize("Tinha tanta sede que bebi a garrafa toda.")
i = words.index("sede")
print(guess_sense(words, i))     # thirst
print(disambiguate(words, i))    # ˈsedɨ

words = tokenize("A sede da empresa fica em Lisboa.")
i = words.index("sede")
print(disambiguate(words, i))    # ˈsɛdɨ

Documentation

Page Contents
docs/usage.md the full API, the scoring signals and word coverage
docs/methodology.md the two engines, the architecture and the corpus build
docs/benchmarks.md accuracy of every approach, and which numbers a command reproduces
docs/data_quality.md how the corpus labels are checked
docs/dataset.md the corpus schema, counts, splits and Hub datasets
docs/diacritics_restoration.md the task framed as diacritics restoration
docs/context_free_marks.md marks that need no context, such as pêra
docs/lects.md Brazilian, Uruguayan, African and Asian Portuguese
docs/word_references.md the IPA, senses and diacritized forms of each word

docs/index.md gives the reading order and the related projects. examples/ holds runnable scripts. AGENTS.md gives the repository map and the test command.

License

Apache-2.0. See LICENSE.

Metadata

Release files for bifonia 0.7.1a4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bifonia 0.7.1a4
File Size Uploaded Provenance Actions
bifonia-0.7.1a4.tar.gz 5.5 MB Without provenance Details for bifonia-0.7.1a4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bifonia 0.7.1a4
File Interpreter ABI Platform Actions
bifonia-0.7.1a4-py3-none-any.whl Python 3 none any Details for bifonia-0.7.1a4-py3-none-any.whl

Total release size: 11.1 MB

Release files / bifonia-0.7.1a4.tar.gz

Download URL bifonia-0.7.1a4.tar.gz
Size 5.5 MB
Tags Source
SHA-256 checksum
How to use checksums
c79e353821b55881833549de16c04ceaa6696c65ce3629a1b878ce0be1e13d7a
BLAKE2b-256 checksum
How to use checksums
4a7d191d2807b9836dfbedac5d7132c651e3296167aafa2e3c398f8d948b5925
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / bifonia-0.7.1a4-py3-none-any.whl

Download URL bifonia-0.7.1a4-py3-none-any.whl
Size 5.6 MB
Tags Python 3
SHA-256 checksum
How to use checksums
5b8c6844b8c600b83e4f33ba495b03206bbb4215117d3003b34b7b2d47c2bc09
BLAKE2b-256 checksum
How to use checksums
66a3d95fc10f9bcbbc18d1f2ae8322ed44289719747b3b2612d9f5a9c45dcd77
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for bifonia 0.7.1a4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page