Structure

MLWordTagger

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

Overview

Use an MLWordTagger to customize a word tagger on content that is relevant to you and your app. Product names or points of interest are types of content that you can train a MLWordTagger to identify. Combined with the NLTagger, a wide range of tokens can be tagged.

Topics

Creating and Training a Word Tagger

Testing a Model with Unlabeled Data

func prediction(from: String) -> [String]

Tags each of the tokens in the string.

func predictions(from: MLDataColumn<String>) -> MLDataTable

Tags each of the strings in the input column.

Saving a Model

func write(toFile: String, metadata: MLModelMetadata?)

Exports a Core ML model file for use in your app.

func write(to: URL, metadata: MLModelMetadata?)

Exports a Core ML model file for use in your app.

struct MLModelMetadata

Information about a model that’s stored in a Core ML model file.

Inspecting a Model

var model: MLModel

The underlying Core ML model for this word tagger.

let modelParameters: MLWordTagger.ModelParameters

The configuration parameters that were used to train the model during initialization.

var description: String

A text representation of this word tagger.

Type Aliases

typealias MLWordTagger.Token

The token type, String.

Relationships

See Also

Natural Language

Creating a Text Classifier Model

Train a machine learning model to classify natural language text.

struct MLTextClassifier

A model you train to classify natural language text.

Beta

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software