allenai / kb

KnowBert -- Knowledge Enhanced Contextual Word Representations
Apache License 2.0
370 stars 50 forks source link

self-supervised entity linker #19

Open abdkiwan opened 4 years ago

abdkiwan commented 4 years ago

Thanks for making the code available online. I want to insert a new knowledge graph like (ConceptNet) into KnowBert. To do that I need to train an entity linker for it. However, I don't have labelled data for the entity linker, and as I understood from the paper, it is possible to train the linker in a self-supervised way. How to adapt the configuration files in order to do this task ?

Thanks in advance

matt-peters commented 4 years ago

We haven't tried to integrate ConceptNet, but it should be relatively straightforward as previous approaches (cited in our paper) have just used some variant of string match to find relevant KB nodes. The code is configured to only use the entity linking loss if there is entity linking supervision, so removing the relevant sections from the config file (the entity_linking sections here: https://github.com/allenai/kb/blob/master/training_config/pretraining/knowbert_wordnet.jsonnet#L38 and https://github.com/allenai/kb/blob/master/training_config/pretraining/knowbert_wordnet.jsonnet#L86) will take care of most of it.

abdkiwan commented 4 years ago

Thanks for the reply. I tried your solution but I got some errors in the dataset_reader and iterator. How should their parameters be ? Would be possible if you provide the full json object for (dataset_reader - iterator) ?

thanks in advance

matt-peters commented 4 years ago

I haven't run experiments without the entity linking annotation so unfortunately can't easily provide a config file.

ilyalasy commented 2 years ago

Hey, @abdkiwan, did you achieve any results in your task?