Chapter 7. Text Processing Apps with ML Kit on iOS
In Chapter 6, you saw how to use ML Kit in your iOS apps for some computer vision scenarios including image recognition and object detection. Perhaps the next largest segment of ML apps are those which perform natural language processing tasks. So in this chapter we’ll look at a few examples of how models from ML Kit provide some common machine learning tasks for you, including extracting entities from text, such as recognizing an email address or a date; performing handwriting recognition, turning strokes into text; and analyzing a conversation to generate a smart reply. If you want to create apps that use other natural language processing concepts with custom models, such as classifying text, you’ll need to build your own models, and we’ll explore that in later chapters.
Entity Extraction
Often you’ll want to extract vital information from text. You’ve no doubt seen apps that can determine when there’s an address in a piece of text and automatically generate a link to a map of that address, or others that understand an email address and generate a link that lets you launch your email app to send mail to that address. This concept is called entity extraction, and in this section you’ll explore a turnkey model that performs this for you. This is a really cool implementation of ML, because if you consider how a rules-based approach would solve this problem, you would expect to write a lot of code!
So, consider Figure 7-1, where ...
Get AI and Machine Learning for On-Device Development now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.