Skip to content

Instantly share code, notes, and snippets.

@ikwattro
Last active June 25, 2019 07:55
Show Gist options
  • Save ikwattro/cedb5eca256ee3448d328d595036c8d8 to your computer and use it in GitHub Desktop.
Save ikwattro/cedb5eca256ee3448d328d595036c8d8 to your computer and use it in GitHub Desktop.
API hackathon

## Hackathon API docs

In the same idea as dbpedia spotlight, the Hume API will provide an endpoint to let people run the entity linking process of a text and retrieve associated results.

### Annotate text

POST /entitylinking/annotate

Request body :

{
  "text": "Some text here",
  "confidence": 0.7,
  "all_candidates": true
}

Response body :

{
  "uuid": "123-ff",
  "text": "Some text here",
  "createdAt": "2019...",
  "createdBy": {
    "uuid": "2000-01-02T12:34:56+00:00",
    "name": "Jan Jan"
  }
}

### Retrieve annotations of an AnnotatedDocument

GET /entitylinking/documents/{uuid}/mentions

Response Body

[
  {
    "uuid": "54d42b1a-cd31-4819-9e46-5cba56240771",
    "textMatch": {
      "text": "The Good Place",
      "range": {
        "start": 85,
        "end": 98,
        "length": 14
      }
    },
    "type": "SYSTEM_MENTION",
    "status": "ACCEPTED",
    "entity": {
      "value": "The Good Place",
      "type": "Movie",
      "link": "https://en.wikipedia.org/wiki/The_Good_Place"
    }
  }
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment