Skip to content

Instantly share code, notes, and snippets.

@thosakwe
Created May 5, 2018 02:47
Show Gist options
  • Save thosakwe/bea3883ed88fb773ff13857f458e7edb to your computer and use it in GitHub Desktop.
Save thosakwe/bea3883ed88fb773ff13857f458e7edb to your computer and use it in GitHub Desktop.
*cries*
models {
// Define models (functions)
line(x: Num) -> Num
// Struct?
nlp(text: String, len: Num) -> (category: String, confidence: Num)
opts { cache }
}
train {
line -> linearRegression(sigmoid, learningRate=0.3)
nlp -> bayes(naive), rank, something
google -> @nlp, pageRank
}
main (args) {
// Expression macro
let text = args.get(0)
let result = nlp(text, text.length)
return result
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment