Post

Replies

Boosts

Views

Activity

NLLanguageRecognizer does not return Malay
I’m testing NLLanguageRecognizer to distinguish Malay (Bahasa Melayu) from English using this Malay text: Buka App Muzik untuk Mendayakan Widget Without language hints, my sandbox produces the following results. Percentages are rounded for display: Constraints Returned scores ID, EN ID: 100%; EN: 0% MS, EN EN: 100%; MS: not returned VI, EN VI: 98.7%; EN: 1.3% ID, MS, VI, EN ID: 100%; MS: not returned; EN and VI: 0% I also tried supplying languageHints to favor Malay and changed my phone’s system language to Malay. Neither resolved the issue: the recognizer still failed to identify the text as Malay. Here is a minimal example with hints: import NaturalLanguage let recognizer = NLLanguageRecognizer() recognizer.languageConstraints = [.malay, .english] recognizer.languageHints = [.malay: 0.8, .english: 0.2] recognizer.processString("Sila isi borang di bawah") print(recognizer.dominantLanguage?.rawValue ?? "nil") for (language, score) in recognizer.languageHypotheses(withMaximum: 2) { print(language.rawValue, score) } An independent native macOS test with the same short text also returned English with score 1.0, both with hints disabled and with the 0.80 Malay hint. To investigate whether this was only short-text ambiguity, I separately tested a longer Malay paragraph taken from local news on macOS: Terdahulu, peguam PN, Ivanpal Singh Grewal, berhujah bahawa penangguhan wajar diberikan memandangkan keadaan luar biasa susulan PRN Melaka pada 14 Nov, sambil berkata penggantungan itu menghalang gabungan berkenaan daripada menyertai proses demokrasi. Without hints, that paragraph produced: Constraints Result None Indonesian (id), score 1.0 English and Malay English (en), score 1.0; no Malay hypothesis Malay only dominantLanguage is nil; hypotheses are empty English, Malay, Indonesian Indonesian (id), score 1.0 I understand that Malay and Indonesian share vocabulary, short strings can be ambiguous, and constraints can force a prediction into an allowed language. However, Malay appears absent even when explicitly allowed and favored. My questions are: Is Malay identification supported by NLLanguageRecognizer on iOS and macOS? Could the missing Malay hypothesis and empty Malay-only result indicate a model limitation or framework defect? Is there an API to check which languages are available for recognition on the current runtime? Are any additional settings or language resources required? Environment iPhone model / iOS version: iPhone 13, iOS 27.2 Phone system language: tested with English and Malay Independent Mac reproduction: macOS 26.7.1 (25G241), Apple Silicon, Xcode 27.2 Beta 3
0
0
220
18h
NLLanguageRecognizer does not return Malay
I’m testing NLLanguageRecognizer to distinguish Malay (Bahasa Melayu) from English using this Malay text: Buka App Muzik untuk Mendayakan Widget Without language hints, my sandbox produces the following results. Percentages are rounded for display: Constraints Returned scores ID, EN ID: 100%; EN: 0% MS, EN EN: 100%; MS: not returned VI, EN VI: 98.7%; EN: 1.3% ID, MS, VI, EN ID: 100%; MS: not returned; EN and VI: 0% I also tried supplying languageHints to favor Malay and changed my phone’s system language to Malay. Neither resolved the issue: the recognizer still failed to identify the text as Malay. Here is a minimal example with hints: import NaturalLanguage let recognizer = NLLanguageRecognizer() recognizer.languageConstraints = [.malay, .english] recognizer.languageHints = [.malay: 0.8, .english: 0.2] recognizer.processString("Sila isi borang di bawah") print(recognizer.dominantLanguage?.rawValue ?? "nil") for (language, score) in recognizer.languageHypotheses(withMaximum: 2) { print(language.rawValue, score) } An independent native macOS test with the same short text also returned English with score 1.0, both with hints disabled and with the 0.80 Malay hint. To investigate whether this was only short-text ambiguity, I separately tested a longer Malay paragraph taken from local news on macOS: Terdahulu, peguam PN, Ivanpal Singh Grewal, berhujah bahawa penangguhan wajar diberikan memandangkan keadaan luar biasa susulan PRN Melaka pada 14 Nov, sambil berkata penggantungan itu menghalang gabungan berkenaan daripada menyertai proses demokrasi. Without hints, that paragraph produced: Constraints Result None Indonesian (id), score 1.0 English and Malay English (en), score 1.0; no Malay hypothesis Malay only dominantLanguage is nil; hypotheses are empty English, Malay, Indonesian Indonesian (id), score 1.0 I understand that Malay and Indonesian share vocabulary, short strings can be ambiguous, and constraints can force a prediction into an allowed language. However, Malay appears absent even when explicitly allowed and favored. My questions are: Is Malay identification supported by NLLanguageRecognizer on iOS and macOS? Could the missing Malay hypothesis and empty Malay-only result indicate a model limitation or framework defect? Is there an API to check which languages are available for recognition on the current runtime? Are any additional settings or language resources required? Environment iPhone model / iOS version: iPhone 13, iOS 27.2 Phone system language: tested with English and Malay Independent Mac reproduction: macOS 26.7.1 (25G241), Apple Silicon, Xcode 27.2 Beta 3
Replies
0
Boosts
0
Views
220
Activity
18h