Latest 1.0.0
Homepage https://github.com/toddkramer/DocumentClassifier
License MIT
Platforms ios 11.0, osx 10.13, tvos 11.0, watchos 4.0

CocoaPods Version Swift Platform

Overview

DocumentClassifier is a Swift framework for classifying documents into one of five categories (Business, Entertainment, Politics, Sports, and Technology). It uses a CoreML model trained with 1,500 news articles from the BBC.

Features

  • iOS 11.0+, macOS 10.13+, tvOS 11.0+, watchOS 4.0+
  • 100% Test Coverage
  • Best CV Score: 0.965333333333

Usage

Swift 4 Released (Sample Article)

let text = articleText
guard let classification = classifier.classify(text) else { return }
print(classification.prediction) // Technology: 0.42115752953489294
print(classification.allResults) // Business: 0.141, Entertainment: 0.138, Politics: 0.113, Sports: 0.187, Technology: 0.421

Installation

Note: DocumentClassifier requires Swift 4 (and Xcode 9) or greater.

Targets using DocumentClassifier must support embedded Swift frameworks.

CocoaPods

CocoaPods is a centralized dependency manager for Cocoa projects. To install
DocumentClassifier with CocoaPods:

  1. Make sure the latest version of CocoaPods is installed.

  2. Add DocumentClassifier to your Podfile:
use_frameworks!

pod 'DocumentClassifier', '1.0.0'
  1. Run pod install.

Example App

NewsClassifier is an example app using the framework.

NewsClassifierExample

Model

Author

Todd Kramer, [email protected]

References

Latest podspec

{
    "name": "DocumentClassifier",
    "version": "1.0.0",
    "license": "MIT",
    "summary": "Swift framework for document classification using a Core ML model.",
    "homepage": "https://github.com/toddkramer/DocumentClassifier",
    "social_media_url": "http://twitter.com/_toddkramer",
    "authors": "Todd Kramer",
    "source": {
        "git": "https://github.com/toddkramer/DocumentClassifier.git",
        "tag": "1.0.0"
    },
    "module_name": "DocumentClassifier",
    "platforms": {
        "ios": "11.0",
        "osx": "10.13",
        "tvos": "11.0",
        "watchos": "4.0"
    },
    "source_files": "Sources/*.{swift,mlmodel}",
    "pushed_with_swift_version": "4.0"
}

Pin It on Pinterest

Share This