NLEmbedding not found after updating to iOS 14.4

When I try to get the sentence embedding with NLEmbedding.sentenceEmbedding(for: .english), I get nil returned and the message in the console is:
"Unable to locate Asset for contextual word embedding model for local en."
I've also tried different languages and also NLEmbedding.wordEmbedding(for: .english) doesn't work.

This only occurs on my iPhone X after updating to iOS 14.4. Before it worked fine. It also works on the Simulator on iOS 14.4.

Did somebody face a similar problem? Or does somebody know how to force iOS to download these embeddings again?
Post not yet marked as solved Up vote post of aleeeex Down vote post of aleeeex
2k views

Replies

Happened again in iOS 15 beta 1. FB9179349

I had the same issue last month and it works now. But it only works for English. When I tried Chinese and a few other languages, they still return nil.

My current issue with English is that when I tried to run below code, it returns __C.NLEmbedding.vector(for: Swift.String) -> Swift.Optional<Swift.Array<Swift.Double>>

import NaturalLanguage

let embedding = NLEmbedding.wordEmbedding(for: .english)

let vector = embedding?.vector(for: "dog") ?? []

print(vector)
//__C.NLEmbedding.vector(for: Swift.String) -> Swift.Optional<Swift.Array<Swift.Double>>

This seems to also happen in iOS 17 beta 5, but only for sentenceEmbedding, not wordEmbedding.

Did you find a fix for this? Facing the exact issue with iOS 17.2, wordEmbedding works but sentenceEmbedding doesn't