CS7IS3 Assignment 2 - Evaluation & Leaderboard Guide

This guide shows you how to run the evaluation workflow and automatically submit your MAP scores to the leaderboard.

πŸ“‹ Required Files

Before running the evaluation, ensure your repository has these files and directories. You can download them from the links below:

Required Files (Root Directory):

Required Files (Tools Directory):

  • βœ… tools/evaluate.py - Python script for evaluating search results

Required Files (GitHub Workflow):

Required Directory:

  • βœ… Assignment Two/ - Dataset directory containing:
    • fbis/ - FBIS documents
    • fr94/ - Federal Register documents (subdirectories 01-12)
    • ft/ - Financial Times documents (subdirectories ft911-ft944)
    • latimes/ - LA Times documents
    • dtds/ - DTD files for document parsing
      • fbisdtd.dtd
      • fr94dtd
      • ftdtd
      • latimesdtd.dtd
    • πŸ“₯ Download Assignment Two dataset

πŸ’‘ Tip: After downloading, extract the Assignment Two directory to your repository root. For other files, place them in the exact locations shown in the File Structure Reference section below.

Your Java Source Code:

  • βœ… src/main/java/App.java
  • βœ… src/main/java/Indexer.java
  • βœ… src/main/java/Searcher.java

Required for leaderboard submission:

  • GitHub Secrets: LEADERBOARD_API_URL and LEADERBOARD_API_TOKEN
  • Optional: TEAM_NAME - Your team name (if not set, repository name will be used)
  • Optional: TEAM_MEMBERS - Names of team members, comma-separated (e.g., β€œJohn Doe, Jane Smith”)

πŸš€ Quick Start

Step 1: Configure GitHub Secrets (One-time setup)

To submit scores to the leaderboard, add these secrets to your repository:

  1. Go to your repository β†’ Settings β†’ Secrets and variables β†’ Actions

  2. Click β€œNew repository secret” and add:

    Secret 1:

    • Name: LEADERBOARD_API_URL
    • Value: https://leaderboard.qrameez.in

    Secret 2:

    • Name: LEADERBOARD_API_TOKEN
    • Value: (provided by your instructor)

    Secret 3 (Optional):

    • Name: TEAM_NAME
    • Value: Your team name (e.g., β€œTeam Lucene”, β€œQuery Rangers”)
    • If not set, your repository name will be used as the team name

    Secret 4 (Optional):

    • Name: TEAM_MEMBERS
    • Value: Names of team members, comma-separated (e.g., β€œJohn Doe, Jane Smith, Bob Johnson”)
    • If not set, your GitHub username will be used

⚠️ Note: Without LEADERBOARD_API_URL and LEADERBOARD_API_TOKEN, the evaluation will still run but won't submit to the leaderboard.

Step 2: Run the Evaluation

The evaluation runs automatically when you push code to your repository. You can also trigger it manually:

  1. Go to Actions tab
  2. Select β€œCS7IS3 Assignment 2 - Search Engine Evaluation”
  3. Click β€œRun workflow” β†’ β€œRun workflow”

Step 3: Check Results

  1. View workflow output:

    • Go to Actions tab β†’ Click the latest workflow run
    • Check the β€œSubmit metrics to leaderboard” step (should show βœ…)
    • View detailed metrics in the workflow summary
  2. View leaderboard:

    • Visit: https://leaderboard.qrameez.in
    • Find your team and members' names with MAP score

πŸ“Š What the Evaluation Does

The workflow automatically:

  1. Validates your project structure (checks for required files)
  2. Builds your project (mvn clean package)
  3. Indexes documents from Assignment Two/ directory
  4. Searches all topics from the topics file
  5. Evaluates results using qrels.assignment2.part1
  6. Submits scores to leaderboard (if secrets are configured)

πŸ“ Understanding Your Scores

The evaluation calculates these metrics:

  • MAP (Mean Average Precision) - Primary ranking metric (0.0 to 1.0, higher is better)
  • P@5 - Precision at 5 (fraction of top 5 results that are relevant)

The leaderboard ranks by MAP score.

πŸ”„ Updating Your Score

Every time you:

  • Push new code
  • Create a pull request
  • Manually trigger the workflow

Your leaderboard entry automatically updates with the latest scores. No extra steps needed!

πŸ› Troubleshooting

Workflow fails at β€œBuild and Test Search Engine”

Check:

  • βœ… pom.xml exists in root directory
  • βœ… Java source files are in src/main/java/
  • βœ… topics file exists in root directory
  • βœ… Assignment Two/ directory exists with dataset files

Fix: Add missing files and push again.

Workflow fails at β€œEvaluate Results”

Check:

  • βœ… tools/evaluate.py exists in your repository
  • βœ… qrels.assignment2.part1 file exists in root directory
  • βœ… runs/student.run file was generated (check previous step logs)

Fix: Ensure tools/evaluate.py is present and the search step completed successfully.

β€œSubmit metrics to leaderboard” step is skipped

Problem: Step shows as gray (skipped)

Solution:

  • Go to Settings β†’ Secrets and variables β†’ Actions
  • Verify both LEADERBOARD_API_URL and LEADERBOARD_API_TOKEN are set
  • Ensure URL is exactly: https://leaderboard.qrameez.in (no trailing slash)

Scores show 0.0 on leaderboard

Possible causes:

  • Search engine didn't produce results
  • runs/student.run file is empty
  • Build or search step failed

Solution:

  • Check workflow logs in the β€œBuild and Test Search Engine” step
  • Verify your search engine produces output
  • Ensure evaluation completed successfully

Scores not appearing on leaderboard

Check:

  1. Did β€œSubmit metrics to leaderboard” step succeed? (βœ… green checkmark)
  2. Wait 10-30 seconds and refresh the leaderboard page
  3. Verify secrets are correct

If still not working:

  • Check workflow logs for error messages
  • Verify API URL in secrets matches: https://leaderboard.qrameez.in

πŸ“š File Structure Reference

Your repository should look like this:

your-repo/
β”œβ”€β”€ pom.xml
β”œβ”€β”€ topics
β”œβ”€β”€ qrels.assignment2.part1
β”œβ”€β”€ src/
β”‚   └── main/
β”‚       └── java/
β”‚           β”œβ”€β”€ App.java
β”‚           β”œβ”€β”€ Indexer.java
β”‚           └── Searcher.java
β”œβ”€β”€ Assignment Two/
β”‚   β”œβ”€β”€ fbis/
β”‚   β”œβ”€β”€ fr94/
β”‚   β”‚   β”œβ”€β”€ 01/
β”‚   β”‚   β”œβ”€β”€ 02/
β”‚   β”‚   └── ... (subdirectories 03-12)
β”‚   β”œβ”€β”€ ft/
β”‚   β”‚   β”œβ”€β”€ ft911/
β”‚   β”‚   β”œβ”€β”€ ft921/
β”‚   β”‚   └── ... (other ft subdirectories)
β”‚   β”œβ”€β”€ latimes/
β”‚   └── dtds/
β”‚       β”œβ”€β”€ fbisdtd.dtd
β”‚       β”œβ”€β”€ fr94dtd
β”‚       β”œβ”€β”€ ftdtd
β”‚       └── latimesdtd.dtd
β”œβ”€β”€ tools/
β”‚   └── evaluate.py
└── .github/
    └── workflows/
        └── evaluation.yml

🎯 Best Practices

  1. Test locally first:

    mvn clean package
    

    Fix build errors before pushing.

  2. Check workflow logs:

    • Always review the Actions tab after pushing
    • Look for warnings or errors in each step
  3. Keep secrets secure:

    • Never commit secrets to your code
    • Never share your LEADERBOARD_API_TOKEN
  4. Push frequently:

    • The leaderboard shows your latest successful evaluation
    • Push after each improvement to update your score

πŸ”— Quick Reference

  • Leaderboard: https://leaderboard.qrameez.in
  • Workflow: .github/workflows/evaluation.yml
  • Secrets: Settings β†’ Secrets and variables β†’ Actions
  • Actions Tab: https://github.com/YOUR_USERNAME/YOUR_REPO/actions

πŸ“ž Contact

If you have any questions or encounter issues, please contact:

Rameez Qureshi
πŸ“§ moquresh@tcd.ie


Good luck with your search engine implementation! πŸš€