Parameter | Type | Description |
---|---|---|
article |
STRING | The article path |
The /entitymentions
endpoint is a GET endpoint. When doing a GET request to the endpoint, a JSON Array is returned containing all the currently known entitymentions, their indexes, type, label, iri and the file they originate from. The JSON array is formatted as follows:
{
"fileName": STRING,
"language": STRING,
"metadataId": UUID (STRING),
"sentences": [
{
"sentence": STRING,
"sentenceStartIndex": INT,
"sentenceEndIndex": INT,
"entityMentions": [
{
"name": STRING,
"type": STRING,
"label": STRING,
"startIndex": INT,
"endIndex": INT,
"iri": STRING?
}
]
}
]
}
Here is an example of an output from the endpoint /entitymentions?article=test.txt
. For simplification, only a single file has been processed by the Entity Recognizer and Linker:
{
"fileName": "test.txt",
"language": "en",
"metadataId": "790261e8-b8ec-4801-9cbd-00263bcc666a",
"sentences": [
{
"sentence": "Hi my name is marc",
"sentenceStartIndex": 0,
"sentenceEndIndex": 47,
"entityMentions": [
{
"name": "marc",
"type": "Entity",
"label": "GPE",
"startIndex": 14,
"endIndex": 18,
"iri": "knox-kb01.srv.aau.dk/marc"
}
]
}
]
}
The /entitymentions/all
endpoint is a GET endpoint. When doing a GET request to the endpoint, a JSON Array is returned containing the all articles with their currently known entitymentions found. The JSON array is formatted as follows:
[
{
"fileName": STRING,
"language": STRING,
"metadataId": UUID (STRING),
"sentences": [
{
"sentence": STRING,
"sentenceStartIndex": INT,
"sentenceEndIndex": INT,
"entityMentions": [
{
"name": STRING,
"type": STRING,
"label": STRING,
"startIndex": INT,
"endIndex": INT,
"iri": STRING?
}
]
}
]
}
]
Here is an example of an output from the endpoint when getting all articles. For simplification, only two files has been processed by the Entity Recognizer and Linker:
[
{
"fileName": "test.txt",
"language": "en",
"metadataId": "790261e8-b8ec-4801-9cbd-00263bcc666d",
"sentences": [
{
"sentence": "Hi my name is marc",
"sentenceStartIndex": 0,
"sentenceEndIndex": 47,
"entityMentions": [
{
"name": "marc",
"type": "Entity",
"label": "PERSON",
"startIndex": 14,
"endIndex": 18,
"iri": "knox-kb01.srv.aau.dk/marc"
}
]
}
]
},
{
"fileName": "test2.txt",
"language": "en",
"metadataId": "790261e8-b8ec-4801-9cbd-00263bcc666c",
"sentences": [
{
"sentence": "Hi my name is joe",
"sentenceStartIndex": 0,
"sentenceEndIndex": 47,
"entityMentions": [
{
"name": "Joe",
"type": "Entity",
"label": "PERSON",
"startIndex": 14,
"endIndex": 17,
"iri": "knox-kb01.srv.aau.dk/joe"
}
]
}
]
}
]
This endpoint expects the given request body to contain some input text and returns its language. It uses the langdetect library.
NOTE: The function will return the language as a ISO 639-1 code.
Request body: "The man was walking down the street"
Response: en
af, ar, bg, bn, ca, cs, cy, da, de, el, en, es, et, fa, fi, fr, gu, he, hi, hr, hu, id, it, ja, kn, ko, lt, lv, mk, ml, mr, ne, nl, no, pa, pl, pt, ro, ru, sk, sl, so, sq, sv, sw, ta, te, th, tl, tr, uk, ur, vi, zh-cn, zh-tw
NOTE: see List of ISO 639-1 codes for more information