Giter VIP home page Giter VIP logo

bord's Introduction

BORD


Preparation

  1. First create a virtual environment in your working directory called venv
  2. Activate the virtual env
  3. Install requirements with
pip3 install -r requirements.txt
  1. Install apex as follows:
git clone https://github.com/NVIDIA/apex
cd apex
pip install -v --disable-pip-version-check --no-cache-dir ./
  1. Download the spacy english model
python3 -m spacy download en_core_web_sm

Lexical annotation for distant supervision

  1. To create the training dataset by lexically annotating a corpus provided in pubtator format, run lexical_annot.sh

it requires the following arguments in order:

  • The ontology in obo format
  • The corpus that you want to annotate in pubtator format to create the weakly labeled dataset for training
  • The output file name

Example:

./lexical_annot.sh ont.obo sample.input.txt weak_output.txt
  1. Run the same command on a different corpus to create the development set
  2. You will need to extract children and parents to use the ontology-based normalization, please refer to the following script for reference: https://github.com/smalghamdi/groovyScripts/blob/master/direct_parent_direct_child.groovy the output should be two files in json format
  3. For ontology-based normalization you will also need to run the following script:
python3 get_allchildren.py direct_children.json

where the input is the direct_children json file

Training

  1. Run the train.sh script

it requires the output from the previous step which can be run twice: The first one to create training set and another one to create the development set

For the sake of the example we use the same file twice:

./train.sh weak_output.txt weak_output.txt 

Alternatively, you can use our sample files as follows:

./train.sh ../sample.input.4train.iob ../sample.dev.iob

Prediction

  1. Run the predict.sh script where the input is as follows in order:
  • The pubtator file for which you want to predict
  • The output file which will be stored under the output directory

To run the ontology-based normalization:

Replace the script name 'normalize.py' in the last line in predict.sh to 'normalize_ontology-based.py'

Example:

./predict.sh sample.input.txt final_output.txt

Trained models

  1. To use our trained models, download it from:

AND unzip it in the model/ directory

  1. Download the intermediate files from:

AND unzip it in the ifiles/ directory

bord's People

Contributors

stoonsi avatar

Stargazers

Alberto Labarga avatar Ian Maurer avatar

Watchers

ks avatar George Gkoutos avatar Robert Hoehndorf avatar Maxat Kulmanov avatar Syed Ali Raza avatar  avatar  avatar  avatar Jackie Williams avatar Sarah Alghamdi avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.