Applications can utilize CoreML for many different purposes. One of these purposes is text analysis. You can use a trained model to detect whether a particular piece of text has a positive or negative sentiment. To implement a feature like this, you can use a trained and converted CoreML model.
The code bundle for this chapter includes a project named TextAnalyzer. If you open the start version of this project, you'll find a project that has an implementation of a simple layout along with a button that is hooked up to an @IBAction, named analyze(). The project folder also contains a file called SentimentPolarity.mlmodel. This file is a trained CoreML model that analyzes the sentiment associated with a certain text. Drag ...