Relations

We distinguish three types of relations:

  • attribute relations: For example, good in a good pizza or the pizza is good is an attribute of pizza.

  • verbal relations: For example, eat in John ate a pizza is a relation between John and pizza.

  • parent relations: For example, beer is an alcoholic drink, which in turn is a drink (Only some accounts have access to this feature, in general it requires access to GKB.)

See the Relation object reference page for more information.

Sample call

You can easily try it yourself:

curl -X POST https://api.geneea.com/v3/analysis \
-H 'Authorization: user_key <YOUR USER KEY>' \
-H 'Content-Type: application/json' \
-d '{
    "id": "1",
    "text": "The trip to London was amazing. But I would not recommend the food. Especially the pizza was terrible.",
    "analyses": ["relations"],
    "domain": "voc-hospitality"
}'

# On Windows, use \" instead of " and " instead of '

You should get the following response:

{
  "version": "3.2.1",
  "id": "1",
  "language": {"detected": "en"},
  "entities": [
    {"id": "e0", "gkbId": "HSP-10210", "stdForm": "food", "type": "food"},
    {"id": "e1", "gkbId": "HSP-1091", "stdForm": "pizza", "type": "food"}
  ],
  "relations": [
    {
      "id": "r0", "name": "amazing", "textRepr": "amazing(trip)", "type": "ATTR",
      "args": [{"type": "SUBJECT", "name": "trip"}],
      "feats": {"negated": "false", "modality": ""}
    },
    {
      "id": "r1", "name": "recommend", "textRepr": "would recommend-not(i,food)", "type": "VERB",
      "args": [{"type": "SUBJECT", "name": "i"}, {"type": "OBJECT", "name": "food", "entityId": "e0"}],
      "feats": {"negated": "true", "modality": "would"}
    },
    {
      "id": "r2", "name": "terrible", "textRepr": "terrible(pizza)", "type": "ATTR",
      "args": [{"type": "SUBJECT", "name": "pizza", "entityId": "e1"}],
      "feats": {"negated": "false", "modality": ""}
    }
  ],
  "usedChars": 102
}

Since relations might refer to entities, the entities are automatically returned in the response XS well.