Skip to content

[AI] Define Topic Score Update Logic #31

@sajz

Description

@sajz

Topic Analysis and Score Updates Logic:

  1. Identify Relevant Topics:

    • When a new message is posted, analyze its semantic content using SemanticVector.
    • Match the message’s semantic content with existing topics in the channel’s ASSOCIATED_WITH relationships by comparing keywords and the semantic_vector.
  2. Amplify Scores for Matching Topics:

    • For each existing topic in the channel that appears in the message:
      • Apply the amplify_score function to calculate a small score_delta, increasing the topic’s overall_score based on relevance or semantic similarity.
      • Update message_count and refresh the last_updated timestamp.
  3. Create New Topics:

    • For topics in the message that don’t already exist in the channel:
      • Create a new Topic node if it doesn’t exist, or establish an ASSOCIATED_WITH relationship to the channel.
      • Initialize fields like overall_score, message_count, and last_updated to begin tracking the topic’s relevance in this channel.
  4. Diminish Scores for Unmentioned Topics:

    • For all existing topics that aren’t referenced in the message:
      • Use the diminish_score function to apply a gradual score_delta reduction, decreasing the overall_score based on the score_decay_rate.
      • This decay reflects the gradual fading relevance of less active topics in the channel.

Suggested Function Names:

  1. Amplify Function (amplify_score):

    • amplify_score: This function calculates a small positive score_delta to incrementally increase the overall_score based on semantic similarity, with gradual progression towards a maximum limit.
  2. Diminish Function (diminish_score):

    • diminish_score: This function calculates a small negative score_delta to gradually decrease the overall_score, applying a decay that starts slowly and accelerates toward zero for topics not mentioned over time.

--
Example

Topic Initial Score New Message Weight Updated Score Score Delta
topic_0 0.5 0.6 0.505 +0.005
topic_1 0.5 0.2 0.485 -0.015
topic_2 0.5 0.45 0.4975 -0.0025

The updated table includes the Score Delta for each topic, showing how much the overall_score changed based on the new message weights:

  • Topic 0: Initial Score = 0.5, New Message Weight = 0.6, Updated Score = 0.505, Score Delta = +0.005
  • Topic 1: Initial Score = 0.5, New Message Weight = 0.2, Updated Score = 0.485, Score Delta = -0.015
  • Topic 2: Initial Score = 0.5, New Message Weight = 0.45, Updated Score = 0.4975, Score Delta = -0.0025

Adjusted score_delta Function for Topic overall_score Updates

Objective: Enhance the calculation of score_delta for updating the overall_score of topics in a channel, ensuring incremental changes are context-sensitive based on the initial score. This adjustment will use a non-linear function that:

  • Limits rapid increments for very low (e.g., < 0.2) and very high (e.g., > 0.8) scores.
  • Promotes normal growth between 0.2 and 0.8.
  • Applies to both amplifying and diminishing the topic's overall_score.

Rationale:

  • Stability of High-Scored Topics: Topics with an overall_score above 0.8 should not reach 1 too rapidly. This ensures dominant topics stabilize and do not skew the topic mapping unfairly.
  • Controlled Growth for Low-Scored Topics: Topics with an overall_score below 0.2 should have limited growth to prevent sudden amplification due to noise or isolated messages.
  • Consistent Normal Growth: The function should provide a standard growth pattern for scores between 0.2 and 0.8 to reflect typical topic relevance.

Function Design: Use a modified logistic function to calculate score_delta, allowing gradual increases that slow at the boundaries (near 0 and 1):

Topic Initial Score New Message Weight Score Delta Updated Score
topic_0 0.2 0.6 +0.000949 0.200949
topic_1 0.7 0.2 -0.022020 0.677980
topic_2 0.5 0.45 -0.001250 0.498750

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions