https://github.com/mu29/dessert
A lightweight recommendation engine for Ruby apps using Redis
https://github.com/mu29/dessert
recommendation recommendation-engine recommendation-system recommender-system redis ruby
Last synced: 3 months ago
JSON representation
A lightweight recommendation engine for Ruby apps using Redis
- Host: GitHub
- URL: https://github.com/mu29/dessert
- Owner: mu29
- License: mit
- Created: 2019-03-10T13:16:31.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-03-28T06:03:04.000Z (over 7 years ago)
- Last Synced: 2025-10-07T12:32:22.559Z (9 months ago)
- Topics: recommendation, recommendation-engine, recommendation-system, recommender-system, redis, ruby
- Language: Ruby
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Dessert
A lightweight recommendation engine for Ruby apps using Redis. Inspired by [DEVIEW presentation](https://www.slideshare.net/deview/261-52784785) and [recommendable](https://github.com/davidcelis/recommendable) gem.
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'dessert'
```
And then execute:
$ bundle
Or install it yourself as:
$ gem install dessert
## Important Note
* It is highly recommended to use background jobs like [Resque](https://github.com/defunkt/resque) or [Sidekiq](https://github.com/mperham/sidekiq) when calling `like` / `unlike` methods, because there is a bit of computation work.
* Every _rater_ and _ratable items_ should have an `id` method.
* Hidden items will not be recommended.
## Usage
1. Include `Dessert::Rater` on your `User` model.
```ruby
class User
include Dessert::Rater
attr_accessor :id
def initialize(id)
@id = id
end
...
end
```
2. Define any class that can be rated.
```ruby
class Movie
attr_accessor :id
def initialize(id)
@id = id
end
end
```
3. Like, Unlike, Hide, Unhide items.
```ruby
user = User.new(1)
movie = Movie.new(483)
user.like(movie)
user.unlike(movie)
user.hide(movie)
user.unhide(movie)
```
4. Now recommend to users!
```ruby
user = User.new(1)
user.recommended_for(klass: Movie, offset: 0, limit: 10)
```
## Contributing
Bug reports and pull requests are welcome on [GitHub](https://github.com/mu29/dessert/issues).
## Author
InJung Chung / [@mu29](https://yeoubi.net)
## License
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).