Skip to content

Commit

Permalink
added new submission (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
hetulvp authored Apr 21, 2024
2 parents 83643da + 0ceb6fc commit 48d42b6
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 4 deletions.
7 changes: 4 additions & 3 deletions session_2/challenge/leaderboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ Check [participation guide](how_to_participate.md).
<center>

<!-- leader-board-begins -->
| Rank | Name | Solution | Accuracy % |
|-------:|:------------|:-----------------------------------------------------------------------------------------------------------------|-------------:|
| 1 | XYZ | [baseline](https://github.com/infocusp/llm_seminar_series/blob/main/session_2/challenge/submissions/baseline.py) | 100 |
| Rank | Name | Solution | Accuracy % |
|-------:|:------------|:---------------------------------------------------------------------------------------------------------------------------|-------------:|
| 1 | XYZ | [baseline](https://github.com/infocusp/llm_seminar_series/blob/main/session_2/challenge/submissions/baseline.py) | 100 |
| 2 | Hetul Patel | [baseline_copy](https://github.com/infocusp/llm_seminar_series/blob/main/session_2/challenge/submissions/baseline_copy.py) | 50 |
<!-- leader-board-ends -->

</center>
2 changes: 1 addition & 1 deletion session_2/challenge/scripts/evaluate_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import tqdm
from scripts import model, registry
from submissions import * # noqa: F401, F403
from submissions import baseline # noqa: F401
from submissions import baseline, baseline_copy # noqa: F401


def evaluate(dataset: list[tuple[str, bool]], prompt_name: str):
Expand Down
34 changes: 34 additions & 0 deletions session_2/challenge/submissions/baseline_copy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
"""Baseline submission for the job description classification challenge."""

from scripts import base, registry


@registry.register()
class Baseline(base.PromptSubmission):
"""Baseline submission."""

def build_prompt(self, job_description: str) -> str:
"""Builds a prompt for classification of job description."""
prompt = f"""
Say "YES" if the given job description is suitable for
a freshers other wise say "NO".
{job_description}.
"""
return prompt.strip()

def parse_response(self, model_response: str) -> bool:
"""Parses a response from the LLM to decide the final answer.
Args:
model_response: Output of the llm for the given prompt.
Returns:
True is the job_description is for a fresher otherwise False.
"""
model_response = model_response.lower()
if "yes" in model_response:
return True
return False

0 comments on commit 48d42b6

Please sign in to comment.