Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/FurqanSoftware/too
Simple recommendation engine implementation built on top of Redis
https://github.com/FurqanSoftware/too
go recommendation-engine redis
Last synced: 7 days ago
JSON representation
Simple recommendation engine implementation built on top of Redis
- Host: GitHub
- URL: https://github.com/FurqanSoftware/too
- Owner: FurqanSoftware
- License: bsd-3-clause
- Created: 2014-06-07T10:24:12.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2022-11-26T07:33:52.000Z (almost 2 years ago)
- Last Synced: 2024-08-01T04:02:18.142Z (3 months ago)
- Topics: go, recommendation-engine, redis
- Language: Go
- Homepage:
- Size: 10.7 KB
- Stars: 113
- Watchers: 5
- Forks: 11
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-golang-ai - too
README
# Too
[![Build Status](https://drone.io/github.com/hjr265/too/status.png)](https://drone.io/github.com/hjr265/too/latest)
Too is a simple recommendation engine built on top of Redis in Go.
## Installation
Install Too using the go get command:
$ go get github.com/hjr265/too
The only dependencies are Go distribution and [Redis](http://redis.io).
## Usage
```go
te, err := too.New("redis://localhost", "movies")
if err != nil {
log.Fatal(err)
}te.Likes.Add("Sonic", "The Shawshank Redemption")
te.Likes.Add("Sonic", "The Godfather")
te.Likes.Add("Sonic", "The Dark Knight")
te.Likes.Add("Sonic", "Pulp Fiction")te.Likes.Add("Mario", "The Godfather")
te.Likes.Add("Mario", "The Dark Knight")
te.Likes.Add("Mario", "The Shawshank Redemption")
te.Likes.Add("Mario", "The Prestige")
te.Likes.Add("Mario", "The Matrix")te.Likes.Add("Peach", "The Godfather")
te.Likes.Add("Peach", "Inception")
te.Likes.Add("Peach", "Fight Club")
te.Likes.Add("Peach", "WALL·E")
te.Likes.Add("Peach", "Princess Mononoke")te.Likes.Add("Luigi", "The Prestige")
te.Likes.Add("Luigi", "The Dark Knight")items, _ := te.Suggestions.For("Luigi", 2)
for _, item := range items {
fmt.Println(item)
}// Output:
// The Shawshank Redemption
// The Matrix
```
### Batch Operations``` go
te, err := too.New("redis://localhost", "movies")
if err != nil {
log.Fatal(err)
}te.Likes.Batch([]too.BatchRaterOp{
{
User: "Sonic",
Items: []too.Item{
"The Shawshank Redemption",
"The Godfather",
"The Dark Knight",
"Pulp Fiction",
},
},
{
User: "Mario",
Items: []too.Item{
"The Godfather",
"The Dark Knight",
"The Shawshank Redemption",
"The Prestige",
"The Matrix",
},
},
{
User: "Peach",
Items: []too.Item{
"The Godfather",
"Inception",
"Fight Club",
"WALL·E",
"Princess Mononoke",
},
},
}, true) // The last command is about auto update the similars and Suggestions table
```## Documentation
- [Reference](http://godoc.org/github.com/hjr265/too)
## Contributing
Contributions are welcome.
## License
Too is available under the [BSD (3-Clause) License](http://opensource.org/licenses/BSD-3-Clause).
## Inspiration
This project is inspired by the very existence of the awesome project [Recommendable](http://davidcel.is/recommendable/).