PageRenderTime 34ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/README.md

https://gitlab.com/purdueNlp/DRaiL
Markdown | 22 lines | 18 code | 4 blank | 0 comment | 0 complexity | 7a7407fa08e50284cea5ae3d60304b98 MD5 | raw file
  1. ## Requirements
  2. - Python 3
  3. - gurobi optimizer (academic license can be requested)
  4. - gurobipy (follow gurobi instructions, can be installed from package)
  5. - `pip3 install -r requirements.txt`
  6. ## Documentation: [Coming-Soon](https://gitlab.com/purdueNlp/DRaiL/-/wikis/home)
  7. ## Running a simple example
  8. State and Agreement prediction on gun control debates (using bert-tiny)
  9. - Add your DRaiL directory to `PYTHONPATH`
  10. - `cd` to `examples/4forms`
  11. - Local learning: `python3 run_debates_4forums.py --dir data/ --config config/config_bert_tiny.json --rule rules/rule_guncontrol.dr --savedir [dir-to-save-models] --bert_tiny -m local -f feats -n neuro --issue gun_control --logging_config ../../logging_conf.json --gpu_index [index-of-gpu:defaults to 0]`
  12. - Global learning: `python3 run_debates_4forums.py --dir data/ --config config/config_bert_tiny.json --rule rules/rule_guncontrol.dr --savedir [dir-to-save-models] --bert_tiny -m global --loss hinge --lrate 2e-5 -f examples/4forums/ -n examples/4forums/ --issue gun_control --logging_config ../../logging_conf.json --gpu_index [index-of-gpu:defaults to 0]`
  13. ## Quick tips
  14. - If you are using soft rules (NNet rules) that have unknown predicates
  15. on the left hand side, you have to use `hinge_latent` loss instead of
  16. `hinge` (even if you have supervision for that predicate), and you
  17. have to generate features for the unknown predicate (otherwise all
  18. groundings will have the same input at learning time)