Abracadabra Recommender API 是一种适用于任何编码语言(包括 Python)的非常灵活的解决方案。
基本上它是一个推荐算法即服务库。设置非常简单:您只需将 HTTP 调用(可以使用 Django 进行)发送到 API 端点 url 即可训练您的模型并接收建议。 View the docs how.
借助 Abracadabra Recommender API,在使用 Python 时,您首先将数据添加到您的模型中:
# These code snippets use an open-source library. http://unirest.io/python
response = unirest.post("https://noodlio-abracadabra-recommender-systems-v1.p.mashape.com/add/subjects?recommenderId=rec1&subjectId=See+docs",
headers={
"X-Mashape-Key": "<required>",
"Accept": "application/json",
"Content-Type": "application/json"
}
)
然后您通过评分或喜欢主题(例如电影)来训练模型:
# These code snippets use an open-source library. http://unirest.io/python
response = unirest.post("https://noodlio-abracadabra-recommender-systems-v1.p.mashape.com/rate/subject?recommenderId=rec1&subjectId=gameofthrones&subjectWeight=10&userId=user1",
headers={
"X-Mashape-Key": "<required>",
"Accept": "application/json",
"Content-Type": "application/json"
}
)
完成后,您会收到基于基于内容、协作或混合过滤的建议,如下所示:
# These code snippets use an open-source library. http://unirest.io/python
response = unirest.post("https://noodlio-abracadabra-recommender-systems-v1.p.mashape.com/recommend?method=content&recommenderId=rec1&userId=user1",
headers={
"X-Mashape-Key": "<required>",
"Accept": "application/json",
"Content-Type": "application/json"
}
)
您可以查看更多其他语言的示例,包括Angular、React、Javascript、NodeJS、Curl、Java、Python、Objective-C、Ruby、@ 987654337@... 在API homepage.