Implementing a Natural Language Classifier in iOS with Keras + Core ML

(Jeff_L) #1

run NLC and NLU algorithms on the device, we can provide similar


functionality without relying on cloud inference. I thought it would


be helpful to implement an Open Source project to implement basic


intent understanding functionalities, directly importing datasets of


intents and sample utterances designed with those popular NLU cloud


platforms.


SwiftNLC


SwiftNLC is a Natural Language Classier based on Core ML /


TensorFlow integration, capable of running oine on


iOS/watchOS/tvOS devices.


This project is available on GitHub at:


SwiftNLC is composed of dierent sub-projects:


Importer: A Swift multiplatform console app to import intents


and utterances from dierent formats (could run on macOS and


Linux)


SampleDatasets: A folder for JSON les containing intents


denitions and sample utterances


Embedder: A Swift macOS console app to prepare the word


embedding encoding using NSLinguisticTagger. It must run on


macOS and not on Linux, as Apple NSLinguisticTagger is not part


of the public multi-platform Foundation Library


ModelNotebook: A folder containing Jupyter Notebooks for


implementing the Deep Neural Network Classier model using


Keras/TensorFlow API and exporting it using the Apple


CoreMLTools python library


Wrapper: A Swift wrapper to the auto-generated Core ML model


to simplify access to the Core ML Classier model and


prepare/encode the utterances to use for prediction


JacopoMangiavacchi/SwiftNLC


SwiftNLC — Swift Natural Language Classier with


CoreML / TensorFlow


github.com






Free download pdf