Tags¶
Semantic tags are ranked entities, keywords or concepts relevant for the article.
See the Tag 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 great. Only the food was weird. Especially the pizza was terrible.",
"analyses": ["tags"],
"domain": "voc-hospitality"
}'
# On Windows, use \" instead of " and " instead of '
def callGeneea(input):
url = 'https://api.geneea.com/v3/analysis'
headers = {
'content-type': 'application/json',
'Authorization': 'user_key <your user key>'
}
return requests.post(url, json=input, headers=headers).json()
responseObj = callGeneea({
'id': '1',
'text': 'The trip to London was great. Only the food was weird. Especially the pizza was terrible.',
'analyses': ['tags'],
'domain': 'voc-hospitality'
)
print(responseObj)
You should get the following response:
{
"id": "1",
"language": {"detected": "en"},
"tags": [
{"id": "T0", "gkbId": "HSP-1091", "stdForm": "pizza", "type": "ENTITIES", "relevance": 5.95},
{"id": "T1", "stdForm": "food: weird", "type": "RELATIONS", "relevance": 3.75},
{"id": "T2", "stdForm": "trip: amazing", "type": "RELATIONS", "relevance": 3.75},
{"id": "T3", "stdForm": "pizza: terrible", "type": "RELATIONS", "relevance": 3.69}
],
"usedChars": 100
}
You can use "returnMentions": "true"
to return the tag mentions.