semvec/pypi-packages huggingface dataset:
discophon.builder 0.0.2
Internal dataset builder for the Phoneme Discovery benchmark
Requires Python: >=3.13

# Create the data splits and the annotation files

-get the dataset audio from:[https://datacollective.mozillafoundation.org/datasets/cmflnuzw71qkz8x3kil3tgjvk]
- get the textGrid from:
  https://huggingface.co/datasets/pacscilab/VoxCommunis/tree/main/textgrids
- test languages:
-   Japanese(jp), espagnole?(es),Mandarin (zh-CN), basque(eu)
-   To-add: Germain,English, frensh
  
- dev languages:
- Turkish, ukrainian, Tamil, thai

  1) Convert to wav and reasmple audio files
  2) Prepare dataset splits based on the validate file and sets from cm
  3) Merge all the output files to have a best distribution
  4) order speaker based on speech duration
  5) split sets balanced with dev,test 2hours each and all the rest to train
  6) align files
  7) correct phones
  8) phonebase item files
  9) triphone item files
  10) clean and correct item files
  11) copy audio files for dev and test
  12) cereate  subfolders and copy audio files for train set
discophon.submission 0.0.2
Submission interface for the Phoneme Discovery benchmark
Requires Python: >=3.13

# Benchmark submission

```json
{
  "eng": {
    "units": "...",
    "n_units": 100,
    "step_units": 20
  },
  "fra": {
    "units": "...",
    "n_units": 100,
    "step_units": 20
  },
  "cmn": {
    "units": "...",
    "n_units": 100,
    "step_units": 20
  },
  "jpn": {
    "units": "...",
    "n_units": 100,
    "step_units": 20
  },
  ...
}
```

Run the evaluation:

```bash
python -m discophon.submission $SUBMISSION $ANNOTATION $OUTPUT
```
discophon.evaluate 0.0.2
Evaluation package for the Phoneme Discovery benchmark
Requires Python: >=3.13

# Evaluation

```bash
pip install discophon.evaluate
```

This package provides low-level functions to evaluate your model's predictions on phoneme discovery.

## Phoneme discovery

You can use the `phoneme_discovery` function with `units: dict[str, list[int]]`, and `phones: dict[str, list[str]]`.
You also need to set the number of units `n_units`, of phonemes `n_phones`, and the step (in ms) between consecutive
units `step_units`.

Example:

```python
from discophon.core import read_gold_annotations, read_submitted_units
from discophon.evaluate import phoneme_discovery

phones = read_gold_annotations("/path/to/alignments/dataset.align")
units = read_submitted_units("/path/to/predictions/units.jsonl")
result = phoneme_discovery(units, phones, n_units=256, n_phones=40, step_units=20)
print(result)
```

Or via the CLI:

```console
❯ python -m discophon.evaluate --help
usage: discophon.evaluate [-h] [--n-units N_UNITS] [--n-phones N_PHONES] [--step-units STEP_UNITS] units phones

Evaluate predicted units on phoneme discovery

positional arguments:
  units                 path to predicted units
  phones                path to gold alignments

options:
  -h, --help            show this help message and exit
  --n-units N_UNITS     number of units
  --n-phones N_PHONES   number of phonemes
  --step-units STEP_UNITS
                        step between units (in ms)
```

## ABX

The ABX evaluation is done separately. First, install this package with the `abx` optional dependency group:

```bash
pip install discophon.evaluate[abx]
```

Then, either run it in Python:

```python
from discophon.evaluate.abx import discrete_abx, continuous_abx

result_discrete = discrete_abx("/path/to/item/dataset.item", "/path/to/predictions/units.jsonl", frequency=50)
print("Discrete: ", result_discrete)

result_continuous = continuous_abx("/path/to/item/dataset.item", "/path/to/features", frequency=50)
print("Continuous: ", result_discrete)
```

Or via the CLI:

```console
❯ python -m discophon.evaluate.abx --help
usage: discophon.evaluate.abx [-h] --frequency FREQUENCY item root

Continuous or discrete ABX

positional arguments:
  item                  Path to the item file
  root                  Path to the JSONL with units or directory with continuous features

options:
  -h, --help            show this help message and exit
  --frequency FREQUENCY
                        Units frequency in Hz
```
temporal-text 0.1.0
Estimate how time-bound text is: 0.0 (ephemeral) to 1.0 (timeless facts)
Requires Python: >=3.9
Keywords: linguistics, machine-learning, nlp, temporality, text-analysis

# temporal-text

Estimate how time-bound text is, from ephemeral thoughts to timeless facts.

## What is Temporality?

Temporality measures how "time-bound" a piece of text is:

- **Low temporality (0.0)**: Fleeting, immediate, ephemeral
  - "I want to go to the sauna" → ~0.15
  - "Just saw the funniest thing" → ~0.10
  - "brb getting snacks" → ~0.05

- **High temporality (1.0)**: Timeless facts, universal truths
  - "Earth has one moon" → ~0.85
  - "A triangle has three sides" → ~0.85
  - "Water boils at 100 degrees Celsius" → ~0.85

## Installation

```bash
pip install temporal-text
```

## Usage

```python
from temporal_text import temporality_score

# Low temporality - fleeting desire
score = temporality_score("I want to go to the sauna")
print(score)  # ~0.15

# High temporality - scientific fact
score = temporality_score("Earth has one moon")
print(score)  # ~0.85

# Medium temporality - current situation
score = temporality_score("I'm currently learning Spanish")
print(score)  # ~0.35
```

## How It Works

The library uses a lightweight TF-IDF + Ridge Regression model trained on ~1700 labeled examples. The model learns patterns like:

**High temporality indicators**: "is a", "always", "contains", "equals", "measures"

**Low temporality indicators**: "I", "my", "feel", "just", "tomorrow", "now"

The pre-trained model (~110KB) is bundled with the package - no downloads or API calls required.

## License

MIT