Last active
June 14, 2024 01:11
-
-
Save calebdre/6ccdbaa753f067cc94ddd8b62d8909e6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const evaluateCodeSearch = async ( | |
files: FileInfo[], | |
numSamples: number = 15, | |
k: number = 5 | |
) => { | |
// create validation set | |
const validationSet: ValidationQuery[] = await generateValidationQueries(files, numSamples) | |
const resultSet: QueryResult[][] = [] | |
// run each validation query against the code search system | |
for (let query of validationSet) { | |
const queryStr = query.query | |
const result = await runQuery(queryStr, files) | |
resultSet.push(result) | |
} | |
// calculate evaluation score | |
const score = calculateMAPAtK(validationSet, resultSet) | |
return score | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment