Great Work Labs
Models / Understand text

Spot

Named entity recognition
spot-1

People, organizations and places, with character offsets.

Price$0.02 per 1,000 texts
Speed (our servers)19 to 35 ms
LanguagesArabic, Chinese, Dutch, English, French, German, Italian, Latvian, Portuguese, Spanish
InputText, batches up to 64
Built onDavlan/distilbert-base-multilingual-cased-ner-hrl (AFL-3.0)

Spot finds the people, organizations, locations and dates in a text and returns each one with its exact character offsets, so you can highlight, link or index them.

It reads ten languages out of the box. For personal data like emails, phone numbers and IDs, use Veil instead.

Use it

curl https://labs.greatwork.company/v1/run \
  -H "Authorization: Bearer $GWL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "spot-1",
  "input": "Satya Nadella met with Ursula von der Leyen in Brussels to discuss Microsoft'\''s new data centers in Ireland."
}'

Set GWL_API_KEY to a key from your dashboard. The bare name spot works too and follows new versions.

Options

input: A string, or an array of up to 64 strings to run as a batch.

NameTypeDefaultWhat it does
typesstring[]
person | organization | location | date
Only return these entity types.
thresholdnumber0.5Score at or above which an entity is returned.

Output

FieldTypeMeaning
spansobject[]Entities in order: type, text, start, end (character offsets, end exclusive), score.
countsobjectHow many of each type.

Every response wraps this in {"id", "model", "output", "usage": {"units", "unit", "cost_usd"}, "latency_ms"}. Send an array as input and output is an array in the same order.

Examples

News sentence

{
  "model": "spot-1",
  "input": "Satya Nadella met with Ursula von der Leyen in Brussels to discuss Microsoft's new data centers in Ireland."
}
{
  "spans": [
    {
      "type": "person",
      "text": "Satya Nadella",
      "start": 0,
      "end": 13,
      "score": 0.9994
    },
    {
      "type": "person",
      "text": "Ursula von der Leyen",
      "start": 23,
      "end": 43,
      "score": 0.9999
    },
    {
      "type": "location",
      "text": "Brussels",
      "start": 47,
      "end": 55,
      "score": 0.9998
    },
    {
      "type": "organization",
      "text": "Microsoft",
      "start": 67,
      "end": 76,
      "score": 0.9999
    },
    {
      "type": "location",
      "text": "Ireland",
      "start": 99,
      "end": 106,
      "score": 0.9999
    }
  ],
  "counts": {
    "person": 2,
    "location": 2,
    "organization": 1
  }
}

Captured on our production servers: 35 ms, 1 text, $0.00002.

Email

{
  "model": "spot-1",
  "input": "Hi Priya, Marcus from Northwind Traders here. We'll be in Austin on the 14th if you want to meet at the Domain."
}
{
  "spans": [
    {
      "type": "person",
      "text": "Priya",
      "start": 3,
      "end": 8,
      "score": 0.9983
    },
    {
      "type": "person",
      "text": "Marcus",
      "start": 10,
      "end": 16,
      "score": 0.9984
    },
    {
      "type": "organization",
      "text": "Northwind Traders",
      "start": 22,
      "end": 39,
      "score": 0.9998
    },
    {
      "type": "location",
      "text": "Austin",
      "start": 58,
      "end": 64,
      "score": 0.9994
    }
  ],
  "counts": {
    "person": 2,
    "organization": 1,
    "location": 1
  }
}

Captured on our production servers: 30 ms, 1 text, $0.00002.

Spanish

{
  "model": "spot-1",
  "input": "Gabriel García Márquez nació en Aracataca y trabajó para El Espectador en Bogotá."
}
{
  "spans": [
    {
      "type": "person",
      "text": "Gabriel García Márquez",
      "start": 0,
      "end": 22,
      "score": 0.9999
    },
    {
      "type": "location",
      "text": "Aracataca",
      "start": 32,
      "end": 41,
      "score": 0.9997
    },
    {
      "type": "organization",
      "text": "El Espectador",
      "start": 57,
      "end": 70,
      "score": 0.9995
    },
    {
      "type": "location",
      "text": "Bogotá",
      "start": 74,
      "end": 80,
      "score": 0.9998
    }
  ],
  "counts": {
    "person": 1,
    "location": 2,
    "organization": 1
  }
}

Captured on our production servers: 19 ms, 1 text, $0.00002.

Good for

  • Link company and people names in articles
  • Build a who-was-mentioned index for transcripts
  • Pre-fill CRM fields from emails
  • Find locations to geocode

Limits and caveats

  • Four types only: person, organization, location, date.
  • Product names and brands are often missed or called organizations.

Pricing

$0.02 per 1,000 texts. One unit per text up to 2,000 characters; longer texts are split into 2,000-character chunks and each chunk is a unit. Failed calls aren't charged, and a call never costs more than its estimate (POST /v1/estimate tells you before you run it).

Built on

Davlan/distilbert-base-multilingual-cased-ner-hrl, 135M (DistilBERT multilingual) parameters. License: AFL-3.0. We run it on our servers with our own long-text chunking and score aggregation.