Skip to content

hyparam/hylang

Repository files navigation

HyLang

HyLang

workflow status mit license dependencies coverage

A stupidly small and fast programming language detection model.

Usage

import { detectLanguage } from 'hylang'

const input = `
  function square(x) {
    return x * x
  }
`
console.log(`Predicted language: ${detectLanguage(input)}`)

Accuracy

Hylang eval is sampled from the starcoderdata dataset.

Hylang is 30.4kb packed and achieves 74.5% accuracy.

Implementation

The language detector is implemented as a bag of words model trained on the starcoderdata dataset.

Training is done in python with torch. Model weights are exported to params.json so they can be used in javascript.

About

A stupidly small and fast programming language detection model

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published