{"id":18831619,"url":"https://github.com/riccorl/transformers-ner","last_synced_at":"2026-01-25T03:01:23.300Z","repository":{"id":40459489,"uuid":"349520309","full_name":"Riccorl/transformers-ner","owner":"Riccorl","description":"Simple NER model, showcasing Transformer Embedder library.","archived":false,"fork":false,"pushed_at":"2022-06-29T14:09:15.000Z","size":105,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-14T04:16:37.409Z","etag":null,"topics":["bert","bert-model","deep-learning","named-entity-recognition","natural-language-processing","ner","nlp","onnx","onnxruntime","pytorch","roberta","transformer","transformer-embedder","transformers"],"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/Riccorl.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}},"created_at":"2021-03-19T18:30:36.000Z","updated_at":"2022-09-09T08:35:19.000Z","dependencies_parsed_at":"2022-06-27T17:13:52.028Z","dependency_job_id":null,"html_url":"https://github.com/Riccorl/transformers-ner","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":"Riccorl/nlp-template","purl":"pkg:github/Riccorl/transformers-ner","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Riccorl%2Ftransformers-ner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Riccorl%2Ftransformers-ner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Riccorl%2Ftransformers-ner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Riccorl%2Ftransformers-ner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Riccorl","download_url":"https://codeload.github.com/Riccorl/transformers-ner/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Riccorl%2Ftransformers-ner/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28742973,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T02:46:29.005Z","status":"ssl_error","status_checked_at":"2026-01-25T02:44:29.968Z","response_time":113,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["bert","bert-model","deep-learning","named-entity-recognition","natural-language-processing","ner","nlp","onnx","onnxruntime","pytorch","roberta","transformer","transformer-embedder","transformers"],"created_at":"2024-11-08T01:55:25.513Z","updated_at":"2026-01-25T03:01:23.284Z","avatar_url":"https://github.com/Riccorl.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Transformers NER\n\n[![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1X6zEbRV0sZzcZCVC3Ir2j3TXEUwC0hL-?usp=sharing)\n[![PyTorch](https://img.shields.io/badge/PyTorch-orange?logo=pytorch)](https://pytorch.org/)\n[![Transformer-Embedder](https://img.shields.io/badge/Transformers%20Embedder-3.0.2-6670ff)](https://github.com/Riccorl/transformers-embedder)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000)](https://github.com/psf/black)\n\nThis is an example project for [Transformers Embedder](https://github.com/Riccorl/transformers-embedder) library.\n\nFirst thing first:\n\n```bash\n./scripts/setup.sh\n```\n\n## Train\n\nTo train a model use:\n\n```bash\n./scripts/train.sh -l \"${LANGUAGE_MODEL_NAME} ${OVERRIDES}\"\n```\n\nwhere `${LANGUAGE_MODEL_NAME}` is the name of one of the language models supported by HuggingFace, e.g. \n`bert-base-cased`. You can look at the `conf` directory to see the list of supported hyper-parameters.\n`${OVERRIDES}` instead, can be used to override the hydra configuration files, using the hydra syntax, e.g.\n`model.model.subword_pooling_strategy=scatter`:\n\n```bash\n./scripts/train.sh -l bert-base-cased \"model.model.subword_pooling_strategy=scatter\"\n```\n\nA usage description of the `train.sh` is provided below.\n\n```bash\ntrain.sh [-h] [-l LANG_MODEL_NAME] [-d] [-p PRECISION] [-c] [-g DEVICES] [-n NODES] [-m GPU_MEM] [-s STRATEGY] [-o] OVERRIDES\n\nwhere:\n    -h            Show this help text\n    -l            Language model name (one of the models from HuggingFace)\n    -d            Run in debug mode (no GPU and wandb offline)\n    -p            Training precision, default 16.\n    -c            Use CPU instead of GPU.\n    -g            How many GPU to use, default 1. If 0, use CPU.\n    -n            How many nodes to use, default 1.\n    -m            Minimum GPU memory required in MB (default: 8000). If less that this,\n                  training will wait until there is enough space.\n    -s            Strategy to use for distributed training, default NULL.\n    -o            Run the experiment offline\n    OVERRIDES     Overrides for the experiment, in the form of key=value.\n                  For example, 'model_name=bert-base-uncased'\nExample:\n  ./script/train.sh -l bert-base-cased\n  ./script/train.sh -l bert-base-cased -m 10000\n```\n \n## Evaluation\n\nRun the following code to evaluate the model against the test set:\n\n```bash\npython src/evaluate.py \\\n  \"model.model.language_model=$LANGUAGE_MODEL_NAME\" \\\n  evaluate.checkpoint_path=\"/absolute/path/to/checkpoint\"\n```\n\n## Results\n\n### CoNLL 2003\n\nThese models are trained for 10 epochs, using RAdam with a learning rate of `1e-5`.\n\n| Language Model \t| F1   \t| Inference Time (GPU) \t|\n|----------------\t|------\t|----------------------\t|\n| MiniLM         \t| 90.0 \t|          6s          \t|\n| M-MiniLM        | 88.2 \t|          6s          \t|\n| DistilBERT     \t| 88.9  |          6s          \t|\n| BERT-base      \t| 90.1 \t|                      \t|\n| RoBERTa-large   | 91.4 \t|          24s         \t|\n\n### CoNLL 2012","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Friccorl%2Ftransformers-ner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Friccorl%2Ftransformers-ner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Friccorl%2Ftransformers-ner/lists"}