guesslang-go 🔍
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: