<!--
{
  "availability" : [
    "iOS: 12.0.0 -",
    "iPadOS: 12.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.14.0 -",
    "tvOS: 12.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 5.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreML",
  "identifier" : "/documentation/CoreML/MLSequence",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Core ML"
    ],
    "preciseIdentifier" : "c:objc(cs)MLSequence"
  },
  "title" : "MLSequence"
}
-->

# MLSequence

A machine learning collection type that stores a series of strings or integers.

```
class MLSequence
```

## Overview

A sequence stores a series of integers or strings of any length as the underlying type of an `MLFeatureValue`. Some classifier models — typically natural language models, such as an <doc://com.apple.documentation/documentation/NaturalLanguage/NLTagger> — produce an [`MLSequence`](/documentation/CoreML/MLSequence) feature value from their output features.

## Topics

### Creating a sequence

[`init(strings:)`](/documentation/CoreML/MLSequence/init(strings:))

Creates a sequence of strings from a string array.

[`init(int64s:)`](/documentation/CoreML/MLSequence/init(int64s:))

Creates a sequence of integers from an array of numbers.

[`init(empty:)`](/documentation/CoreML/MLSequence/init(empty:))

Creates an empty sequence of strings or integers.

### Identifying the sequence’s element type

[`type`](/documentation/CoreML/MLSequence/type)

The underlying type of the sequence’s elements.

### Retrieving the Sequence’s Values

[`stringValues`](/documentation/CoreML/MLSequence/stringValues)

An array of strings in the sequence.

[`int64Values`](/documentation/CoreML/MLSequence/int64Values)

An array of 64-bit integers in the sequence.



---

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)