Core ML 3 Framework ▸ 406: Create ML for Object Detection and Sound Classification ▸ 222: Understanding Images in Vision Framework ▸ 228: Creating Great Apps Using Core ML and ARKit ▸ 407: Create ML for Activity, Text, and Recommendations ▸ 232: Advances in Natural Language Framework ▸ 234: Text Recognition in Vision Framework ▸ 420: Drawing Classification and One-Shot Object Detection in Turi Create ▸ 803: Designing Great ML Experiences ▸ 614: Metal for Machine Learning
model with Swift, appeared in Xcode 10 let data = try! MLDataTable(contentsOf: URL(fileURLWithPath: "/path/to/dataset.json")) let (trainingData, testingData) = data.randomSplit(by: 0.8, seed: 5) let sentimentClassifier = try! MLTextClassifier(trainingData: trainingData, textColumn: "text", labelColumn: "label")
by Apple ▸ We don’t have to collect data and build model ▸ Main frameworks ▸ Computer Vision (Vision Framework) ▸ Natural Language Processing (NaturalLanguage Framework)
Human eye movement ▸ App example: image cropping ▸ Objectness based ▸ Training data: distinguished foreground object from background ▸ App example: object tracking
let request: VNRequest = VNGenerateAttentionBasedSaliencyImageRequest() let requestHandler = VNImageRequestHandler(cvPixelBuffer: pixelBuffer, orientation: .up, options: [:]) // 2. perform requests and get results try? requestHandler.perform([request]) let observation = request.results?.first as? VNSaliencyImageObservation // 3. do something using results if let salientObjects = observation?.salientObjects { for object in salientObjects { let boundingBox = object.boundingBox // do something } } IMAGE SALIENCY
moment ▸ English/French/Italian/German/Spanish/Portuguese/Simplified Chinese ▸ Japanese is not be included now // 1. Prepare NLTagger with .sentimentScore scheme let tagger = NLTagger(tagSchemes: [.sentimentScore]) // 2. Set text you want to analyze tagger.string = text // 3. Get result let (sentiment, _) = tagger.tag(at: text.startIndex, unit: .paragraph, scheme: .sentimentScore) print(sentiment!.rawValue) SENTIMENT ANALYSIS