{"id":18049408,"url":"https://github.com/microsoft/binder","last_synced_at":"2025-04-10T22:52:06.282Z","repository":{"id":65975137,"uuid":"564864688","full_name":"microsoft/binder","owner":"microsoft","description":null,"archived":false,"fork":false,"pushed_at":"2024-03-09T17:50:51.000Z","size":69,"stargazers_count":90,"open_issues_count":13,"forks_count":21,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-10T22:52:04.228Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/microsoft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":"SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-11T17:24:12.000Z","updated_at":"2025-01-17T15:51:14.000Z","dependencies_parsed_at":"2024-10-30T21:03:44.297Z","dependency_job_id":"838dc9ca-22b8-476a-8d5a-b2b28e47c4fb","html_url":"https://github.com/microsoft/binder","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fbinder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fbinder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fbinder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fbinder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/microsoft","download_url":"https://codeload.github.com/microsoft/binder/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248312170,"owners_count":21082638,"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":[],"created_at":"2024-10-30T21:01:53.134Z","updated_at":"2025-04-10T22:52:06.259Z","avatar_url":"https://github.com/microsoft.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# [Optimizing Bi-Encoder for Named Entity Recognition via Contrastive Learning](https://openreview.net/forum?id=9EAQVEINuum)\n\n## Introduction\nThis is the repository for BINDER ([**BI**-encoder for **N**ame**D** **E**ntity **R**ecognition via Contrastive Learning](https://openreview.net/forum?id=9EAQVEINuum)) accepted at ICLR 2023.\n\nBINDER employs two encoders to separately map text and entity types\ninto the same vector space, and reuses the vector representations of entity types for different text spans (or vice versa), resulting in a faster training and inference speed.\nBased on the bi-encoder representations, BINDER introduces a unified contrastive learning framework for NER, which encourages the representation of entity types to be similar with the corresponding\nentity mentions, and to be dissimilar with non-entity text spans.\nBINDER also introudces a novel dynamic thresholding loss in contrastive learning. At test time, it leverages candidate-specific dynamic thresholds to distinguish entity spans from non-entity ones.\nCheck out [our paper](https://openreview.net/forum?id=9EAQVEINuum) for the details.\n\nIf you find our code is useful, please cite:\n```bib\n@article{zhang-etal-2022-binder,\n  title={Optimizing Bi-Encoder for Named Entity Recognition via Contrastive Learning},\n  author={Zhang, Sheng and Cheng, Hao and Gao, Jianfeng and Poon, Hoifung},\n  journal={arXiv preprint arXiv:2208.14565},\n  year={2022}\n}\n```\n\n\n## Quick Start\n### 1. Data Preparation\n\nFollow the instructions [README.md](data_preproc/README.md) in the data_preproc folder.\n\n\n### 2. Environment Setup\n```bash\nconda create -n binder -y python=3.9\nconda activate binder\nconda install pytorch==1.13 pytorch-cuda=11.6 -c pytorch -c nvidia\npip install transformers==4.24.0 datasets==2.6.1 wandb==0.13.5 seqeval==1.2.2\n```\n\n### 3. Experiment Run\nAssuming you have prepared data for ACE2005 and finished environment setup, below is the command to run an experiment on ACE2005:\n```bash\npython run_ner.py conf/ace05.json\n```\n\nTo run experiments on other datasets, simply change the config.\n\n## Contributing\n\nThis project welcomes contributions and suggestions.  Most contributions require you to agree to a\nContributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us\nthe rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.\n\nWhen you submit a pull request, a CLA bot will automatically determine whether you need to provide\na CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions\nprovided by the bot. You will only need to do this once across all repos using our CLA.\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\nFor more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or\ncontact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\n\n## Trademarks\n\nThis project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft\ntrademarks or logos is subject to and must follow\n[Microsoft's Trademark \u0026 Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).\nUse of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.\nAny use of third-party trademarks or logos are subject to those third-party's policies.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosoft%2Fbinder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicrosoft%2Fbinder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosoft%2Fbinder/lists"}