Skip to content

Commit a5cb73d

Browse files
authored
Add demo to zero shot classification (#596)
* add demo to zero shot classification and put it live * removed redundant header
1 parent 3fd158b commit a5cb73d

File tree

3 files changed

+35
-6
lines changed

3 files changed

+35
-6
lines changed

tasks/src/tasksData.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import textGeneration from "./text-generation/data";
2929
import unconditionalImageGeneration from "./unconditional-image-generation/data";
3030
import videoClassification from "./video-classification/data";
3131
import visualQuestionAnswering from "./visual-question-answering/data";
32+
import zeroShotClassification from "./zero-shot-classification/data";
3233
import zeroShotImageClassification from "./zero-shot-image-classification/data";
3334
import { TASKS_MODEL_LIBRARIES } from "./const";
3435

@@ -75,7 +76,7 @@ export const TASKS_DATA: Record<PipelineType, TaskData | undefined> = {
7576
"unconditional-image-generation": getData("unconditional-image-generation", unconditionalImageGeneration),
7677
"visual-question-answering": getData("visual-question-answering", visualQuestionAnswering),
7778
"voice-activity-detection": getData("voice-activity-detection"),
78-
"zero-shot-classification": getData("zero-shot-classification"),
79+
"zero-shot-classification": getData("zero-shot-classification", zeroShotClassification),
7980
"zero-shot-image-classification": getData("zero-shot-image-classification", zeroShotImageClassification),
8081
} as const;
8182

tasks/src/zero-shot-classification/about.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# Zero Shot Classification
2-
31
## About the Task
42

53
Zero Shot Classification is the task of predicting a class that wasn't seen by the model during training. This method, which leverages a pre-trained language model, can be thought of as an instance of [transfer learning](https://www.youtube.com/watch?v=BqqfQnyjmgg) which generally refers to using a model trained for one task in a different application than what it was originally trained for. This is particularly useful for situations where the amount of labeled data is small.

tasks/src/zero-shot-classification/data.ts

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,39 @@ import type { TaskDataCustom } from "../Types";
33
const taskData: TaskDataCustom = {
44

55
datasets: [],
6-
demo: {
7-
inputs: [],
8-
outputs: [],
6+
demo: {
7+
inputs: [
8+
{
9+
label: "Text Input",
10+
content: "Dune is the best movie ever.",
11+
type: "text",
12+
},
13+
{
14+
label: "Candidate Labels",
15+
content: "CINEMA, ART, MUSIC",
16+
type: "text",
17+
},
18+
19+
],
20+
outputs: [
21+
{
22+
type: "chart",
23+
data: [
24+
{
25+
label: "CINEMA",
26+
score: 0.90,
27+
},
28+
{
29+
label: "ART",
30+
score: 0.10,
31+
},
32+
{
33+
label: "MUSIC",
34+
score: 0.00,
35+
},
36+
],
37+
},
38+
],
939
},
1040
metrics: [],
1141
models: [

0 commit comments

Comments
 (0)