Skip to content

robherley/guesslang-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

guesslang-go 🔍

GoDoc Test

Go port of yoeo/guesslang. Detects programming language of source code using a deep learning model.

Setup

Dependencies

Requires libtensorflow C API.

On macOS, it can be installed with homebrew:

brew install libtensorflow

Alternatively, for Linux-based systems:

script/install-libtensorflow

Install

go get github.com/robherley/guesslang-go

See example usage in examples/main.go

Caveats

To work around some of the limitations of the Go TensorFlow bindings (and the wrapper library)1, the SavedModel is embeded in the binary and when a Guesser is initialized, it temporarily writes the model to a directory (and removes it after).

So, in order to use this package, you must at least have a writeable temporary directory that aligns with Go's os.TempDir().

Acknowledgements

Powered by:

Inspired by:

Footnotes

  1. https://github.com/galeone/tfgo/issues/44#issuecomment-841806254

About

Go port of guesslang to detect programming languages with deep learning

Topics

Resources

License

Stars

Watchers

Forks