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

(Jeff_L) #1

2. Create the Keras, TensorFlow, Python, Core ML environment:


conda env create

This environment is created based on the environment.yml le for


installing Python 2.7, TensorFlow 1.1, Keras 2.0.4, CoreMLTools 0.6.3,


Pandas and other useful Python packages:


name: SwiftNLC
channels:


  • !!python/unicode
    'defaults'
    dependencies:

  • python=2.

  • pip==9.0.

  • numpy==1.12.

  • jupyter==1.

  • matplotlib==2.0.

  • scikit-learn==0.18.

  • scipy==0.19.

  • pandas==0.19.

  • pillow==4.0.

  • seaborn==0.7.

  • h5py==2.7.

  • pip:

  • tensorflow==1.6.

  • keras==2.1.

  • coremltools==0.

  • nltk==3.2.


NB NLTK is only needed for the createModelWithNLTKEmbedding


Notebook used on initial testing. The nal


createModelWithNSLinguisticTaggerEmbedding does not use NLTK, as


the word embedding is implemented in Swift on the Embedder module


using the NSLinguisticTagger API.


3. Activate the environment (Mac/Linux):


source activate SwiftNLC
Free download pdf