Changes between Version 4 and Version 5 of AdvancedTopics


Ignore:
Timestamp:
06/15/26 02:31:12 (27 hours ago)
Author:
231141
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AdvancedTopics

    v4 v5  
    99== 1. Personalized Recommendations ==
    1010
    11 This is the recommendation system that recommends open task requests to workers that have the most similar completed tasks. For this purpose we first embedded the open task requests and then as a starting point for our system we embedded three task requests that resulted in a completed task for each worker. We found this number of tasks enough as a starting point for our app. We built these embeddings with the script [attachment:embed_taskrequests.py] and we used a table to store these vectors:
    12 
     11This is the recommendation system that recommends open task requests to workers that have the most similar completed tasks. For this purpose we first embedded the open task requests and then as a starting point for our system we embedded three task requests that resulted in a completed task for each worker. We found this number of tasks enough as a starting point for our app. We built these embeddings and we used a table to store these vectors:
     12{{{
     13#!sql
     14INSERT INTO worker_recommendation_profiles
     15(
     16    worker_id,
     17    preference_embedding,
     18    updated_at
     19)
     20WITH ranked_tasks AS
     21(
     22    SELECT
     23        o.worker_id,
     24        o.task_request_id,
     25        ROW_NUMBER() OVER
     26        (
     27            PARTITION BY o.worker_id
     28            ORDER BY
     29                COALESCE(t.updated_at, t.created_at) DESC
     30        ) AS rn
     31    FROM Task t
     32    JOIN Offer o
     33        ON o.id = t.offer_id
     34    WHERE t.status = 'COMPLETED'
     35)
     36SELECT
     37    rt.worker_id,
     38    AVG(tre.embedding),
     39    CURRENT_TIMESTAMP
     40FROM ranked_tasks rt
     41JOIN task_request_embeddings tre
     42    ON tre.task_request_id = rt.task_request_id
     43WHERE rt.rn <= 3
     44GROUP BY rt.worker_id
     45ON CONFLICT (worker_id)
     46DO UPDATE SET
     47    preference_embedding = EXCLUDED.preference_embedding,
     48    updated_at = CURRENT_TIMESTAMP;
     49}}}
    1350{{{
    1451#!sql