TechnologiesMachine Learning & AI

NaturalLanguage

iOSmacOStvOSwatchOSvisionOS

NaturalLanguage performs on-device natural language processing across iOS, macOS, tvOS, watchOS, and visionOS, covering tokenization, language identification, word and contextual embeddings, tagging, and sentiment. You split text into words, sentences, or other units with NLTokenizer and NLTokenUnit, identify the dominant language and script of text using NLLanguageRecognizer, NLLanguage, and NLScript, and annotate tokens with linguistic information through NLTagger, NLTag, and NLTagScheme. With NLEmbedding and NLContextualEmbedding you map words and passages into vector representations and measure their similarity via NLDistanceType, and you classify text using custom NLModel instances configured through NLModelConfiguration and informed by NLGazetteer.

Tokenization 2

Split natural language text into words, sentences, paragraphs, or other linguistic units.

  • Cl
    NLTokenizeriOS 12.0+
    A class that splits text into semantic units like words, sentences, or paragraphs.
  • En
    NLTokenUnit
    An enumeration of the linguistic units, such as word or sentence, that a tokenizer can produce.

Language Identification 3

Detect the dominant language and writing system of a piece of text.

  • Cl
    NLLanguageRecognizeriOS 12.0+
    A class that determines the dominant language and reports per-language probabilities for a body of text.
  • St
    NLLanguage
    A structure of constants identifying the languages that the framework can recognize and process.
  • St
    NLScript
    A structure of constants identifying the writing systems that the framework can detect.

Tagging and Linguistic Analysis 3

Annotate tokens with parts of speech, named entities, lemmas, and other linguistic tags.

  • Cl
    NLTaggeriOS 12.0+
    A class that analyzes text and annotates its tokens with linguistic tags such as part of speech and named entities.
  • St
    NLTagScheme
    A structure of constants identifying the schemes of linguistic tags a tagger can produce.
  • St
    NLTag
    A structure of constants representing the individual linguistic tags assigned to tokens.

Embeddings 5

Map words and passages to vector representations and measure their semantic similarity.

  • Cl
    NLEmbeddingiOS 13.0+
    A class that maps individual words or strings to fixed numeric vectors for similarity and nearest-neighbor queries.
  • Cl
    NLContextualEmbeddingiOS 17.0+
    A model that computes sequences of embedding vectors for natural language utterances.
  • Cl
    NLContextualEmbeddingResultiOS 17.0+
    An object that represents the embedding vector result from applying a contextual embedding to a string.
  • St
    NLContextualEmbeddingKey
    This class defines properties that you can filter or search for contextual embeddings.
  • En
    NLDistanceType
    An enumeration of the distance metrics used to compare embedding vectors.

Text Classification 3

Apply custom machine learning models and gazetteers to classify or label text.

  • Cl
    NLModeliOS 12.0+
    A class that applies a custom Core ML text classification or tagging model to natural language input.
  • Cl
    NLModelConfigurationiOS 12.0+
    An object describing the type and language settings of a custom natural language model.
  • Cl
    NLGazetteeriOS 13.0+
    An object that maps terms to labels, providing a dictionary used to augment text classification and tagging.

Type Aliases 1

  • Ty
    NLDistance
← Machine Learning & AI