Skip to Content
移动端AI与ML应用开发:基于iOS和Android
book

移动端AI与ML应用开发:基于iOS和Android

by Laurence Moroney
January 2023
Intermediate to advanced
288 pages
6h 6m
Chinese
China Machine Press
Content preview from 移动端AI与ML应用开发:基于iOS和Android
206
|
11
示例中,你必须手动将原始图像转换为
Data
以将其表示为张量,并且你必须读取转换
为数组的输出内存以获得结果。因此,如果你正在构建图像分类器,我强烈建议你尽可
能使用 ML Kit 来防止这种情况发生。如果你不能,我希望介绍的这两种方法对你有用!
你可以在图 11-6 中看到更新后的应用程序的屏幕截图。在这里,我使用了雏菊的图片,
ML Kit 的引擎使用我的自定义模型,报告了 0.96 的概率推断该图像是雏菊!
11-6
:具有自定义花卉模型的基于
ML Kit
的应用程序
当构建在移动设备上运行的基于 ML 的模型时,了解底层数据结构始终是一项有用的练
习。我们将探索使用自然语言处理的应用程序的另一个场景,以便你可以更深入地了解
如何在 Swift 中使用模型。我们将再次使用原始数据方法,就像我们在图像示例中使用
的那样,但这次我们将探索一个旨在识别文本和文本中的情绪的模型!
11.4
Swift
中构建用于自然语言处理的应用程序
在着手构建应用程序之前,最好先了解自然语言处理模型的工作原理,这样你就可以了
解设备上的文本字符串与模型内张量之间的数据交换是如何进行的。
首先,当你在一组称为语料库的文本上训练模型时,你会将模型理解的词汇限制为最多
该语料库中的单词。因此,例如,你在此应用程序中使用的模型是第 8 章中使用数千条
推文的文本训练的。该模型只会识别该组推文中使用的单词。因此,如果你想在应用程
正文.indd 206正文.indd 206 2023-4-30 9:09:59 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

快速提升人工智能产品的实用指南

快速提升人工智能产品的实用指南

Hamel Husain
人工智能技术与大数据

人工智能技术与大数据

Posts & Telecom Press, Anand Deshpande, Manish Kumar
AI原生软件交付

AI原生软件交付

Nick Durkin, Eric Minick, Chinmay Gaikwad

Publisher Resources

ISBN: 9787111713081