allenai / kb

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

Expecting property name enclosed in double quotes #40

Open lshowway opened 2 years ago

lshowway commented 2 years ago

when I run the example of How to embed sentences or sentence pairs programmatically, I got an error: json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 242 column 5 (char 8926) when loading config.json. I also load config.json solely, I get the same error.

lshowway commented 2 years ago

I have solved the problem by downloading archive_file = 'https://allennlp.s3-us-west-2.amazonaws.com/knowbert/models/knowbert_wiki_model.tar.gz' manually and removing the last comma. In addition, function _extract_config_from_archive in knowbert_utils.py is also needed to be modified. So I recommend that the config.json should be modified.

gpiat commented 2 years ago

It's been a year and a half since the last commit on this project, and I don't believe the AllenAI team is actively maintaining it. I think the best way of helping others work around this issue would be for you to submit a pull request if you can.

GeorgeVern commented 2 years ago

I have removed the last comma from the config.json but now I get the error knowbert is not a registered name for Model. Any thoughts?

gpiat commented 2 years ago

I believe this error means that the following line is not processed before an attempt at instanciating the model is made: kb/knowbert.py line 776 : @Model.register("knowbert") I assume you're using allennlp train, did you remember to launch your command with the --include-package kb.include_all option?