Skip to content

Fastest and only macOS Dictation app with on-device STT and custom trained AI enhancement model. Windows, iOS testflight! Android, Linux waitlist open! A local Wispr Flow alternative. Follow https://x.com/fluidvoiceapp for more

feat(parakeet): add boost strength control and rebalance defaults

altic-dev3b6826a5d854
diff --git a/Sources/Fluid/Resources/parakeet_custom_vocabulary.default.json b/Sources/Fluid/Resources/parakeet_custom_vocabulary.default.json
index 64858d5c..56dc51cd 100644
--- a/Sources/Fluid/Resources/parakeet_custom_vocabulary.default.json
+++ b/Sources/Fluid/Resources/parakeet_custom_vocabulary.default.json
@@ -1,9 +1,9 @@
{
- "alpha": 3.2,
- "minCtcScore": -2.4,
- "minSimilarity": 0.68,
- "minCombinedConfidence": 0.58,
- "minTermLength": 2,
+ "alpha": 2.8,
+ "minCtcScore": -2.2,
+ "minSimilarity": 0.72,
+ "minCombinedConfidence": 0.64,
+ "minTermLength": 3,
"terms": [
{
"text": "FluidVoice",
diff --git a/Sources/Fluid/Services/ParakeetVocabularyStore.swift b/Sources/Fluid/Services/ParakeetVocabularyStore.swift
index 1d04c8a2..9e61033d 100644
--- a/Sources/Fluid/Services/ParakeetVocabularyStore.swift
+++ b/Sources/Fluid/Services/ParakeetVocabularyStore.swift
@@ -47,11 +47,12 @@ final class ParakeetVocabularyStore {
}
private enum Defaults {
- static let alpha: Float = 3.2
- static let minCtcScore: Float = -2.4
- static let minSimilarity: Float = 0.68
- static let minCombinedConfidence: Float = 0.58
- static let minTermLength: Int = 2
+ // Balanced defaults to reduce over-biasing while still improving rare terms.
+ static let alpha: Float = 2.8
+ static let minCtcScore: Float = -2.2
+ static let minSimilarity: Float = 0.72
+ static let minCombinedConfidence: Float = 0.64
+ static let minTermLength: Int = 3
static let maxTerms: Int = 256
}
@@ -120,24 +121,16 @@ final class ParakeetVocabularyStore {
return Self.normalizeUserTerms(parsed.terms, maxTerms: Defaults.maxTerms)
}
- /// Saves user-managed boost terms while preserving or defaulting backend tuning parameters.
+ /// Saves user-managed boost terms while keeping tuning backend-controlled.
func saveUserBoostTerms(_ terms: [VocabularyConfig.Term]) throws {
let normalizedTerms = Self.normalizeUserTerms(terms, maxTerms: Defaults.maxTerms)
- let existingRawJSON = (try? self.loadRawJSON()) ?? Self.defaultTemplateJSON()
- let existing = (try? self.validateJSON(existingRawJSON)) ?? VocabularyConfig(
- alpha: nil,
- minCtcScore: nil,
- minSimilarity: nil,
- minCombinedConfidence: nil,
- minTermLength: nil,
- terms: []
- )
+ // Keep tuning backend-controlled so users only manage words in UI.
let config = VocabularyConfig(
- alpha: existing.alpha ?? Defaults.alpha,
- minCtcScore: existing.minCtcScore ?? Defaults.minCtcScore,
- minSimilarity: existing.minSimilarity ?? Defaults.minSimilarity,
- minCombinedConfidence: existing.minCombinedConfidence ?? Defaults.minCombinedConfidence,
- minTermLength: existing.minTermLength ?? Defaults.minTermLength,
+ alpha: Defaults.alpha,
+ minCtcScore: Defaults.minCtcScore,
+ minSimilarity: Defaults.minSimilarity,
+ minCombinedConfidence: Defaults.minCombinedConfidence,
+ minTermLength: Defaults.minTermLength,
terms: normalizedTerms
)
@@ -171,11 +164,12 @@ final class ParakeetVocabularyStore {
let mergedTerms = self.mergeAndNormalizeTerms(jsonTerms: parsed.terms, dictionaryEntries: SettingsStore.shared.customDictionaryEntries)
return ResolvedConfig(
- alpha: parsed.alpha ?? Defaults.alpha,
- minCtcScore: parsed.minCtcScore ?? Defaults.minCtcScore,
- minSimilarity: parsed.minSimilarity ?? Defaults.minSimilarity,
- minCombinedConfidence: parsed.minCombinedConfidence ?? Defaults.minCombinedConfidence,
- minTermLength: parsed.minTermLength ?? Defaults.minTermLength,
+ // Backend-tuned values: avoid stale/aggressive values from old JSON files.
+ alpha: Defaults.alpha,
+ minCtcScore: Defaults.minCtcScore,
+ minSimilarity: Defaults.minSimilarity,
+ minCombinedConfidence: Defaults.minCombinedConfidence,
+ minTermLength: Defaults.minTermLength,
terms: mergedTerms
)
}
@@ -228,7 +222,7 @@ final class ParakeetVocabularyStore {
let aliases = entry.triggers
.map { $0.trimmingCharacters(in: .whitespacesAndNewlines) }
.filter { !$0.isEmpty }
- upsert(VocabularyConfig.Term(text: replacement, weight: 10.0, aliases: aliases))
+ upsert(VocabularyConfig.Term(text: replacement, weight: 8.0, aliases: aliases))
}
return mergedByText.values.sorted { lhs, rhs in
@@ -274,11 +268,11 @@ final class ParakeetVocabularyStore {
static func defaultTemplateJSON() -> String {
"""
{
- "alpha": 3.2,
- "minCtcScore": -2.4,
- "minSimilarity": 0.68,
- "minCombinedConfidence": 0.58,
- "minTermLength": 2,
+ "alpha": 2.8,
+ "minCtcScore": -2.2,
+ "minSimilarity": 0.72,
+ "minCombinedConfidence": 0.64,
+ "minTermLength": 3,
"terms": [
{
"text": "FluidVoice",
diff --git a/Sources/Fluid/UI/CustomDictionaryView.swift b/Sources/Fluid/UI/CustomDictionaryView.swift
index 5f6e0c16..b861c8c0 100644
--- a/Sources/Fluid/UI/CustomDictionaryView.swift
+++ b/Sources/Fluid/UI/CustomDictionaryView.swift
@@ -431,6 +431,36 @@ private struct EditableBoostTerm: Identifiable {
let term: ParakeetVocabularyStore.VocabularyConfig.Term
}
+private enum BoostStrengthPreset: String, CaseIterable, Identifiable {
+ case mild = "Mild"
+ case balanced = "Balanced"
+ case strong = "Strong"
+
+ var id: String { self.rawValue }
+
+ var weight: Float {
+ switch self {
+ case .mild: return 7.0
+ case .balanced: return 10.0
+ case .strong: return 13.0
+ }
+ }
+
+ var hint: String {
+ switch self {
+ case .mild: return "Safer default. Lower chance of over-correcting."
+ case .balanced: return "Recommended for most domain words."
+ case .strong: return "Use for names/terms that must win often."
+ }
+ }
+
+ static func nearest(for weight: Float) -> Self {
+ if weight < 8.5 { return .mild }
+ if weight > 11.5 { return .strong }
+ return .balanced
+ }
+}
+
// MARK: - Boost Term Row
struct BoostTermRow: View {
@@ -511,6 +541,7 @@ struct AddBoostTermSheet: View {
@State private var termText = ""
@State private var aliasesText = ""
+ @State private var strength: BoostStrengthPreset = .balanced
private var normalizedTerm: String {
self.termText.trimmingCharacters(in: .whitespacesAndNewlines)
@@ -546,7 +577,7 @@ struct AddBoostTermSheet: View {
VStack(alignment: .leading, spacing: 6) {
Text("Common Variations (optional)")
- .font(.subheadline.weight(.medium))
+ .font(.subheadline.weight(.medium))
Text("Comma-separated forms that are often misheard.")
.font(.caption)
.foregroundStyle(.secondary)
@@ -555,6 +586,20 @@ struct AddBoostTermSheet: View {
.onSubmit { self.saveIfValid() }
}
+ VStack(alignment: .leading, spacing: 6) {
+ Text("Boost Strength")
+ .font(.subheadline.weight(.medium))
+ Picker("Boost Strength", selection: self.$strength) {
+ ForEach(BoostStrengthPreset.allCases) { preset in
+ Text(preset.rawValue).tag(preset)
+ }
+ }
+ .pickerStyle(.segmented)
+ Text(self.strength.hint)
+ .font(.caption2)
+ .foregroundStyle(.secondary)
+ }
+
if self.isDuplicate {
Text("This term already exists.")
.font(.caption)
@@ -569,6 +614,12 @@ struct AddBoostTermSheet: View {
Text(self.normalizedTerm.isEmpty ? "term" : self.normalizedTerm)
.font(.caption.weight(.medium))
.foregroundStyle(self.theme.palette.accent)
+ Text("w \(String(format: "%.1f", self.strength.weight))")
+ .font(.caption2.weight(.semibold))
+ .padding(.horizontal, 6)
+ .padding(.vertical, 3)
+ .background(Capsule().fill(.quaternary))
+ .foregroundStyle(.secondary)
ForEach(self.parseAliases(), id: \.self) { alias in
Text(alias)
.font(.caption)
@@ -617,7 +668,7 @@ struct AddBoostTermSheet: View {
self.onSave(
ParakeetVocabularyStore.VocabularyConfig.Term(
text: self.normalizedTerm,
- weight: 12.0,
+ weight: self.strength.weight,
aliases: self.parseAliases()
)
)
@@ -637,6 +688,7 @@ struct EditBoostTermSheet: View {
@State private var termText = ""
@State private var aliasesText = ""
+ @State private var strength: BoostStrengthPreset = .balanced
private var normalizedTerm: String {
self.termText.trimmingCharacters(in: .whitespacesAndNewlines)
@@ -681,6 +733,20 @@ struct EditBoostTermSheet: View {
.onSubmit { self.saveIfValid() }
}
+ VStack(alignment: .leading, spacing: 6) {
+ Text("Boost Strength")
+ .font(.subheadline.weight(.medium))
+ Picker("Boost Strength", selection: self.$strength) {
+ ForEach(BoostStrengthPreset.allCases) { preset in
+ Text(preset.rawValue).tag(preset)
+ }
+ }
+ .pickerStyle(.segmented)
+ Text(self.strength.hint)
+ .font(.caption2)
+ .foregroundStyle(.secondary)
+ }
+
if self.isDuplicate {
Text("This term already exists.")
.font(.caption)
@@ -695,6 +761,12 @@ struct EditBoostTermSheet: View {
Text(self.normalizedTerm.isEmpty ? "term" : self.normalizedTerm)
.font(.caption.weight(.medium))
.foregroundStyle(self.theme.palette.accent)
+ Text("w \(String(format: "%.1f", self.strength.weight))")
+ .font(.caption2.weight(.semibold))
+ .padding(.horizontal, 6)
+ .padding(.vertical, 3)
+ .background(Capsule().fill(.quaternary))
+ .foregroundStyle(.secondary)
ForEach(self.parseAliases(), id: \.self) { alias in
Text(alias)
.font(.caption)
@@ -732,6 +804,7 @@ struct EditBoostTermSheet: View {
.onAppear {
self.termText = self.term.text
self.aliasesText = (self.term.aliases ?? []).joined(separator: ", ")
+ self.strength = BoostStrengthPreset.nearest(for: self.term.weight ?? BoostStrengthPreset.balanced.weight)
}
}
@@ -747,7 +820,7 @@ struct EditBoostTermSheet: View {
self.onSave(
ParakeetVocabularyStore.VocabularyConfig.Term(
text: self.normalizedTerm,
- weight: self.term.weight ?? 12.0,
+ weight: self.strength.weight,
aliases: self.parseAliases()
)
)