This repository was archived by the owner on Sep 29, 2025. It is now read-only.
Add classifyCategories function for llm scorecard#794
Open
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new LLM-based classifier for question categorizations, adds a sample categories CSV, and updates package dependencies.
- Add a comprehensive sample of categorized questions in CSV format for the classifier.
- Implement
classifyCategories.tswith an OpenAI-powered classifier and inline category definitions. - Reorder and dedupe dependencies in
package.jsonfor the llm-scorecard package.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/scripts/src/llm-scorecard/examples/categories.csv | Add example dataset of questions with dataset, label, and question |
| packages/scripts/src/llm-scorecard/classifyCategories.ts | Create classifyCategories function using makeClassifier |
| packages/scripts/package.json | Reorder and remove duplicate dependency entries |
Comments suppressed due to low confidence (2)
packages/scripts/src/llm-scorecard/classifyCategories.ts:145
- [nitpick] There are no unit tests for
classifyCategories. Adding tests with known prompts and expected categories will help ensure the classifier behaves as intended.
export const classifyCategories = makeClassifier({
packages/scripts/src/llm-scorecard/classifyCategories.ts:145
- Add a JSDoc comment above this export to explain the purpose, input format, and output structure of
classifyCategoriesfor future maintainers.
export const classifyCategories = makeClassifier({
| @@ -0,0 +1,465 @@ | |||
| Dataset,Label,Question, | |||
There was a problem hiding this comment.
The header row ends with an extra comma, which may lead to an unintended empty column when parsing. Please remove the trailing comma so it reads Dataset,Label,Question.
Suggested change
| Dataset,Label,Question, | |
| Dataset,Label,Question |
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Jira: (EAI-1107) Add Question Categorizations to Case Data
Changes