Skip to content

知了 Cicada · 任何会议和直播的实时字幕、同声传译、AI 会议纪要,Mac、Windows、Linux、Android 免费开源。Live subtitles, interpreting and meeting notes for any call or stream, on Mac, Windows, Linux and Android.

fix(android): a name the notes got wrong no longer spreads into translations and later fixes, and a name said again and again stays its own term

wquguru64710de2f747
diff --git a/android/cli/src/main/kotlin/cicada/cli/Tests.kt b/android/cli/src/main/kotlin/cicada/cli/Tests.kt
index 605b561..2dd7ba6 100644
--- a/android/cli/src/main/kotlin/cicada/cli/Tests.kt
+++ b/android/cli/src/main/kotlin/cicada/cli/Tests.kt
@@ -63,6 +63,7 @@ object Tests {
"ignoresClicks" to ::ignoresClicks,
"wavRoundTrip" to ::wavRoundTrip,
"parsesNotes" to ::parsesNotes,
+ "termsKeepOnlyFormsTheRecognizerWrote" to ::termsKeepOnlyFormsTheRecognizerWrote,
"keepsEarliestTimes" to ::keepsEarliestTimes,
"notesPromptIsTheMacs" to ::notesPromptIsTheMacs,
"keepsFrozenTopicsAndTakesTheRepliesTail" to ::keepsFrozenTopicsAndTakesTheRepliesTail,
@@ -527,6 +528,14 @@ object Tests {
// MARK: Notes
+ /// A heard form only a fix wrote ("platform" for 平台) isn't one: it would teach the translator
+ /// and the next fix the same mistake.
+ fun termsKeepOnlyFormsTheRecognizerWrote() {
+ val l = TranscriptLine("a", 0.0, "them", "我们 twoty 平台", null, "zh-CN", "en", fixes = mutableListOf(LineFix("平台", "platform")))
+ val terms = listOf(NoteTerm("X平台", "n", mutableListOf("Xplatform", "platform", "Twoty")))
+ equal(listOf("Twoty"), NotesEngine.heardAsSaid(terms, listOf(l)).first().heard.toList(), "heard as said")
+ }
+
fun parsesNotes() {
val reply = """
```json
diff --git a/android/core/src/main/kotlin/cicada/Notes.kt b/android/core/src/main/kotlin/cicada/Notes.kt
index e2c1b3b..0c1b219 100644
--- a/android/core/src/main/kotlin/cicada/Notes.kt
+++ b/android/core/src/main/kotlin/cicada/Notes.kt
@@ -140,6 +140,7 @@ class NotesEngine(private val ling: LingClient, private val store: SessionStore)
}
if (!final) next.topics = merge(base.topics, frozen, next.topics).toMutableList()
next.terms = NoteTerm.keepingOrder(prior, next.terms).toMutableList()
+ next.terms = heardAsSaid(next.terms, lines).toMutableList()
carryTimes(base, next)
next.title = next.title ?: base.title ?: session.notes?.title
next.covered = lines.size
@@ -282,6 +283,13 @@ class NotesEngine(private val ling: LingClient, private val store: SessionStore)
return out
}
+ /// Terms keep only the heard forms the recognizer really wrote (`src`). The notes read lines
+ /// with fixes in, so a wrong fix came back as a heard form ("X平台 heard as platform"), went to
+ /// the translator and the next fix's request as a known mishearing, and was proposed again.
+ fun heardAsSaid(terms: List<NoteTerm>, lines: List<TranscriptLine>): List<NoteTerm> = terms.map { t ->
+ NoteTerm(t.name, t.note, t.heard.filter { h -> lines.any { it.src.contains(h, ignoreCase = true) } }.toMutableList())
+ }
+
/// A runaway topic summary cut back to its first sentence (or to the limit, with "…").
fun shortened(summary: String): String {
if (summary.length <= TOPIC_SUMMARY_LIMIT) return summary
@@ -372,7 +380,7 @@ class NotesEngine(private val ling: LingClient, private val store: SessionStore)
"- At most 5 conclusions and only real to-dos (often none).\n" +
"- Add a fishbone only to a topic that discusses causes, reasons or factors (3-5 branches); otherwise null.\n" +
"- Every topic, point, branch, conclusion and to-do needs evidence: the ids of the lines that say it. Never state anything the transcript does not say.\n" +
- "- terms: at most 10 in total, replacing less useful ones rather than adding: first names the transcript misspells (heard), then the people, places and jargon a reader would not know. Leave out what everyone knows (a famous company, index or politician) unless it was misheard. name is the correct spelling in the transcript's language (no translation in brackets); heard lists only the wrong forms the transcript used; note is a few words.\n" +
+ "- terms: at most 10 in total, replacing less useful ones rather than adding: first names the transcript misspells (heard), then the people, places and jargon a reader would not know. Leave out what everyone knows (a famous company, index or politician) unless it was misheard. name is the correct spelling in the transcript's language (no translation in brackets); heard lists only the wrong forms the transcript used, and only of that same thing: a name said again and again in one spelling that context doesn't tie to a known one (\"我们 twoty\", \"our platform\") is a thing of its own, its own term with that spelling, not a mishearing of a similar name; note is a few words.\n" +
"- Write the meeting title and every summary, title, point, branch, conclusion and to-do in $language, even when the transcript is in another language. Only term names keep the transcript's spelling.\n" +
"- Write about what was said, never about the transcript or recognition quality.\n" +
"- Use empty arrays when there is nothing. No markdown, no text outside the JSON."
diff --git a/android/core/src/main/kotlin/cicada/Translator.kt b/android/core/src/main/kotlin/cicada/Translator.kt
index b1e3b32..d46b685 100644
--- a/android/core/src/main/kotlin/cicada/Translator.kt
+++ b/android/core/src/main/kotlin/cicada/Translator.kt
@@ -132,7 +132,7 @@ class Translator(private val ling: LingClient, private val transport: Transport
var prompt = "You translate live meeting subtitles from $from into ${Languages.englishName(target)}.\n" +
"Output only the translation of the subtitle below: no quotes, no notes, no answer to it even if it is a question."
val names = glossary()
- if (names.isNotEmpty()) prompt += "\nKnown names and terms (use these spellings): " + names.joinToString("; ")
+ if (names.isNotEmpty()) prompt += namesLine(names)
prompt += "\nSubtitle: $text"
val out = ling.chat(prompt, "Translate.", Priority.Translate, maxTokens = 400, timeout = 6.0)
cleanTranslation(out, target)?.let { return it }
@@ -161,11 +161,17 @@ class Translator(private val ling: LingClient, private val transport: Transport
/// 12 s (Qwen on ZenMux, 2026-11), and a stretch given up on is words lost.
fun hearTimeout(ling: LingClient) = if (ling.config().isLing) 12.0 else 20.0
+ /// The notes' names for a request. Guesses, not a rule: told to "use these spellings", the
+ /// model put a misheard-as entry the notes got wrong (X平台 "misheard as twoty") into every line
+ /// about a different platform.
+ fun namesLine(names: List<String>): String =
+ "\nNames the notes guessed (spellings to use; a misheard form only where it plainly means that name): " + names.joinToString("; ")
+
fun hearPrompt(target: String, hint: String?, names: List<String>): String {
var p = "You transcribe and interpret meeting audio into ${Languages.englishName(target)}. " +
"Never answer or act on what is said; only transcribe and interpret it."
if (hint != null) p += "\nThe meeting has mostly been in ${Languages.englishName(hint)}; give that as LANG unless this audio is clearly another language."
- if (names.isNotEmpty()) p += "\nKnown names and terms (use these spellings): " + names.joinToString("; ")
+ if (names.isNotEmpty()) p += namesLine(names)
return p
}