We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f88b841 commit bf45836Copy full SHA for bf45836
1 file changed
server/convergent/routers/analysis.py
@@ -167,9 +167,12 @@ async def read_comments_with_consensus(
167
168
votes_matrix, user_index, comment_index = get_vote_matrix(conversation)
169
170
- user_clusters = np.zeros(len(user_index), dtype=int)
+ user_clusters = np.full(len(user_index), -1, dtype=int) # Default to -1 for unclustered users
171
for cluster in conversation.clusters:
172
- user_clusters[user_index[cluster.user]] = cluster.cluster
+ if cluster.user in user_index:
173
+ user_clusters[user_index[cluster.user]] = cluster.cluster
174
+ else:
175
+ raise ValueError(f"Cluster user {cluster.user} not found in user_index")
176
177
consensus_comments = []
178
for comment in conversation.comments:
0 commit comments