Add methods to highlights
joseberlines opened this issue · 4 comments
In the same way by clicking a NER highlighting leads to a web side it would perhaps be possible to extend this functionality and pass a method to be run when clicking the highlighted NER.
Thank you for the first issue! Which methods do you mean, for example?
Imagine you use your solution where you highlight whatever NERs (I dont know what NEL is.... ) and you have to for instance add a NER to a list if it fits some criteria (only possible to decide by humans). The method would be simply open a csv, add it with some extra information. Or imagine you have a document where 100s of NERs appear and you like to "shrink" the document to where a particular number of NERs appear. For instance (dummy example) there are 123 paragraphs. In paragraph 3 the NER "MIT" appears. The user could "click" the NER and the paragraphs showing that NER will appear. In this way an interactive document consultation is possible after extracting NERs with spacy.
This functionality is well know in a tool called liquidtext (its an app).
https://www.liquidtext.net/videos
Ideally I imagine the functioning as follows:
NER.on_click(f)
# where
def f():
do stuff
Oh yeah, that would be great functionality in spaCy and spaCy.displaCy! But that would be out of the scope of this pipeline spaCyOpenTapioca and probably it would be better to open an enhancement issue at https://github.com/explosion/spaCy/issues because it needs changes to displaCy.
By NEL (linking) I mean NER (recognition) + NED (disambiguation). NER alone does not provide links to entities in a knowledge base.