O'Reilly logo

Mastering iOS 11 Programming - Second Edition by Donny Wals

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using a CoreML model

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 certain piece of text has a positive or negative sentiment. To implement a feature like this, you can use a trained and converted CoreML model.

In the code bundle for this chapter, a project named RateMyText is included. If you open the starter version of this project, you'll find a project that has a simple layout implemented and a button that is hooked up to an IBAction named analyze(). We'll use the .mlmodel file that is in the project folder to rate the sentiment for the text that the user writes in the UITextView. First of all, let's add the .mlmodel file to Xcode by ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required