allenai / kb

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

【freshman】how to apply this model into a binary classification work. #31

Open Jiaxin-Liu-96 opened 3 years ago

Jiaxin-Liu-96 commented 3 years ago

I am a newer student in the NLP domain. I have read your paper and want to apply your model into a binary classification work. There are some questions that i am facing: 1.if I want to run a demo that you've provided, I don't know which file to run first to start. 2.If I want to apply your model into a sentences binary classification, I don't know how to use your model do a embedding work

sorry to disturb you for such easy question, I am looking forward your reply. Thank you in advance.

matt-peters commented 3 years ago
  1. We don't have an easy to use demo, but you could make one from one of the pretrained models (see here: https://github.com/allenai/kb#evaluating-fine-tuned-models). Then use the allennlp predict or allennlp evaluate commands to make predictions.

  2. For binary classification you will need to fine tune the model on your dataset. The WiC dataset is binary classification you could use as a example. See the config file here: https://github.com/allenai/kb/blob/master/training_config/downstream/wic.jsonnet and the model code is here: https://github.com/allenai/kb/blob/master/kb/evaluation/classification_model.py