Class

NLModel

A custom model trained to classify or tag natural language text.

Declaration

class NLModel : NSObject

Overview

With Create ML, you can create MLTextClassifier or MLWordTagger models. Use the NLModel to integrate those models into your app. This integration ensures that your tokenization and tagger configurations are identical when you train your model and use it in your app.

Topics

Creating a Model

init(mlModel: MLModel)

Creates a new natural language model based on a Core ML model.

init(contentsOf: URL)

Creates a new natural language model based on a Core ML model.

Making Predictions

func predictedLabel(for: String) -> String?

Predicts a label for the input string.

func predictedLabels(forTokens: [String]) -> [String]

Predicts a label for each input string.

Inspecting a Model

var configuration: NLModelConfiguration

A configuration describing the natural language model.

class NLModelConfiguration

The configuration parameters of a natural language model.

Relationships

Inherits From

Conforms To

See Also