Semantic Models
SemanticModels
SemanticModels Class
This class implements semantic models for graph-based recommendation systems. Semantic models enhance traditional graph-based methods by incorporating semantic information, such as item content or user profiles, into the recommendation process.
Attributes:
Name | Type | Description |
---|---|---|
semantic_graph |
Graph
|
The graph structure enriched with semantic information. |
embedding_dim |
int
|
Dimensionality of semantic embeddings. |
similarity_threshold |
float
|
Threshold for determining similarity between nodes. |
max_iterations |
int
|
Maximum number of iterations for convergence in semantic algorithms. |
Methods:
Name | Description |
---|---|
build_semantic_graph |
Constructs a semantic graph by integrating semantic information into the existing graph structure, enhancing node representations. |
compute_semantic_similarity |
Computes similarity scores between nodes using semantic information, improving recommendation accuracy. |
recommend |
Generates top-N recommendations for a given user by analyzing the semantic graph structure and node similarities. |
update_semantic_info |
Updates the semantic information in the graph, allowing for dynamic and context-aware recommendations. |
Source code in engines/contentFilterEngine/graph_based_algorithms/semantic_models.py
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
|
find_optimal_path(start_city)
Find the optimal path using the run_optimal_path function.
Source code in engines/contentFilterEngine/graph_based_algorithms/semantic_models.py
43 44 45 46 47 |
|
set_graph(graph)
Set the graph for semantic models.
Source code in engines/contentFilterEngine/graph_based_algorithms/semantic_models.py
37 38 39 40 41 |
|