Apple has introduced CoreML2 for ML-related apps. More details can be found at https://developer.apple.com/machine-learning/. There is a specific framework for natural language processing (NLP). There are pre-built APIs for tokenization, identifying a language, parts of speech (POS), named entity recognition, and so on. Custom models can be trained with as well. The use of CoreML models is fast in Apple devices. The data need not leave the device for inference. Most of the TensorFlow models can be converted to CoreML models.