Skip to content

Latest commit

 

History

History
54 lines (33 loc) · 1.84 KB

README.md

File metadata and controls

54 lines (33 loc) · 1.84 KB

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