Class NegativeTrainingDumper

java.lang.Object
org.ek9lang.assist.NegativeTrainingDumper

public class NegativeTrainingDumper extends Object
Outputs negative training examples as JSONL for LLM fine-tuning. Each NegativeExample produces 1-3 training entries:
  1. "What's wrong with this code?" — always generated
  2. "How do I fix Exxxxx?" — when howToFix is non-empty
  3. "How does EK9 differ from {language}?" — for each language comparison
Output format is mlx_lm chat JSONL with system/user/assistant roles.
  • Constructor Details

    • NegativeTrainingDumper

      public NegativeTrainingDumper()
  • Method Details

    • writeTrainingData

      public int writeTrainingData(List<NegativeExample> examples, Path outputDir) throws IOException
      Write negative training data with stratified 90/10 train/valid split by category.
      Parameters:
      examples - the negative examples to output
      outputDir - the directory to create (e.g., ./ek9_negative_training_data)
      Returns:
      the total number of JSONL entries written
      Throws:
      IOException
    • buildTrainingEntries

      Build all training entries for a single negative example.