Platforms to show: All Mac Windows Linux Cross-Platform

NLEmbeddingMBS class   New in 26.2

Type Topic Plugin Version macOS Windows Linux iOS Targets
class Natural Language MBS MacFrameworks Plugin 26.2 ✅ Yes ❌ No ❌ No ✅ Yes All
A map of strings to vectors, which locates neighboring, similar strings.

Use an NLEmbedding to find similar strings based on the proximity of their vectors. The vocabulary is the entire set of strings in an embedding. Each string in the vocabulary has a vector, which is an array of doubles, and each double corresponds to a dimension in the embedding. An NLEmbedding uses these vectors to determine the distance between two strings, or to find the nearest neighbors of a string in the vocabulary. The higher the similarity of any two strings, the smaller the distance is between them.

Natural Language provides built-in word embeddings that you can retrieve by using the wordEmbeddingForLanguage: method. You can also compile your own custom embedding into an efficient, searchable, on-disk representation. Typically, you compile an embedding by using Create ML’s MLWordEmbedding and save it as a file for your Xcode project at development time.

Your custom embedding can use any kind of string that’s useful to your app, such as phrases, brand names, serial numbers, and so on. For example, you could make an embedding of movie titles. Each movie title could have a vector that places similar movies close together in the embedding.
This is an abstract class. You can't create an instance, but you can get one from various plugin functions.

Constants

Constant Value Description
NLDistanceTypeCosine 0 The means of calculating a distance between two locations in a text embedding. The meaning of an distance is directly related to the NLDistanceType you use when you call a method that uses it. For example, if you use the neighborsForString method and use NLDistanceTypeCosine for the distanceType parameter, the method calculates the cosine distance and returns it as an NLDistance.

This class has no sub classes.

Blog Entries

Release notes

  • Version 26.2
    • Added NLEmbeddingMBS and NLEmbeddingNeighborMBS classes.

Some related classes:


The items on this page are in the following plugins: MBS MacFrameworks Plugin.


NLContextualEmbeddingResultVectorMBS   -   NLEmbeddingNeighborMBS


The biggest plugin in space...