Git Product home page Git Product logo

bert_ned's Introduction

BERT for Named Entity Disambiguation โ€” bert_ned

TL;DR

To build and run the container:

make wharfer-build && make wharfer-run

To run the full pipeline (data generation, training, evaluation) inside the container:

make full

Makefile for Docker/Wharfer

There are shorthands for the preceding Docker and Wharfer commands in a Makefile. Navigate to the directory with this repository and type make help for a list of instructions.

Docker

You can build and run containers with specific volumes or names if you disregard the 'make' instructions.

Run the image on a machine with a Cuda-enabled GPU to train the model or use the model for inference.

Build the Docker image with GPU (7.27GB):

docker build -t bert_ned .

For completeness, there is a CPU version of the Dockerfile (Dockerfile.CPU). The CPU container works for the data preparation scripts, but the model runs poorly on a CPU.

Build without GPU (3.19GB):

docker build -f Dockerfile.CPU -t bert_ned_cpu .

Docker run

To run the Docker image on an AD machine using files from /nfs/:

docker run -v /nfs/students/amund-faller-raheim/master_project_bert_ned/data:/bert_ned/data \
           -v /nfs/students/amund-faller-raheim/master_project_bert_ned/ex_data:/bert_ned/ex_data \
           -v /nfs/students/amund-faller-raheim/master_project_bert_ned/models:/bert_ned/models \
           -it --name bert_ned bert_ned

Please note: accessing files over NFS makes some of the operations quite slow. You can also copy the directories in /nfs/students/amund-faller-raheim/master_project_bert_ned to a local directory and mount those to the docker container.

E.g. cp /nfs/students/amund-faller-raheim/master_project_bert_ned /local/data/$(whoami)/ and

docker run -v /local/data/$(whoami)/data:/bert_ned/data \
           -v /local/data/$(whoami)/ex_data:/bert_ned/ex_data \
           -v /local/data/$(whoami)/models:/bert_ned/models \
           -it --name bert_ned bert_ned

Run scripts in container

Instructions should appear once the container is running. Type 'make help' to see a list of actions. (This is from a second makefile Makefile_scripts.)

You can use 'make' to run scripts in the container. For example:

make full

Which runs the script bert_ned_full_pipeline.py. This script can do the full process, from data generation to training and evaluation.

When running the scripts, make sure that the settings in config.ini are correct for your environment (or the container, by default). Leave the settings as provided to reproduce results.

bert_ned's People

Contributors

amundfr avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 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.