MCPcopy Create free account
hub / github.com/ChatLab/ChatLab / computeNonFriendScore

Function computeNonFriendScore

packages/core/src/query/contact-scoring.ts:170–193  ·  view source on GitHub ↗
(components: NonFriendScoreComponents)

Source from the content-addressed store, hash-verified

168}
169
170export function computeNonFriendScore(components: NonFriendScoreComponents): ContactScoringResult {
171 const coOccurrenceScore = clamp01(components.coOccurrenceScore)
172 const commonGroupScore = clamp01(components.commonGroupScore)
173 const replyInteractionScore = clamp01(components.replyInteractionScore)
174 const score =
175 NON_FRIEND_SCORE_WEIGHTS.coOccurrence * coOccurrenceScore +
176 NON_FRIEND_SCORE_WEIGHTS.commonGroup * commonGroupScore +
177 NON_FRIEND_SCORE_WEIGHTS.replyInteraction * replyInteractionScore
178
179 return {
180 score,
181 scoreBreakdown: {
182 coOccurrenceScore,
183 commonGroupScore,
184 replyInteractionScore,
185 commonGroupCount: components.commonGroupCount,
186 coOccurrenceCount: components.coOccurrenceCount,
187 coOccurrenceRawScore: components.coOccurrenceRawScore,
188 replyInteractionCount: components.replyInteractionCount,
189 repliesFromOwnerToContact: components.repliesFromOwnerToContact,
190 repliesFromContactToOwner: components.repliesFromContactToOwner,
191 },
192 }
193}
194
195export function computeNonFriendScores<T extends NonFriendScoreInput>(
196 items: readonly T[]

Callers 1

computeNonFriendScoresFunction · 0.85

Calls 1

clamp01Function · 0.85

Tested by

no test coverage detected