BoredLabsHQ / Concord

Concord is an open-source AI plugin designed to connect community members to relevant conversations
GNU General Public License v3.0
2 stars 3 forks source link

[AI] Evaluate and Optimize BERT Using the Custom Dataset #16

Open sajz opened 2 weeks ago

sajz commented 2 weeks ago

Objective

Develop code to evaluate the BERT topic modeling model using the custom dataset. Iteratively improve the model to align its output with our predefined topics, enhancing its accuracy and effectiveness.

Description

Steps to Follow

  1. Prepare the Evaluation Environment:

    • Ensure the custom dataset is properly formatted and accessible.
    • Set up the necessary libraries and dependencies for running the BERT model if you add more parameters.
  2. Initial Model Evaluation:

    • Run the BERT topic modeling model on the custom dataset.
    • Collect the model's output, including assigned topics for each message.
  3. Calculate Simple Accuracy

    • Compare Predictions:
      • For each message, note if the predicted topic matches the actual topic.
    • Compute Accuracy: Accuracy = (Number of Correct Assignments / Total Number of Messages) × 100%

      • Example: If 13 out of 15 messages are correctly assigned: Accuracy = (13 / 15) × 100% ≈ 86.7%
  4. Assess Topic Coherence Visually

    • Review Grouped Messages:
      • For each topic, read through the assigned messages.
      • Determine if the messages share a common theme or concept.
    • Identify Issues:
      • Note any topics where messages seem out of place or unrelated.
  5. Analyze Results:

    • Identify patterns in misclassified messages.
    • Evaluate how well the model handles overlapping topics.
    • Determine if certain topics are consistently confused.
  6. Model Optimization:

    • Adjust Preprocessing:
      • Experiment with different text preprocessing techniques (e.g., stemming vs. lemmatization).
      • Update stop-word lists or add domain-specific stop words.
    • Tune Model Parameters:
      • Modify the number of topics.
      • Adjust hyperparameters like learning rate, batch size, or embedding dimensions.
  7. Iterative Testing:

    • Rerun the model after each adjustment.
    • Document changes and their impact on evaluation metrics.
    • Continue iterating until performance meets predefined thresholds.
  8. Document Findings and Recommendations:

    • Summarize the optimization process and results in your PR.
    • Highlight key improvements and remaining challenges.
    • Provide recommendations for further enhancements (do we need to work on improving or creating new testing data set etc).

Validation Criteria

Expected Deliverables