<!--
{
  "availability" : [
    "macOS: 10.14.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CreateML",
  "identifier" : "/documentation/CreateML/MLWordTagger",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Create ML"
    ],
    "preciseIdentifier" : "s:8CreateML12MLWordTaggerV"
  },
  "title" : "MLWordTagger"
}
-->

# MLWordTagger

A word-tagging model you train to classify natural language text at the word level.

```
struct MLWordTagger
```

## Overview

Use an [`MLWordTagger`](/documentation/CreateML/MLWordTagger) to create a custom word tagger to identify content
that’s relevant for your app, like product names and points of interest.

To use your custom word tagger in the
<doc://com.apple.documentation/documentation/NaturalLanguage> framework,
save it to a model file and import it into an
<doc://com.apple.documentation/documentation/NaturalLanguage/NLModel>. Then
add your custom
<doc://com.apple.documentation/documentation/NaturalLanguage/NLModel> to an
<doc://com.apple.documentation/documentation/NaturalLanguage/NLTagger> with
its
<doc://com.apple.documentation/documentation/NaturalLanguage/NLTagger/setModels(_:forTagScheme:)>
method.

## Topics

### Creating and training a word tagger

[`init(trainingData:parameters:)`](/documentation/CreateML/MLWordTagger/init(trainingData:parameters:))

Creates a word tagger.

[`init(trainingData:tokenColumn:labelColumn:parameters:)`](/documentation/CreateML/MLWordTagger/init(trainingData:tokenColumn:labelColumn:parameters:))

Creates a word tagger.

[`MLWordTagger.Token`](/documentation/CreateML/MLWordTagger/Token)

The token type of a word tagger, which is a string.

[`MLWordTagger.ModelParameters`](/documentation/CreateML/MLWordTagger/ModelParameters-swift.struct)

Parameters that specify model training parameters and validation data.

[`modelParameters`](/documentation/CreateML/MLWordTagger/modelParameters-swift.property)

The configuration parameters that the word tagger used for training during initialization.

### Evaluating a word tagger

[`evaluation(on:tokenColumn:labelColumn:)`](/documentation/CreateML/MLWordTagger/evaluation(on:tokenColumn:labelColumn:))

Computes evaluation metrics.

[`evaluation(on:)`](/documentation/CreateML/MLWordTagger/evaluation(on:))

Computes evaluation metrics.

[`trainingMetrics`](/documentation/CreateML/MLWordTagger/trainingMetrics)

Measurements of the tagger’s performance on the training data set.

[`validationMetrics`](/documentation/CreateML/MLWordTagger/validationMetrics)

Measurements of the tagger’s performance on the validation data set.

[`MLWordTaggerMetrics`](/documentation/CreateML/MLWordTaggerMetrics)

Metrics you use to evaluate a word tagger’s performance.

### Testing a word tagger

[`prediction(from:)`](/documentation/CreateML/MLWordTagger/prediction(from:))

Predicts a tag for the input string.

[`predictions(from:)`](/documentation/CreateML/MLWordTagger/predictions(from:))

Predicts sequences of labels, token locations, and token lengths from the input strings.

[`predictionWithConfidence(from:)`](/documentation/CreateML/MLWordTagger/predictionWithConfidence(from:))

Predicts tags and confidence scores for the input string. Predicts tags and confidence scores for the input string.

### Saving a word tagger

[`write(to:metadata:)`](/documentation/CreateML/MLWordTagger/write(to:metadata:))

Exports the word tagger as a Core ML model file at the specified URL.

[`write(toFile:metadata:)`](/documentation/CreateML/MLWordTagger/write(toFile:metadata:))

Exports the word tagger as a Core ML model file at the specified file path.

### Describing a word tagger

[`model`](/documentation/CreateML/MLWordTagger/model)

The underlying Core ML model of the word tagger.

[`description`](/documentation/CreateML/MLWordTagger/description)

A text representation of the word tagger.

[`debugDescription`](/documentation/CreateML/MLWordTagger/debugDescription)

A text representation of the word tagger that’s suitable for output
during debugging.

[`playgroundDescription`](/documentation/CreateML/MLWordTagger/playgroundDescription)

A description of the word tagger in a playground.

### Supporting types

[`MLWordTagger.FeatureExtractorType`](/documentation/CreateML/MLWordTagger/FeatureExtractorType)

The feature extractors that are available to train a word tagger using with the transfer-learning algorithm option.

[`MLWordTagger.ModelAlgorithmType`](/documentation/CreateML/MLWordTagger/ModelAlgorithmType)

The algorithm type.



---

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)