Returns the input text with identified entities linked to their DBpedia URIs, including confidence scores and entity types. Use this when you need the most accurate entity linking with full disambiguation.
From spec: A 4-step process: Spotting, Candidate Mapping, Disambiguation and Linking. Returns fully disambiguated entities linked to DBpedia resources.
Usage Tips
- The 'text' parameter is required and should contain the text to annotate
- Set 'confidence' (0.0-1.0) to filter results by relevance - higher values mean stricter matching
- Use 'support' parameter to filter by how often an entity appears in Wikipedia
- Supports multiple languages via the URL path (/en/, /de/, /fr/, etc.)
Parameters (7)
confidence(number, query, optional)
Confidence score threshold for disambiguation/linking (0.0-1.0)
Constraints: {'minimum': 0, 'maximum': 1}
policy(string, query, optional)
Filtering policy: 'whitelist' selects entities matching types, 'blacklist' excludes them
Constraints: {'enum': ['whitelist', 'blacklist']}
sparql(string, query, optional)
SPARQL SELECT query to whitelist results
support(integer, query, optional)
Minimum prominence of entity in Lucene Model (number of inlinks in Wikipedia)
import requests
resp = requests.get(
"https://api.dbpedia-spotlight.org/en/annotate",
params={
'text': 'Berlin is the capital of Germany',
'confidence': '0.5',
},
)
data = resp.json()
import zingu_apis
api = zingu_apis.api("dbpedia-spotlight")
result = api.fetch("annotate", text="Berlin is the capital of Germany", confidence=0.5)
for item in result:
print(item)
const resp = await fetch("https://api.dbpedia-spotlight.org/en/annotate?text=Berlin+is+the+capital+of+Germany&confidence=0.5");
const data = await resp.json();