Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Classification example #164

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Classification example #164

wants to merge 6 commits into from

Conversation

pcdeadeasy
Copy link
Contributor

Added a new example to support classification using a simple schema file and pre-defined classes.

examples/classification/src/classificationSchema.ts Outdated Show resolved Hide resolved
Comment on lines +12 to +13
#.vscode
#**/.vscode/*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't want these removed - if you need an exception for the root .vscode/launch.json, I'd add that.

],
"compounds": [
{
"name": "Debug All Projects",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is a realistic task to have. I'd get rid of it.

"version": "0.2.0",
"configurations": [
{
"name": "sentiment-wsl",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need wsl-specific tasks here? People should just enter the directory from within WSL if that's what they want.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's makes it easier to debug from the root. You need a separate config for WSL if you are debugging in that environment using VSCODE.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, really? Even if you're using the WSL extension?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I tried this out locally - my experience is that externalTerminal didn't seem to work at all, regardless of whether I was running in WSL or not. Instead, only integratedTerminal worked across both.

So I think that matches what I recommended elsewhere - that all the WSL-oriented tasks should be the defaults, and there shouldn't be any sort of variant. If that's not matching your experience, we can jump on a call and run through it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, let’s sync on Monday. I want to check the configuration on windows.

// Process requests interactively or from the input file specified on the command line
processRequests("🤗> ", process.argv[2], async (request) => {
const initClasses: string = JSON.stringify(classes, undefined);
const fullRequest: string = `Classify "${request}" using the following classification table:\n${initClasses}\n`;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few things about the classification example feels off.

First, this seems far too similar to the sentiment example. The biggest difference is the custom prompt - but it very well may be the case that a custom prompt needs a custom translator.

Then there is the fact that we're effectively doing a look-up - but if you have that information, then why do you need things like a description anyhow?

If you have a fixed set of items, you could describe that directly in the schema, right? Or you would just use embeddings to fetch the most similar one?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The way I look at it is the sentiment example is a special case of the classifier example. Another way of doing this would be to use a custom translator but we do not need it as the translate method has a promptPreamble parameter.

Yes, I could also describe it in the schema as well but that idea is to keep the data (classes) separate from the schema. What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants