<!--
{
  "availability" : [
    "iOS: 12.0.0 -",
    "iPadOS: 12.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.14.0 -",
    "tvOS: 12.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 5.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "NaturalLanguage",
  "identifier" : "/documentation/NaturalLanguage/NLContextualEmbeddingKey",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Natural Language"
    ],
    "preciseIdentifier" : "c:@T@NLContextualEmbeddingKey"
  },
  "title" : "NLContextualEmbeddingKey"
}
-->

# NLContextualEmbeddingKey

This class defines properties that you can filter or search for contextual embeddings.

```
struct NLContextualEmbeddingKey
```

## Overview

The keys within this class provide filtering criteria that you can specify within your model. For example, you
can use a defined key like [`scripts`](/documentation/NaturalLanguage/NLContextualEmbeddingKey/scripts) and search for models
that use a specfic script like `Latin`.

## Topics

### Getting embedding keys

[`NLContextualEmbeddingKeyLanguages`](/documentation/NaturalLanguage/NLContextualEmbeddingKey/languages)

A key that identifies the supported languages in a contextual embedding.

[`NLContextualEmbeddingKeyRevision`](/documentation/NaturalLanguage/NLContextualEmbeddingKey/revision)

A key that identifies the version number the contextual embedding uses.

[`NLContextualEmbeddingKeyScripts`](/documentation/NaturalLanguage/NLContextualEmbeddingKey/scripts)

A key that identifies the writing system that the language uses in a contextual embedding.

### Creating embedding keys

[`init(_:)`](/documentation/NaturalLanguage/NLContextualEmbeddingKey/init(_:))

Creates an embedding key with the given string.

[`init(rawValue:)`](/documentation/NaturalLanguage/NLContextualEmbeddingKey/init(rawValue:))

Creates an embedding key with the given string as its raw value.

## Relationships

### Conforms To

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Sendable`](/documentation/Swift/Sendable)

[`Hashable`](/documentation/Swift/Hashable)

[`Equatable`](/documentation/Swift/Equatable)

[`RawRepresentable`](/documentation/Swift/RawRepresentable)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)