{"id":29194761,"url":"https://github.com/amundfr/bert_ned","last_synced_at":"2025-07-02T04:38:05.709Z","repository":{"id":227859263,"uuid":"315304317","full_name":"amundfr/bert_ned","owner":"amundfr","description":"Named Entity Disambiguation using pretrained BERT word embeddings. Uses spaCy for Named Entity Recognition and candidate generation. ","archived":false,"fork":false,"pushed_at":"2021-05-26T09:28:47.000Z","size":256,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-03-15T14:29:26.437Z","etag":null,"topics":["entity-linking","named-entity-disambiguation","nlp"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/amundfr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2020-11-23T12:12:51.000Z","updated_at":"2024-03-15T14:29:30.074Z","dependencies_parsed_at":"2024-03-15T14:39:34.800Z","dependency_job_id":null,"html_url":"https://github.com/amundfr/bert_ned","commit_stats":null,"previous_names":["amundfr/bert_ned"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/amundfr/bert_ned","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amundfr%2Fbert_ned","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amundfr%2Fbert_ned/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amundfr%2Fbert_ned/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amundfr%2Fbert_ned/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amundfr","download_url":"https://codeload.github.com/amundfr/bert_ned/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amundfr%2Fbert_ned/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263076973,"owners_count":23410164,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["entity-linking","named-entity-disambiguation","nlp"],"created_at":"2025-07-02T04:38:04.027Z","updated_at":"2025-07-02T04:38:05.682Z","avatar_url":"https://github.com/amundfr.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# BERT for Named Entity Disambiguation — bert_ned\n\n## TL;DR\n\nTo build and run the container:\n```bash\nmake wharfer-build \u0026\u0026 make wharfer-run\n```\n\nTo run the full pipeline (data generation, training, evaluation) inside the container:\n```bash\nmake full\n```\n\n\n## Makefile for Docker/Wharfer\n\nThere 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. \n\n## Docker\n\nYou can build and run containers with specific volumes or names if you disregard the 'make' instructions. \n\nRun the image on a machine with a Cuda-enabled GPU to train the model or use the model for inference. \n\nBuild the Docker image with GPU (7.27GB):\n\n```bash\ndocker build -t bert_ned .\n```\n\nFor 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.\n\nBuild without GPU (3.19GB):\n\n```bash\ndocker build -f Dockerfile.CPU -t bert_ned_cpu .\n```\n\n## Docker run\nTo run the Docker image on an AD machine using files from /nfs/:\n\n```bash\ndocker run -v /nfs/students/amund-faller-raheim/master_project_bert_ned/data:/bert_ned/data \\\n           -v /nfs/students/amund-faller-raheim/master_project_bert_ned/ex_data:/bert_ned/ex_data \\\n           -v /nfs/students/amund-faller-raheim/master_project_bert_ned/models:/bert_ned/models \\\n           -it --name bert_ned bert_ned\n```\n\nPlease 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. \n\nE.g. `cp /nfs/students/amund-faller-raheim/master_project_bert_ned /local/data/$(whoami)/` and \n\n```\ndocker run -v /local/data/$(whoami)/data:/bert_ned/data \\\n           -v /local/data/$(whoami)/ex_data:/bert_ned/ex_data \\\n           -v /local/data/$(whoami)/models:/bert_ned/models \\\n           -it --name bert_ned bert_ned\n```\n\n## Run scripts in container\n\nInstructions should appear **once the container is running**. Type 'make help' to see a list of actions. (This is from a second makefile `Makefile_scripts`.)\n\nYou can use 'make' to **run scripts** in the container. For example:\n\n```bash\nmake full\n```\n\nWhich runs the script `bert_ned_full_pipeline.py`. This script can do the full process, from data generation to training and evaluation. \n\nWhen 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.**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famundfr%2Fbert_ned","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famundfr%2Fbert_ned","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famundfr%2Fbert_ned/lists"}