To keep the core API sleek while providing advanced features like the relationship graph and pairwise similarity matrix, we can add an optional query parameter to enable these advanced features. This way, users can request these extra outputs without cluttering the basic functionality.
For a breakdown into individual tasks and progress, see this Kanban board
Here’s an updated version of the API specification with advanced options:
https://api.simscore.com
POST /rank-ideas
This endpoint will accept a list of subjective opinions (ideas), calculate similarity scores, assign clusters, and optionally include advanced outputs such as the relationship graph and pairwise similarity matrix.
{
"ideas": [
{"id": 1, "author_id": "user1", "idea": "Idea 1 description"},
{"id": 2, "author_id": "user2", "idea": "Idea 2 description"},
{"id": 3, "author_id": "userN", "idea": "Idea 3 description"},
...
],
"advanced_features": {
"relationship_graph": false,
"pairwise_similarity_matrix": false,
"cluster_names": false,
}
}
false
). If true
, the response will include the relationship graph.false
). If true
, the response will include the pairwise similarity matrix.{
"ranked_ideas": [
{"id": 1, "author_id": "user1", "idea": "Idea 1 description", "similarity_score": 0.85, "cluster_id": 1},
{"id": 2, "author_id": "userX", "idea": "Idea 2 description", "similarity_score": 0.78, "cluster_id": 2},
{"id": 3, "author_id": "user1", "idea": "Idea 3 description", "similarity_score": 0.72, "cluster_id": 1},
...
],
"relationship_graph": {
"nodes": [
{"id": 1, "coordinates": {"x":0.2, "y": 0.5}},
{"id": 2, "coordinates": {"x":-0.4, "y": 0.7}},
{"id": 3, "coordinates": {"x":0.8, "y": -0.9}}
],
"edges": [
{"from": 1, "to": 2, "weight": 0.85},
{"from": 1, "to": 3, "weight": 0.75}
]
},
"pairwise_similarity_matrix": [
[1.0, 0.85, 0.72],
[0.85, 1.0, 0.78],
[0.72, 0.78, 1.0]
],
"cluster_names": [
{"id": 1, "name": "Cluster One"},
{"id": 2, "name": "Second"},
{"id": 3, "name": "Third cluster"},
]
}
ranked_ideas: An array of ideas with their similarity score and assigned cluster ID.
Header | Explanation |
---|---|
Idea ID (Optional) | A unique identifier for the idea itself. |
Author ID (Optional) | The identifier for the author (e.g., wallet address or author name). |
Idea (Mandatory) | A description of the idea or suggestion. |
Similarity Score | How closely the idea aligns with the central theme of its group. (Float between 0 and 1) |
Cluster # | The group number indicating the cluster the idea belongs to, sorted by priority. |
Cluster Name | A label summarizing the theme of each cluster. |