uttrflow / uttrflow/uttrflow-swift

Uploading a built-in Hinglish passage changes its catalogue language classification to Hindi

Open
#825 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
4
Forks
17
Avg merge
3h 32m
Merged PRs (30d)
277

Description

## Problem

`CorpusUploadOutbox.sample(for:slug:bytes:)` sets a Hinglish recording's language tag to `hi-IN` but forwards only `passage.stresses`. Built-in Hinglish passages do not carry the `code-switching` stress marker. On the reading side, `CorpusSample.spokenLanguage` classifies `hi-IN` as Hindi unless that marker exists.

As a result, a recorded Hinglish passage becomes Hindi when uploaded metadata is read through the catalogue path. The outbox's comment says the stress marks Hinglish, but the implementation never adds it.

## Verified evidence

Main `5c310667cd35c44abd8bbd26c19b0905471287b4`, unchanged production types with a real temporary recording store and a simulated uploader:

- Use the existing `TranscriptionCorpus.passage("hinglish-standup")`.
- Save a synthetic recording and pass it to `CorpusUploadOutbox.send`.
- Inspect the uploaded `CorpusSample` through its production `passage` mapping.

Actual: `before=hinglish after=hindi stresses=["everyday"]`. The expectation that the uploaded sample remains Hinglish fails. The existing 14 outbox tests pass; the language-tag test checks the storage key contains `hi-IN`, not the round-trip language classification.

This verifies metadata transformation, not live service behavior or speech accuracy. `TranscribeCorpus.recorded(_:)` consumes `sample.passage`, so the catalogue evaluation path uses the changed classification.

## Impact and acceptance criteria

Hinglish recordings uploaded by this tool are counted in the Hindi accuracy slice when evaluated from the catalogue. That distorts language breakdowns and the baseline gate's per-language checks.

- Preserve the original Hinglish classification in uploaded metadata using the catalogue's `code-switching` marker, without discarding the passage's other stresses.
- Add round-trip tests for English, Hindi and Hinglish, including an already-present marker to prevent duplicates.
- Assess existing uploaded records produced by this path and document how operators can correct their metadata.

Relevant code: `Sources/UttrflowEval/CorpusUploadOutbox.swift` (`sample`, `tag`), `Sources/UttrflowEval/CorpusSample.swift` (`spokenLanguage`, `passage`), and `Sources/UttrflowEval/TranscriptionCorpus.swift` (built-in Hinglish passages).

Contributor guide

Open the contributing guide

Research direction

Start with Sources/UttrflowEval/CorpusUploadOutbox.swift, especially sample and tag, then trace spokenLanguage and passage in CorpusSample.swift and the built-in passages in TranscriptionCorpus.swift. Run the existing outbox tests and add round-trip coverage for English, Hindi, Hinglish, and an existing code-switching marker. Done means Hinglish classification and other stresses are preserved, with guidance for correcting affected records.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
data, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.