Gorse 是一个用 Go 编写的开源推荐系统。Gorse 旨在成为一个通用的开源推荐系统,可以快速引入各种在线服务。通过将物品、用户和交互数据导入 Gorse,系统将自动训练模型为每个用户生成推荐。

martinhoch42 1b413125b8 Enable redis+cluster (#807) 7 月之前
.circleci 5d4857efc6 setup arm64 unit testing CircleCI (#668) 1 年之前
.github 554c2b2bae update DockerHub description (#625) 1 年之前
assets 0af6dfa495 update README for v0.4 (#421) 2 年之前
base 3bfac13d87 fix(worker): fix concurrent access problem of rand.Rand (#696) 1 年之前
client c2eb94ac2f Fix gorse go client (#804) 8 月之前
cmd d94217fb18 support log files rotation (#659) 1 年之前
config 1b413125b8 Enable redis+cluster (#807) 7 月之前
master ab030fd42b fix(worker): fix index out of range caused by duplicate labels (#700) 1 年之前
model 3d802b36db support avx512 (#533) 2 年之前
protocol 3d802b36db support avx512 (#533) 2 年之前
server 09ad3aa8cd feat: get more details from the recommendation (#796) 9 月之前
storage 860277563c encode cursor by base64 (#612) 1 年之前
worker 80ed93d929 fix(worker): fix concurrent map iteration and map write (#698) 1 年之前
.dockerignore 6f265b4bee support dynamic jobs allocation (#513) 2 年之前
.gitignore 92e2404720 add CORS to rest server and config (#550) 2 年之前
.golangci.yml 7ab4d7206d upgrade to Go 1.20 (#622) 1 年之前
CODE_OF_CONDUCT.md e953109be7 Create CODE_OF_CONDUCT.md 3 年之前
CONTRIBUTING.md 762f21f315 support YAML/JSON configuration file format (#604) 1 年之前
LICENSE 0af6dfa495 update README for v0.4 (#421) 2 年之前
README.md 24b593be49 update docs link (#583) 1 年之前
codecov.yml 28427b29f1 disable codecov/patch 3 年之前
docker-compose.yml 762f21f315 support YAML/JSON configuration file format (#604) 1 年之前
go.mod d94217fb18 support log files rotation (#659) 1 年之前
go.sum d94217fb18 support log files rotation (#659) 1 年之前

README.md

Gorse Recommender System Engine

build codecov Go Report Card GoDoc Discord Twitter Follow

Gorse is an open-source recommendation system written in Go. Gorse aims to be a universal open-source recommender system that can be quickly introduced into a wide variety of online services. By importing items, users, and interaction data into Gorse, the system will automatically train models to generate recommendations for each user. Project features are as follows.

  • Multi-source: Recommend items from Popular, latest, user-based, item-based and collaborative filtering.
  • AutoML: Search the best recommendation model automatically in the background.
  • Distributed prediction: Support horizontal scaling in the recommendation stage after single node training.
  • RESTful APIs: Expose RESTful APIs for data CRUD and recommendation requests.
  • Online evaluation: Analyze online recommendation performance from recently inserted feedback.
  • Dashboard: Provide GUI for data management, system monitoring, and cluster status checking.

Quick Start

The playground mode has been prepared for beginners. Just set up a recommender system for GitHub repositories by the following commands.

  • Linux/macOS:
curl -fsSL https://gorse.io/playground | bash
  • Docker:
docker run -p 8088:8088 zhenghaoz/gorse-in-one --playground

The playground mode will download data from GitRec and import it into Gorse. The dashboard is available at http://localhost:8088.

After the "Find neighbors of items" task is completed on the "Tasks" page, try to insert several feedbacks into Gorse. Suppose Bob is a frontend developer who starred several frontend repositories in GitHub. We insert his star feedback to Gorse.

read -d '' JSON << EOF
[
    { \"FeedbackType\": \"star\", \"UserId\": \"bob\", \"ItemId\": \"vuejs:vue\", \"Timestamp\": \"2022-02-24\" },
    { \"FeedbackType\": \"star\", \"UserId\": \"bob\", \"ItemId\": \"d3:d3\", \"Timestamp\": \"2022-02-25\" },
    { \"FeedbackType\": \"star\", \"UserId\": \"bob\", \"ItemId\": \"dogfalo:materialize\", \"Timestamp\": \"2022-02-26\" },
    { \"FeedbackType\": \"star\", \"UserId\": \"bob\", \"ItemId\": \"mozilla:pdf.js\", \"Timestamp\": \"2022-02-27\" },
    { \"FeedbackType\": \"star\", \"UserId\": \"bob\", \"ItemId\": \"moment:moment\", \"Timestamp\": \"2022-02-28\" }
]
EOF

curl -X POST http://127.0.0.1:8088/api/feedback \
   -H 'Content-Type: application/json' \
   -d "$JSON"

Then, fetch 10 recommended items from Gorse. We can find that frontend-related repositories are recommended for Bob.

curl http://127.0.0.1:8088/api/recommend/bob?n=10

Example outputs:
[
 "mbostock:d3",
 "nt1m:material-framework",
 "mdbootstrap:vue-bootstrap-with-material-design",
 "justice47:f2-vue",
 "10clouds:cyclejs-cookie",
 "academicpages:academicpages.github.io",
 "accenture:alexia",
 "addyosmani:tmi",
 "1wheel:d3-starterkit",
 "acdlite:redux-promise"
]

The exact output might be different from the example since the playground dataset changes over time.

For more information:

Architecture

Gorse is a single-node training and distributed prediction recommender system. Gorse stores data in MySQL, MongoDB, Postgres, or ClickHouse, with intermediate results cached in Redis, MySQL, MongoDB and Postgres.

  1. The cluster consists of a master node, multiple worker nodes, and server nodes.
  2. The master node is responsible for model training, non-personalized item recommendation, configuration management, and membership management.
  3. The server node is responsible for exposing the RESTful APIs and online real-time recommendations.
  4. Worker nodes are responsible for offline recommendations for each user.

In addition, the administrator can perform system monitoring, data import and export, and system status checking via the dashboard on the master node.

Contributors

Any contribution is appreciated: report a bug, give advice or create a pull request. Read CONTRIBUTING.md for more information.

Acknowledgments

gorse is inspired by the following projects: