https://github.com/boyter/golangvectorspace
An implementation of the Vector Space model in GoLang
https://github.com/boyter/golangvectorspace
golang golang-library vector-space-model
Last synced: about 1 year ago
JSON representation
An implementation of the Vector Space model in GoLang
- Host: GitHub
- URL: https://github.com/boyter/golangvectorspace
- Owner: boyter
- License: mit
- Created: 2017-02-17T02:25:17.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2023-06-09T04:30:08.000Z (almost 3 years ago)
- Last Synced: 2025-03-25T12:21:30.667Z (about 1 year ago)
- Topics: golang, golang-library, vector-space-model
- Language: Go
- Size: 8.79 KB
- Stars: 8
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# README #
An implementation of the VectorSpace model in Golang. Pass in two strings and get back a number indicating how similar they are.
[](https://github.com/boyter/golangvectorspace/)
Usage like so,
```
var concordance1 = Concordance("Go has a lightweight test framework composed of the go test command and the testing package.")
var concordance2 = Concordance("Package testing provides support for automated testing of Go packages. It is intended to be used in concert with the go test command, which automates execution of any function of the form.")
// value of got will be 0.48211825989991874
got := Relation(concordance1, concordance2)
```
See tests for other examples.
To benchmark,
```
go test -bench .
```
On a late 2013 Macbook Pro 2.6 GHz Intel Core i5
```
BenchmarkRelation-4 1000000 2364 ns/op
BenchmarkRelation-4 1000000 2396 ns/op
BenchmarkRelation-4 1000000 2318 ns/op
```
Coverage
```
go test -cover .
ok github.com/boyter/golangvectorspace 0.006s coverage: 95.7% of statements
```