<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://info216.wiki.uib.no/index.php?action=history&amp;feed=atom&amp;title=Lab%3A_DBpedia_Spotlight</id>
	<title>Lab: DBpedia Spotlight - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://info216.wiki.uib.no/index.php?action=history&amp;feed=atom&amp;title=Lab%3A_DBpedia_Spotlight"/>
	<link rel="alternate" type="text/html" href="http://info216.wiki.uib.no/index.php?title=Lab:_DBpedia_Spotlight&amp;action=history"/>
	<updated>2026-05-28T19:56:54Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.2</generator>
	<entry>
		<id>http://info216.wiki.uib.no/index.php?title=Lab:_DBpedia_Spotlight&amp;diff=2475&amp;oldid=prev</id>
		<title>Sinoa: Created page with &quot;== If you have more time ==   &#039;&#039;&#039;Task:&#039;&#039;&#039; If you have more time, you can use DBpedia Spotlight to try to link the people (and other &quot;named entities&quot;) mentioned in the dataset to DBpedia resources.  pip install pyspotlight You can start with the code example below, but you will need exception-handling when DBpedia is unable to find a match. For instance: &lt;syntaxhighlight&gt; import spotlight  ENDPOINT = &#039;https://api.dbpedia-spotlight.org/en/annotate&#039; CONFIDENCE = 0.5  # filt...&quot;</title>
		<link rel="alternate" type="text/html" href="http://info216.wiki.uib.no/index.php?title=Lab:_DBpedia_Spotlight&amp;diff=2475&amp;oldid=prev"/>
		<updated>2024-03-03T18:47:23Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;== If you have more time ==   &amp;#039;&amp;#039;&amp;#039;Task:&amp;#039;&amp;#039;&amp;#039; If you have more time, you can use DBpedia Spotlight to try to link the people (and other &amp;quot;named entities&amp;quot;) mentioned in the dataset to DBpedia resources.  pip install pyspotlight You can start with the code example below, but you will need exception-handling when DBpedia is unable to find a match. For instance: &amp;lt;syntaxhighlight&amp;gt; import spotlight  ENDPOINT = &amp;#039;https://api.dbpedia-spotlight.org/en/annotate&amp;#039; CONFIDENCE = 0.5  # filt...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== If you have more time ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Task:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
If you have more time, you can use DBpedia Spotlight to try to link the people (and other &amp;quot;named entities&amp;quot;) mentioned in the dataset to DBpedia resources.&lt;br /&gt;
 pip install pyspotlight&lt;br /&gt;
You can start with the code example below, but you will need exception-handling when DBpedia is unable to find a match. For instance:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
import spotlight&lt;br /&gt;
&lt;br /&gt;
ENDPOINT = &amp;#039;https://api.dbpedia-spotlight.org/en/annotate&amp;#039;&lt;br /&gt;
CONFIDENCE = 0.5  # filter out results with lower confidence&lt;br /&gt;
&lt;br /&gt;
def annotate_entity(entity_name, filters={&amp;#039;types&amp;#039;: &amp;#039;DBpedia:Person&amp;#039;}):&lt;br /&gt;
    annotations = []&lt;br /&gt;
    try:&lt;br /&gt;
      annotations = spotlight.annotate(ENDPOINT, entity_name, confidence=CONFIDENCE, filters=filters)&lt;br /&gt;
    except spotlight.SpotlightException as e:&lt;br /&gt;
        # catch exceptions thrown from Spotlight, for example when no DBpedia resource is found&lt;br /&gt;
      print(e)&lt;br /&gt;
      # handle exceptions here&lt;br /&gt;
    return annotations&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The example uses the types-filter with DBpedia:Person, because we only want it to match with people. You can choose to only implement the URIs in the response, or the types as well.&lt;br /&gt;
&lt;br /&gt;
Useful materials:&lt;br /&gt;
* [https://www.dbpedia-spotlight.org/api Spotlight Documentation]&lt;br /&gt;
* [https://pypi.org/project/pyspotlight/ pyspotlight 0.7.2 at PyPi.org]&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Task:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
If you have more time, you can use DBpedia Spotlight to try to link the people (and other &amp;quot;named entities&amp;quot;) mentioned in the dataset to DBpedia resources. &lt;br /&gt;
 pip install pyspotlight&lt;br /&gt;
You can start with the code example below, but you will need exception-handling when DBpedia is unable to find a match. For instance:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
import spotlight&lt;br /&gt;
&lt;br /&gt;
ENDPOINT = &amp;#039;https://api.dbpedia-spotlight.org/en/annotate&amp;#039;&lt;br /&gt;
CONFIDENCE = 0.5  # filter out results with lower confidence&lt;br /&gt;
&lt;br /&gt;
def annotate_entity(entity_name, filters={&amp;#039;types&amp;#039;: &amp;#039;DBpedia:Person&amp;#039;}):&lt;br /&gt;
    annotations = []&lt;br /&gt;
    try:&lt;br /&gt;
	annotations = spotlight.annotate(ENDPOINT, entity_name, confidence=CONFIDENCE, filters=filters)&lt;br /&gt;
    except spotlight.SpotlightException as e:&lt;br /&gt;
        # catch exceptions thrown from Spotlight, for example when no DBpedia resource is found&lt;br /&gt;
	print(e)&lt;br /&gt;
	# handle exceptions here&lt;br /&gt;
    return annotations&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The example uses the types-filter with DBpedia:Person, because we only want it to match with people. You can choose to only implement the URIs in the response, or the types as well.&lt;br /&gt;
&lt;br /&gt;
Useful materials:&lt;br /&gt;
* [https://www.dbpedia-spotlight.org/api Spotlight Documentation]&lt;br /&gt;
* [https://pypi.org/project/pyspotlight/ pyspotlight 0.7.2 at PyPi.org]&lt;/div&gt;</summary>
		<author><name>Sinoa</name></author>
	</entry>
</feed>