Gorse v0.5 Has been Released
Gorse v0.5 Has been Released
After a year and a half of development, Gorse v0.5 is released. This release includes breaking changes, so it is worth writing an article to introduce the new features and upgrade guide.
New Features
New Data Schema
The
Subscribefield ofUserhas been removed. In the early design, theSubscribefield was used to store tags subscribed by users, but it was not actually used. It is recommended to use External Recommenders to implement business logic driven recommendations like subscriptions.The
Labelsfield ofUserandItemsupports arbitrary JSON objects. On this basis, some recommenders can specify nested fields to use. For example, in item-to-item recommenders, you can specify using theLabels.embeddingembedding vector to calculate item similarity.The
Valuefield has been added to feedback. TheValuefield is used to represent the weight of feedback, such as the percentage of video watching, the rating of goods, etc. On the one hand, positive and negative feedback can be distinguished by setting thresholds based on theValuefield; on the other hand, future updates will utlize theValuefield to better train models. When inserting feedback, you can choose to accumulate (POST) theValue, or overwrite (PUT) the originalValue.
New Recommenders
Latest items are queried directly on the item table. Latest items can be obtained in real time without waiting for the recommender system to sort. With database indexes, the query speed of latest items is fast, and it will be provided as a built-in (no configuration required) recommender.
Added Non-personalized Recommenders, which can sort items according to custom rules. For example, items can be sorted according to item label fields to achieve functions such as "recommend by highest rating" or "recommend by lowest price".
Removed the popular item recommender. Since non-personalized recommenders can fully implement the function of popular item recommender and are more flexible than popular recommender, the popular item recommender and its RESTful API have been removed.
Added Item-to-Item Recommenders to replace the similar item recommender in v0.4. Compared with the similar item recommender, the item-to-item recommender has the following advantages:
- Multiple item-to-item recommender instances can be created.
- The item label fields to be used can be specified.
- Support for similarity calculation based on embedding vectors.
Added User-to-User Recommenders to replace the similar user recommender in v0.4. The advantages of the new algorithm are similar to those of the item-to-item recommender.
Added External Recommenders, which can integrate external business logic into the recommendation pipeline. For example, user subscriptions can be added to the recommendation candidate set to participate in the final sorting. The current implementation of Fetch API is relatively simple, and more functions will be supported in the future.
Other Updates
Other important updates unrelated to the recommendation pipeline will not be listed all here, welcome to find them in the documentation. These updates include but are not limited to:
- Fixed the issue of excessive cache data volume caused by saving cache for each
Category - Console supports OpenID Connect login
- gRPC communication from master node to worker node supports TLS encryption
- SQLite supports cluster deployment (test environment only)
- All recommendation APIs support filtering recommendation results using multiple
Categoryparameters - ...
Upgrade Guide
Configuration Update
Refer to the latest configuration file example to update your configuration file. Major configuration changes include:
- The positive feedback type supports setting expressions for the
Valuefield, for example,read>=3means feedback with read times greater than or equal to 3 is positive feedback, please modify as needed. - Configuration items for popular recommender, similar item recommender, and similar user recommender have been removed, please migrate to non-personalized recommenders, item-to-item recommenders, and user-to-user recommenders.
- The naming and default values of other configuration items may have changed, please compare carefully.
Database Changes
If you are using a MongoDB database, no data migration operations are required. However, relational database (MySQL, Postgres, SQLite) users need to make the following changes:
- Remove the
Subscribefield from the user table; failure to do so will result in user insertion failures. - The
Valuefield andUpdatedfield are added to the feedback table, but Gorse will add these fields automatically. - If the cache database uses Redis, please ensure that the RediSearch and RedisTimeseries modules are configured, otherwise the cache cannot be written.
Warning
If you are not using a MongoDB database, the safest upgrade method is actually to redeploy Gorse v0.5 and re-import data. Although we try our best to ensure backward compatibility of the database, due to changes in data structure, there is still a risk of data corruption.
Conclusion
If you encounter any problems during the upgrade process, please feel free to submit an issue on GitHub, and we will assist you in solving the problem as soon as possible. We look forward to your continued use of the Gorse recommendation system and welcome valuable suggestions and feedback!
