This repository was archived by the owner on Jul 22, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11TODO:
22
3+ * can we build a causal graph of the provenance?
4+ - https://www.pywhy.org/dowhy/v0.11.1/
5+
6+ * target publications:
7+ - https://drops.dagstuhl.de/entities/issue/TGDK-volume-1-issue-1
8+
39 * impl a _ semantic random walk_ from a source KG
410
511 * link entities for lemmas, noun chunks using MediaWiki lookups?
Original file line number Diff line number Diff line change @@ -848,7 +848,7 @@ def dbpedia_wikidata_equiv (
848848 ######################################################################
849849 ## entity linking
850850
851- def _link_spotlight_entities ( # pylint: disable=R0914
851+ def _link_spotlight_entities ( # pylint: disable=R0912, R0914
852852 self ,
853853 pipe : Pipeline ,
854854 * ,
@@ -867,7 +867,10 @@ def _link_spotlight_entities ( # pylint: disable=R0914
867867 yields:
868868candidates linked entities
869869 """
870- ents : typing .List [ spacy .tokens .span .Span ] = list (pipe .aux_doc .ents )
870+ ents : typing .List [ spacy .tokens .span .Span ] = []
871+
872+ if pipe .aux_doc is not None :
873+ list (pipe .aux_doc .ents )
871874
872875 if debug :
873876 ic (ents )
Original file line number Diff line number Diff line change @@ -251,8 +251,14 @@ def __init__ ( # pylint: disable=R0913
251251 # `ner_doc` provides the merged-entity spans from NER
252252 self .ner_doc : spacy .tokens .Doc = ner_pipe (self .text )
253253
254- # `aux_doc` e.g., span re-indexing for Spotlight entity linking
255- self .aux_doc : spacy .tokens .Doc = aux_pipe (self .text )
254+ # `aux_doc` e.g., re-indexing spans for Spotlight entity linking
255+ # NB: this is optional, in case the Spotlight service is down
256+ self .aux_doc : typing .Optional [ spacy .tokens .Doc ] = None
257+
258+ try :
259+ self .aux_doc = aux_pipe (self .text )
260+ except Exception as ex : # pylint: disable=W0718
261+ ic (ex )
256262
257263 self .kg : KnowledgeGraph = kg # pylint: disable=C0103
258264 self .infer_rels : typing .List [ InferRel ] = infer_rels
You can’t perform that action at this time.
0 commit comments