Coder Social home page Coder Social logo

bio_relex's Introduction

Joint Biomedical Entity and Relation Extraction with Knowledge-Enhanced Collective Inference

Instructions

The code has been tested with Python 3. To install the dependencies, please run:

pip install -r requirements.txt

We use two datasets in this work:

  • ADE. We conducted 10-fold cross-validation. The dataset can be downloaded from here.
  • BioRelEx. The train and dev sets can be downloaded here. The test set is unreleased and can only be evaluated using CodeLab.

After downloading the datasets, please create a new folder resources and put the datasets into that folder. Overall, the folder structure of the entire repo should look like:

...
models/
pymetamap/
resources/
--- ade/
------- ade_full.json
------- ade_split_0_test.json
------- ade_split_0_train.json
....
------- ade_split_9_test.json
------- ade_split_9_train.json
------- ade_types.json
--- biorelex/
------- train.json
------- dev.json
--- umls_embs.pkl
--- umls_rels.txt
--- umls_reltypes.txt
--- umls_semtypes.txt
--- text2graph.pkl
scorer/
.gitignore
ade_train.sh
...

Additional files in the resources folder include:

  • The files umls_rels.txt, umls_reltypes.txt, and umls_semtypes.txt can be extracted directly from UMLS (to use UMLS, you need to request access permission).
  • umls_embs.pkl contains the embeddings of Maldonado et al. 2019 and also the embeddings of the UMLS definition sentences. Note that some UMLS concepts may not have any definition sentence.
  • text2graph.pkl is a cache that maps each text input in the datasets into a graph structure of all the concepts and relations from UMLS that can be potentially relevant (found by MetaMap).

For training, please refer to the scripts ade_trainer.py and trainer.py. For example, to train a basic model for BioRelEx, you can simply run:

python trainer.py

Note: If you want me to send you UMLS-related files, please email me at [email protected] (together with some proof that you have access to UMLS). I am not putting UMLS-related files online because of the UMLS licensing issue.

There are some redundant code in this repo. I am going to remove them soon.

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.