Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/viet2811/uk-travel-recommendation/llms.txt

Use this file to discover all available pages before exploring further.

The Dislike endpoint records a negative interaction for an attraction and updates the user’s preference profile to actively steer it away from the disliked attraction’s characteristics. Unlike the Like endpoint which moves the profile toward an item, the dislike logic uses a vector rejection technique on the embedding components — effectively subtracting the component of the profile that points in the direction of the disliked attraction — and applies a ReLU-floored subtraction on the categorical MHE component so that no dimension of the profile vector is ever driven below zero. This asymmetry between like and dislike update mechanics allows the system to be more conservative in moving away from content than in moving toward it, preserving profile stability while still meaningfully deprioritising unwanted categories. As with likes, the operation is transaction-safe and idempotent-guarded.

Endpoint

FieldValue
MethodPOST
Path/api/recommendations/dislike/{id}
AuthBearer token required
POST http://localhost:8000/api/recommendations/dislike/<attraction_id>
Authorization: Bearer <access_token>

Path Parameters

id
string
required
The unique identifier of the attraction to dislike. This matches the id field returned by the List Recommendations and Search endpoints.Example: /api/recommendations/dislike/blackpool-tower

Request Body

This endpoint does not require a request body.

Profile Vector Update

When a dislike is successfully recorded, the user’s preference profile is updated using the following rules:
Vector ComponentUpdate RuleParameter
labelMHESubtractive with ReLU floor — profile.labelMHE = max(0, profile.labelMHE − item.labelMHE × 0.1)α = 0.1
labelEmbedVector rejection — project out the component along the item’s direction, scaled by rejection factorREJECTION = 0.3
summaryEmbedVector rejection — same rejection technique applied to the summary embedding componentREJECTION = 0.3
Vector rejection works by computing the projection of the profile embedding onto the disliked attraction’s embedding unit vector, then subtracting a fraction (REJECTION = 0.3) of that projection from the profile. This moves the profile away from the disliked attraction’s direction in embedding space without flipping the vector arbitrarily. ReLU floor on the MHE component ensures that categorical preference scores never go negative — a dislike can reduce interest in a category to zero but cannot invert it. The resulting profile vector is normalised after the update.
A profile_delta value — the cosine distance between the profile vector before and after the dislike — is computed and stored on the interaction record. Additionally, after every 10th interaction (likes and dislikes combined), an Intra-List Diversity (ILD) score is computed over the last 10 interactions and stored as a UserRecommendationBatch record for analytics.

Response

200 OK — Dislike recorded successfully

{
  "message": "Preference updated",
  "id": "<attraction_id>"
}
message
string
Confirmation string. Always "Preference updated" on success.
id
string
The id of the attraction that was disliked, echoed back in the response.

400 Bad Request — Already disliked

Returned when a UserInteraction record already exists with liked=False for this user and attraction pair.
{
  "error": "Already disliked"
}
error
string
Error message. Always "Already disliked" when this specific condition is triggered.

Examples

curl -X POST "http://localhost:8000/api/recommendations/dislike/blackpool-tower" \
  -H "Authorization: Bearer <access_token>"

Build docs developers (and LLMs) love