omi icon indicating copy to clipboard operation
omi copied to clipboard

Portuguese word "um" not transcribed in multi-language mode

Open omi-discord-vector[bot] opened this issue 7 months ago • 3 comments

Problem

Portuguese word "um" (article "a/an" and number "one") is completely missing from transcriptions when multi-language mode is enabled.

Works: Portuguese-only mode → "um menino" transcribes correctly
Broken: Multi-language mode → "um menino" becomes "menino" (missing "um")

Root Cause

backend/utils/stt/streaming.py line 352:

filler_words=False,

When filler_words=False, Deepgram removes English filler words "uh" and "um" from transcripts. In multi-language mode, Portuguese "um" is misdetected as English filler "um" and gets stripped out.

Fix

Change line 352 to:

filler_words=(language == "multi"),

This enables filler words in multi-language mode (keeping Portuguese "um") while maintaining current behavior for single-language mode.

File: backend/utils/stt/streaming.py
Line: 352
Change: filler_words=False, → filler_words=(language == "multi"),

Impact Examples

Input Expected Multi-language Result (broken)
"um menino" "um menino" (a boy) "menino" (boy) ❌
"um, dois, três" "um, dois, três" (1, 2, 3) "dois, três" (2, 3) ❌
"comprei um carro" "comprei um carro" "comprei carro" ❌

Technical Details

  • Affects: Portuguese (pt-BR) in multi-language mode
  • Deepgram doc: https://developers.deepgram.com/docs/filler-words
  • Custom vocabulary doesn't help (removal happens before keyword processing)
  • One-line fix, zero risk

Priority

High - Breaks basic Portuguese grammar. "Um" is one of the most common words in Portuguese.

omi-discord-vector[bot] avatar Apr 03 '26 12:04 omi-discord-vector[bot]

Root Cause Found

The problem is in the Deepgram filler_words parameter.

Code Location

backend/utils/stt/streaming.py line 352:

filler_words=False,

What's Happening

According to Deepgram documentation:

When filler_words=false or the parameter is not set, the two most common fillers, "uh" and "um", are stripped out of the transcript to improve readability.

The issue:

  1. Single-language mode (pt-BR) → Deepgram uses Portuguese-specific model → "um" is recognized as a Portuguese word, not filtered
  2. Multi-language mode (language=multi) → Deepgram auto-detects languages → "um" sounds like English filler "um" → gets stripped out automatically

This happens before custom vocabulary processing, which is why adding "um" to the dictionary doesn't help.

Fix

Option 1: Set filler_words=True globally

# backend/utils/stt/streaming.py line 352
filler_words=True,  # Keep filler words in transcript

Pros: Simple fix, one line change
Cons: Will include English "um/uh" in all transcripts (may reduce readability for English users)


Option 2: Set filler_words=True only for multi-language mode

# backend/utils/stt/streaming.py
filler_words=(language == "multi"),  # True for multi-language, False for single-language

Pros: Best of both worlds - keeps "um" for Portuguese in multi-language, removes English fillers in single-language
Cons: Slightly more complex logic


Option 3: Language-aware filler word handling

# Set filler_words based on whether the user's main language has words that sound like English fillers
LANGUAGES_WITH_UM_WORDS = {"pt", "pt-BR", "pt-PT"}  # Portuguese "um" (a/an, one)
user_language = get_user_language_preference(uid)
filler_words = (language == "multi" and user_language in LANGUAGES_WITH_UM_WORDS)

Pros: Surgical fix - only enables for languages that need it
Cons: Requires maintaining a list of affected languages


Recommended Fix

Option 2 is the best balance:

filler_words=(language == "multi"),

This preserves current behavior for single-language users while fixing Portuguese (and any other language with "um"-sounding words) in multi-language mode.

Testing

After fix, verify:

  • Portuguese single-language: "um" still works ✓
  • Portuguese multi-language: "um" now appears ✓
  • English single-language: "um/uh" still filtered ✓
  • English multi-language: "um/uh" now appear (acceptable tradeoff for verbatim transcription)

omi-discord-vector[bot] avatar Apr 03 '26 12:04 omi-discord-vector[bot]

@mdmohsin7 @beastoin any suggestions to help me get complete transcription? I wouldn't mind having a few filler words to get perfect Brazilian Portuguese transcription

hugoaap-code avatar Apr 03 '26 12:04 hugoaap-code

Portuguese filler words — confirmed: streaming.py has should_preserve_filler_words() handling.

undivisible avatar Jul 20 '26 08:07 undivisible