metarank
0.7.10
Metarank:即時個人化即服務
Metarank 是一項開源排名服務。它可以幫助您建立個人化的語義/神經搜尋和推薦。
如果您只是想開始,請嘗試:
借助 Metarank,您可以使現有的搜尋和推薦變得更加聰明:
Metarank很快:
節省您的開發時間:
Metarank 幫助您建立進階搜尋和推薦排名系統:
部落格文章:
聚會和會議演講:
您可以在 demo.metarank.ai 上玩 Metarank 演示:
演示本身和使用的資料都是開源的,您可以在 github 儲存庫中取得訓練事件和設定檔的副本。
讓我們展示如何在不到一分鐘的時間內透過基於 LambdaMART 的重新排名開始個人化內容:
我們將使用我們的演示中使用的ranklens資料集,因此只需下載資料文件
curl -O -L https://github.com/metarank/metarank/raw/master/src/test/resources/ranklens/events/events.jsonl.gz
我們將再次使用演示中的設定檔。它利用記憶體存儲,因此不需要其他依賴項。
curl -O -L https://raw.githubusercontent.com/metarank/metarank/master/src/test/resources/ranklens/config.yml
最後一步,我們將使用 Metarank 的standalone
模式,將訓練和運行 API 結合到一個命令中:
docker run -i -t -p 8080:8080 -v $( pwd ) :/opt/metarank metarank/metarank:latest standalone --config /opt/metarank/config.yml --data /opt/metarank/events.jsonl.gz
當 Metarank 開始並仔細研究數據時,您將看到一些有用的輸出。完成此操作後,您可以向localhost:8080
發送請求以獲得個人化結果。
在這裡,我們將透過點擊其中一部電影並觀察結果來與幾部電影互動。
首先,讓我們看看在與 Metarank 互動之前提供的初始輸出
# get initial ranking for some items
curl http://localhost:8080/rank/xgboost
-d ' {
"event": "ranking",
"id": "id1",
"items": [
{"id":"72998"}, {"id":"67197"}, {"id":"77561"},
{"id":"68358"}, {"id":"79132"}, {"id":"103228"},
{"id":"72378"}, {"id":"85131"}, {"id":"94864"},
{"id":"68791"}, {"id":"93363"}, {"id":"112623"}
],
"user": "alice",
"session": "alice1",
"timestamp": 1661431886711
} '
# {"item":"72998","score":0.9602446652021992},{"item":"79132","score":0.7819134441404151},{"item":"68358","score":0.33377910321385645},{"item":"112623","score":0.32591281190727805},{"item":"103228","score":0.31640256043322723},{"item":"77561","score":0.3040782705414116},{"item":"94864","score":0.17659007036183608},{"item":"72378","score":0.06164568676567339},{"item":"93363","score":0.058120639770243385},{"item":"68791","score":0.026919880032451306},{"item":"85131","score":-0.35794106000271037},{"item":"67197","score":-0.48735167237049154}
# tell Metarank which items were presented to the user and in which order from the previous request
# optionally, we can include the score calculated by Metarank or your internal retrieval system
curl http://localhost:8080/feedback
-d ' {
"event": "ranking",
"fields": [],
"id": "test-ranking",
"items": [
{"id":"72998","score":0.9602446652021992},{"id":"79132","score":0.7819134441404151},{"id":"68358","score":0.33377910321385645},
{"id":"112623","score":0.32591281190727805},{"id":"103228","score":0.31640256043322723},{"id":"77561","score":0.3040782705414116},
{"id":"94864","score":0.17659007036183608},{"id":"72378","score":0.06164568676567339},{"id":"93363","score":0.058120639770243385},
{"id":"68791","score":0.026919880032451306},{"id":"85131","score":-0.35794106000271037},{"id":"67197","score":-0.48735167237049154}
],
"user": "test2",
"session": "test2",
"timestamp": 1661431888711
} '
現在,讓我們與項目
93363
進行交互
# click on the item with id 93363
curl http://localhost:8080/feedback
-d ' {
"event": "interaction",
"type": "click",
"fields": [],
"id": "test-interaction",
"ranking": "test-ranking",
"item": "93363",
"user": "test",
"session": "test",
"timestamp": 1661431890711
} '
現在,Metarank 將對項目進行個性化設置,響應中項目的順序將會不同
# personalize the same list of items
# they will be returned in a different order by Metarank
curl http://localhost:8080/rank/xgboost
-d ' {
"event": "ranking",
"fields": [],
"id": "test-personalized",
"items": [
{"id":"72998"}, {"id":"67197"}, {"id":"77561"},
{"id":"68358"}, {"id":"79132"}, {"id":"103228"},
{"id":"72378"}, {"id":"85131"}, {"id":"94864"},
{"id":"68791"}, {"id":"93363"}, {"id":"112623"}
],
"user": "test",
"session": "test",
"timestamp": 1661431892711
} '
# {"items":[{"item":"93363","score":2.2013986484185124},{"item":"72998","score":1.1542776301073876},{"item":"68358","score":0.9828904282341605},{"item":"112623","score":0.9521647429731446},{"item":"79132","score":0.9258841742518286},{"item":"77561","score":0.8990921381835769},{"item":"103228","score":0.8990921381835769},{"item":"94864","score":0.7131600718467729},{"item":"68791","score":0.624462038351694},{"item":"72378","score":0.5269765094008626},{"item":"85131","score":0.29198666089255343},{"item":"67197","score":0.16412780810560743}]}
查看更深入的快速入門完整參考。
如果您有任何疑問,請隨時加入我們的 Slack!
該項目是在 Apache 2.0 許可證下發布的,如許可證文件中所指定。