Chapter 1
Natural language
Explore machine learning with the Natural Language framework and sentiment analysis. Create an app that collects opinions on hiking, analyzes the responses, and displays the results visually.
Meeting 1
Preparation: Complete the Analyze sentiment in text tutorial before the meeting.
Group activity: Work in small groups to extend the functionality of Scorer, using the Natural Language framework to also return the language the response was written in. Update Response to store this new information, and use ResponseView to display it.
At the end of the meeting, take a few minutes for each group to share how they chose to place this information and make it easily readable.
Meeting 2
Preparation: Read the "Reflect on the concepts" section of the Wrap-up: Natural language article.
Group activity: Work in small groups to update your Sentiment enum to have five cases instead of three. Decide how to label them, how to divide the sentiment score range among them, and how to display them in the UI. (You can use SF Symbols for the icons.)
Next, add responses to the sample set in the app and see whether they are scored the way you expected. See if you can create a new response for each enum case.
At the end of the meeting, take a few minutes as a group to discuss apps you use that might incorporate sentiment analysis. Are there other apps you use that might be better if they added sentiment analysis in some way?
Chapter 2
Recognize text in images
Create an app that uses the machine learning Vision and Translation frameworks to identify text in an image and translate it into another language.
Meeting 3
Preparation: Complete the Extract text from images tutorial before the meeting.
Group activity: Working in small groups, start by making copies of the sign images that are cropped to include only the portions of the signs that have text. Add the cropped images to the app, then change the app so that people can select their preferred recognition level to prioritize either speed or accuracy. Experiment with how the cropped images and the original images are recognized when speed is prioritized.
Next, change the color of the bounding rectangles based on the certainty value of the recognized text. Again, compare the results between the original and cropped images.
At the end of the meeting, take a few minutes to discuss what you have learned about input images.
Meeting 4
Preparation: Read the "Reflect on the concepts" section of the Wrap-up: Recognize text in images article.
Group activity: Work in small groups to provide a way to select among multiple candidates when the Vision framework offers more than one option. Consider adding a new control to select an option or using the keyboard to fix incorrect results.
At the end of the meeting, take a few minutes for each group to show its solution. Then, discuss as a group how you can imagine using the Vision framework to create an app that would be useful to you.
Chapter 3
Model training with Create ML
Train a machine learning model with the Create ML tool in Xcode. Use provided data to train a model to predict how challenging a trail will be based on characteristics like distance and elevation.
Meeting 5
Preparation: Complete the Train a Core ML model tutorial before the meeting.
Group activity: Work together or in small groups to adjust the Linear Regression algorithm parameters. Can you improve the model results? Can you reduce the time spent training and get a model of equal quality?
At the end of the meeting, take a few minutes to share the changes you made and how much accuracy or speed you were able to improve.
Meeting 6
Preparation: Read the "Reflect on the concepts" section of the Wrap-up: Model training with Create ML article. Determine the mathematical formula that calculates risk values using the data. You'll know you have it right if your formula predicts approximately the same risk values as the app does. Hint: Previewing TrailData1k.csv may help you isolate individual fields.
Group activity: Work in small groups to use the trail data to train a model that predicts a value other than risk — either elevation, distance, or the presence of dangerous wildlife.
Then, discuss as a group what other kinds of apps you can imagine using Create ML models to build.
Chapter 4
Custom models with Core ML
Import a machine learning model into an app that takes details about hikes and displays their likely challenge level.
Meeting 7
Preparation: Complete the Import models with Core ML tutorial before the meeting.
Group activity: Work together or in small groups to change the risk setup in the app. In the tutorial, the risk categories assume that the person using the app is a hiking enthusiast. Adjust the risks for an amateur hiker, then create a UI to display the exact risk. Explore alternatives to simply displaying the numeric risk value as text. Can you find a way to show the risk relative to other trails?
At the end of the meeting, take a few minutes to discuss other parameters you could use as input. How might they improve the accuracy of the results or support other people using the app?
Meeting 8
Preparation: Read the "Reflect on the concepts" section of the Wrap-up: Custom models with Core ML article.
Group activity: Work in small groups to replace the Submit button with a live update of the predicted risk. Hint: Use .onChange when the input state changes.
At the end of the meeting, take a few minutes to share the changes you made.
Chapter 5
Image generation with Image Playground
Create an app that lets users generate and modify images using the Image Playground framework.
Meeting 9
Preparation: Complete the Utilize image generation features tutorial before the meeting.
Group activity: Work in small groups to update ImageGenerator to let the user provide an initial image concept to influence the created image. You'll also need to adapt the UI so people can upload the initial image.
At the end of the meeting, take a few minutes for each group to show its solution.
Meeting 10
Preparation: Read the "Reflect on the concepts" section of the Wrap-up: Image generation with Image Playground article.
Group activity: Work in small groups to let the user generate multiple variations using the limit parameter of ImageCreator. Modify the interface to display all the generated images.
At the end of the meeting, take a few minutes for each group to share what you learned.
Chapter 6
Intelligent features with Foundation Models
Create a quiz app using streaming responses and guided generation.
Meeting 12
Preparation: Read the "Reflect on the concepts" section of the Wrap-up: Intelligent features with Foundation Models article.
Group activity: Add a score property to your quiz. Track and display that score as the user answers questions.
At the end of the meeting, discuss what you learned.