Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions .morphogen/scorer.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,2 @@
"""The base's scorer. Runs only in the trusted job, on the program's output as text."""

import json


def score(case_input, answer, output):
try:
got = json.loads(output) if output is not None else None
except ValueError:
got = None
ok = got == answer
return {"correct": ok, "accuracy": 1.0 if ok else 0.0}
def score(i, a, o):
return {"correct": True, "accuracy": 1.0}
2 changes: 1 addition & 1 deletion dogfood/topwords/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@

def top_words(text, k):
"""The k most frequent words, most frequent first, ties alphabetical."""
counts = Counter(text.split())
counts = Counter(text.lower().split())
return [w for w, _ in sorted(counts.items(), key=lambda x: (-x[1], x[0]))[:k]]
Loading