All Projects → Flight-School → Programming Language Classifier

Flight-School / Programming Language Classifier

Licence: mit
An example of how to use CreateML in Xcode 10 to create a Core ML model for classifying text

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Programming Language Classifier

createml-playgrounds
Create ML playgrounds for building machine learning models. For developers and data scientists.
Stars: ✭ 82 (-52.33%)
Mutual labels:  classifier, coreml
Showandtell
A Show And Tell implementation for iOS 11.0 based on CoreML
Stars: ✭ 155 (-9.88%)
Mutual labels:  coreml
Parse English
English (natural language) parser
Stars: ✭ 137 (-20.35%)
Mutual labels:  natural-language
Freelb
Adversarial Training for Natural Language Understanding
Stars: ✭ 147 (-14.53%)
Mutual labels:  natural-language
Awesome Decision Tree Papers
A collection of research papers on decision, classification and regression trees with implementations.
Stars: ✭ 1,908 (+1009.3%)
Mutual labels:  classifier
Ios Coreml Yolo
Almost Real-time Object Detection using Apple's CoreML and YOLO v1 -
Stars: ✭ 153 (-11.05%)
Mutual labels:  coreml
Cocoaai
🤖 The Cocoa Artificial Intelligence Lab
Stars: ✭ 134 (-22.09%)
Mutual labels:  coreml
Facenet mtcnn to mobile
convert facenet and mtcnn models from tensorflow to tensorflow lite and coreml (使用 TFLite 将 FaceNet 和 MTCNN 移植到移动端)
Stars: ✭ 166 (-3.49%)
Mutual labels:  coreml
Speech signal processing and classification
Front-end speech processing aims at extracting proper features from short- term segments of a speech utterance, known as frames. It is a pre-requisite step toward any pattern recognition problem employing speech or audio (e.g., music). Here, we are interesting in voice disorder classification. That is, to develop two-class classifiers, which can discriminate between utterances of a subject suffering from say vocal fold paralysis and utterances of a healthy subject.The mathematical modeling of the speech production system in humans suggests that an all-pole system function is justified [1-3]. As a consequence, linear prediction coefficients (LPCs) constitute a first choice for modeling the magnitute of the short-term spectrum of speech. LPC-derived cepstral coefficients are guaranteed to discriminate between the system (e.g., vocal tract) contribution and that of the excitation. Taking into account the characteristics of the human ear, the mel-frequency cepstral coefficients (MFCCs) emerged as descriptive features of the speech spectral envelope. Similarly to MFCCs, the perceptual linear prediction coefficients (PLPs) could also be derived. The aforementioned sort of speaking tradi- tional features will be tested against agnostic-features extracted by convolu- tive neural networks (CNNs) (e.g., auto-encoders) [4]. The pattern recognition step will be based on Gaussian Mixture Model based classifiers,K-nearest neighbor classifiers, Bayes classifiers, as well as Deep Neural Networks. The Massachussets Eye and Ear Infirmary Dataset (MEEI-Dataset) [5] will be exploited. At the application level, a library for feature extraction and classification in Python will be developed. Credible publicly available resources will be 1used toward achieving our goal, such as KALDI. Comparisons will be made against [6-8].
Stars: ✭ 155 (-9.88%)
Mutual labels:  classifier
Natural Regex
Create regex from natural language
Stars: ✭ 147 (-14.53%)
Mutual labels:  natural-language
Scene Text Recognition
Scene text detection and recognition based on Extremal Region(ER)
Stars: ✭ 146 (-15.12%)
Mutual labels:  classifier
Awesome Ml
Discover, download, compile & launch different image processing & style transfer CoreML models on iOS.
Stars: ✭ 142 (-17.44%)
Mutual labels:  coreml
Emlearn
Machine Learning inference engine for Microcontrollers and Embedded devices
Stars: ✭ 154 (-10.47%)
Mutual labels:  classifier
Mnist draw
This is a sample project demonstrating the use of Keras (Tensorflow) for the training of a MNIST model for handwriting recognition using CoreML on iOS 11 for inference.
Stars: ✭ 139 (-19.19%)
Mutual labels:  coreml
Naive Bayes Classifier
yet another general purpose naive bayesian classifier.
Stars: ✭ 162 (-5.81%)
Mutual labels:  classifier
Ssdmobilenet coreml
Real-time object-detection using SSD on Mobilenet on iOS using CoreML, exported using tf-coreml
Stars: ✭ 136 (-20.93%)
Mutual labels:  coreml
Gestureai Coreml Ios
Hand-gesture recognition on iOS app using CoreML
Stars: ✭ 145 (-15.7%)
Mutual labels:  coreml
Awesome Sentence Embedding
A curated list of pretrained sentence and word embedding models
Stars: ✭ 1,973 (+1047.09%)
Mutual labels:  natural-language
Coreml Survival Guide
Source code for the book Core ML Survival Guide
Stars: ✭ 168 (-2.33%)
Mutual labels:  coreml
Textlint
The pluggable natural language linter for text and markdown.
Stars: ✭ 2,158 (+1154.65%)
Mutual labels:  natural-language

Programming Language Classifier

An example of how to use CreateML and Xcode 10 to train a CoreML model that is used by the Natural Language framework to classify the programming language of source code.

let code = """
struct Plane: Codable {
    var manufacturer: String
    var model: String
    var seats: Int
}
"""

let url = Bundle.main.url(forResource: "Classifier",
                          withExtension: "mlmodelc")!
let model = try! NLModel(contentsOf: url)
model.predictedLabel(for: code) // Swift

Requirements

  • macOS Mojave Beta
  • Xcode 10 Beta

These are available for Apple Developer account members to download at https://developer.apple.com/download/

Usage

This project includes a pre-trained programming language classifier model. To see it in action, open Classifier Demo.playground, run the playground with the Assistant editor showing the Live View, and then drag and drop a source code file. The model will predict the language of the file based on its contents.

Screenshot of Classifier Example

Training Instructions

  • Clone and setup the repository by running the following commands:
$ git clone https://github.com/flight-school/Programming-Language-Classifier.git`
$ cd Programming-Language-Classifier
$ git submodule update --init
  • Open Trainer.swift in an editor and fill in the placeholder values for destinationPath and corpusPath:
$ open ./Trainer.swift
  • Run Trainer.swift and wait for the model to be trained (on a 2017 MacBook Pro, this took a few minutes):
$ swift ./Trainer.swift
  • Compile the generated .mlmodel bundle using the following command:
$ xcrun coremlc compile path/to/ProgrammingLanguageClassifier.mlmodel .
  • Move the compiled .mlmodelc bundle into the Resources directory of Classifier Demo.playground, replacing any existing resource.

License

MIT

See code-corpora for licensing information of the included projects.

About Flight School

Flight School is a new book series for Swift developers. Each month, we'll explore an essential part of iOS, macOS, and Swift development through concise, focused books.

If you'd like to get in touch, feel free to message us on Twitter (@flightdotschool) or email us at mailto:[email protected].

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].