Text Classification

May 5, 2020 ยท View on GitHub

Categorize text.

  • Markdown instruction containing instructions
  • List of categories with descriptions
  • Classify into one or more categories.

Schema

{
  "interface": {
    "type": "text_classification",
    "description"?: MarkdownDescription,
    "multiple": false,
    "labels": [
      {
        "id": "gryffindor",
        "displayName": "Gryffindor",
        "description"?: "Daring, strong nerve and chivalry."
      },
      {
        "id": "slytherin",
        "displayName": "Slytherin",
        "description"?: "Cunning and ambitious. Possibly dark wizard."
      }
    ]
  },
  "samples": [
    // These are all different types of task data that are acceptable
    {
      "document": "Harry",
      "annotation": "gryffindor"
    },
    {
      "document": "Malfoy",
    }
  ]
}

Annotation

Annotation will be either the label id or an array of label ids depending interface.multiple.

// Input Data
{
  "document": "Harry",
  "annotation": "gryffindor"
}

For multiple classifications, the annotation will be shown as an array.

// Input Data
{
  "document": "Could you label me?",
  "annotation": ["question", "about-labeling"]
}