---
title: "embeddingResult(for:language:)"
framework: Natural Language
role: symbol
role_heading: Instance Method
platforms: [iOS 17.0+, iPadOS 17.0+, Mac Catalyst 17.0+, macOS 14.0+, tvOS 17.0+, visionOS 1.0+, watchOS 10.0+]
path: "naturallanguage/nlcontextualembedding/embeddingresult(for:language:)"
---

# embeddingResult(for:language:)

Applies an embedding to a string and obtains the resulting embedding vectors.

## Declaration

```swift
func embeddingResult(for string: String, language: NLLanguage?) throws -> NLContextualEmbeddingResult
```

## Parameters

- `string`: The string to apply an embedding to.
- `language`: The language of the string.

## Return Value

Return Value An embedding result. On failure, this method returns nil.

## See Also

### Applying an embedding

- [NLContextualEmbeddingResult](naturallanguage/nlcontextualembeddingresult.md)
