API reference¶
Core¶
recommend(interaction_history: list[tuple[UUID, int]], count: int = 10) -> list[UUID]
¶
Synchronously predict the best recommendations for given interaction_history
Parameters:
-
interaction_history(list[tuple[UUID, int]]) –list of
(UUID, int)pairs, whereUUIDis the video id, andintis the reaction (1- like,-1- dislike,0- neutral) -
count(int, default:10) –number of recommended videos
Returns:
-
list[UUID]–UUIDs of recommended videos
Source code in src/rutube_cold_start/main.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | |
recommend_async(interaction_history: list[tuple[UUID, int]], count: int = 10) -> list[UUID]
async
¶
Asynchronous wrapper around the recommend function
Parameters:
-
interaction_history(list[tuple[UUID, int]]) –list of
(UUID, int)pairs, whereUUIDis the video id, andintis the reaction (1- like,-1- dislike,0- neutral) -
count(int, default:10) –number of recommended videos
Returns:
-
list[UUID]–UUIDs of recommended videos
Source code in src/rutube_cold_start/main.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | |