Skip to content

fix: drop the leading space on Latin sentence timestamps - #3866

Open
GPT-AGI wants to merge 1 commit into
modelscope:mainfrom
GPT-AGI:fix/timestamp-latin-leading-space
Open

GPT-AGI wants to merge 1 commit into
modelscope:mainfrom
GPT-AGI:fix/timestamp-latin-leading-space

Conversation

@GPT-AGI

@GPT-AGI GPT-AGI commented Nov 9, 2026

Copy link
Copy Markdown

Summary

Input:

timestamp_sentence("我 用 iphone pro max", punc [1, 2, 1, 1, 3])
before: ["我用,", " iphone pro max。"]
after:  ["我用,", "iphone pro max。"]

timestamp_sentence inserts a separator before each Latin token, including the
first token of a sentence. Drop that one leading separator using the same check
as timestamp_sentence_en; internal English spaces remain unchanged.

Type of change

  • Bug fix
  • Documentation
  • Example or demo
  • Runtime or deployment
  • Benchmark or evaluation
  • Model/training change

Validation

  • python -m pytest -q tests/test_timestamp_tools.py — 9 passed
  • python -m compileall -q funasr examples tests
  • Docs or links checked
  • Runtime/deployment command tested

User impact

sentence_info text no longer starts with a synthetic space when a sentence
starts with a Latin word.

Notes for reviewers

Four before/after controls covered a Latin-starting sentence, Latin text within
Chinese, all-English, and all-Chinese input. Sentence boundaries, timestamps,
punctuation, and raw_text were unchanged.

timestamp_sentence inserts a space before an English word but, unlike timestamp_sentence_en, never removes a leading space. A Chinese utterance that continues in English was stored as " iphone pro max.".

Signed-off-by: Ting Zhang <181050363+GPT-AGI@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

@LauraGPT LauraGPT left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed exact head 245ee66ac8faa3413c2d03a964c91718c93cdc15 against its original base 20f26b7c4905d010768ec91206149df2a90104b6.

  • Baseline with the new regression fails on the synthetic leading space (' iphone pro max。').
  • Exact head: 9/9 timestamp-tool tests pass, covering Latin sentence starts, mixed Chinese/Latin text, all-English/all-Chinese controls, raw text, punctuation, and boundaries.

No exact-head hosted check currently covers this PR, and main has advanced since the tested base. Leaving it open pending current-base revalidation plus hosted coverage. Scope is deterministic CPU text/timestamp postprocessing only; no model, GPU, ASR-quality, or release claim.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants