A collection of terms and their labels, which augments a tagger that analyzes natural language text.
- macOS 10.15+
- Xcode 11.0+
- Create ML
MLGazetteer to configure a gazetteer and save it to a file, which you then add to your app in Xcode. Your app uses the gazetteer file at runtime to create an instance of
NLGazetteer, which augments an
NLTagger to tag specific terms with a label.
You configure a gazetteer with a dictionary, keyed by labels. Each value in the dictionary is an array of terms (words or phrases) for each label. For example, you can store the names of real and fictional planets in a gazetteer.
Once you’ve configured an
MLGazetteer, save it to an
.mlmodel file to include in your app.
A gazetteer file can efficiently store many labels, and many terms for each label.