No project description provided
Project description
Module flike
More information about Flike can be found here.
Installation
Install the flike-predict package with pip.
pip3 install flike-predict
Quick Guide
-
Install the module as described in Installation.
-
Import the module into your code
from flike import *
-
Initialize the
flike-recommend
client by calling theinitialize
function with your API key as a paremeter. -
Call the corresponding functions whenever a user interacts with a content item.
start
when a user starts interacting with a content item.like
when a user seems to like a content item. E.g., in the case of a video, calllike
when the user watched more than 80% of a video.dislike
when a user seems to dislike a content item. E.g., in the case of a video, calldislike
when they stop watching after watching less than 50% of it.
-
Retrieve recommendations for a user by calling
recommend
. -
Filter and sort the recommendations if any constraints need to be considered.
-
Display/Use the recommendation in your application in whatever way applicable.
Functions
dislike(user_id: str, item_id: str)
: Registers a user-started item as 'disliked' by the user.
'Dislike' refers to any action indicating that a user dislikes the content item.
E.g. for a video, this could be a user only watching 5% of the video and not finishing it.
Parameters
----------
user_id : str
The unique identifier of the user
item_id : str
The unique identifier of the content item
inititialize(api_key: str, server_url: str = None, version: str = None)
: Initialize the recommender.
Parameters
----------
api_key : str
Your API Key
server_url : str (optional)
This is only used for internal testing
version : str (optional)
Version of the API to use
like(user_id: str, item_id: str)
: Registers a user-started item as 'liked' by the user.
'Like' refers to any action indicating that a user likes the content item.
E.g. for a video, this could be a user watching more than 85% of the video.
Parameters
----------
user_id : str
The unique identifier of the user
item_id : str
The unique identifier of the content item
recommend(user_id: str, num_item: int)
: Get an array of content items that a user is probable to consume/buy/subscribe/like or similar.
Recommendations are sorted by descending probability of a user 'liking' them.
Parameters
----------
user_id : str
The unique identifier of the user
num_item : str
Number of content items that should be suggested
start(user_id: str, item_id: str, correlation_id: str)
: Registers a user starting to consume/interact with a content item..
Parameters
----------
user_id : str
The unique identifier of the user
item_id : str
The unique identifier of the
corellation_id
The unique identifier of a recommendation
Classes
FlikeException(response: requests.models.Response)
: Exception raised by Flike API.
Attributes
----------
status : str
status code of the error (HTTP error code)
message : str
explanation of the error
### Ancestors (in MRO)
* builtins.Exception
* builtins.BaseException
Recommendation(item_id: str, probability: float)
: Recommendation of a content item for a user
Attributes
----------
item_id : str
Unique identifier of the content item being recommended
probability : str
Probability of a user 'liking' the recommended item
RecommendationsResponse(items: list[flike.Recommendation], correlation_id: str)
: Response to a recommendation request.
Attributes
----------
items : str
Recommendations for a user
correlation_id : str
Unique identifier of the content item being recommended
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file flike-predict-1.0.2.tar.gz
.
File metadata
- Download URL: flike-predict-1.0.2.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
7fdf9beaf39db0958f2d6bddc2a00bb2243d2740ad04eac9bb82aebc7193d7ac
|
|
MD5 |
e3aa13015000fa727cd25486e2e2d7fd
|
|
BLAKE2b-256 |
c6ece54757f5dc0ceddb6942e0a69a411c3de144408d51e9d64ad624ba5d102e
|
File details
Details for the file flike_predict-1.0.2-py3-none-any.whl
.
File metadata
- Download URL: flike_predict-1.0.2-py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
febb667fedfa338f139eca0c0d2ab7da19b509dded30639daecc2ec5bd60c9db
|
|
MD5 |
159a94a4314ccbd3bf27f279c89599fc
|
|
BLAKE2b-256 |
e61dd0fc946694d7b015ef5344e71be852a9df29e9bb45f5829c6820eb1eef08
|