{"id":13594929,"url":"https://github.com/juntaoy/biaffine-ner","last_synced_at":"2026-01-02T16:59:11.229Z","repository":{"id":39739214,"uuid":"253872361","full_name":"juntaoy/biaffine-ner","owner":"juntaoy","description":"Named Entity Recognition as Dependency Parsing","archived":false,"fork":false,"pushed_at":"2023-08-16T08:32:01.000Z","size":54,"stargazers_count":349,"open_issues_count":32,"forks_count":40,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-11-06T17:43:41.984Z","etag":null,"topics":["ner","parsing"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/juntaoy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-04-07T17:58:16.000Z","updated_at":"2024-11-02T11:44:28.000Z","dependencies_parsed_at":"2023-01-23T03:16:02.684Z","dependency_job_id":"23bdd585-3496-4961-ba40-c71761f728be","html_url":"https://github.com/juntaoy/biaffine-ner","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/juntaoy%2Fbiaffine-ner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juntaoy%2Fbiaffine-ner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juntaoy%2Fbiaffine-ner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juntaoy%2Fbiaffine-ner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/juntaoy","download_url":"https://codeload.github.com/juntaoy/biaffine-ner/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248020593,"owners_count":21034459,"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":["ner","parsing"],"created_at":"2024-08-01T16:01:41.020Z","updated_at":"2026-01-02T16:59:11.178Z","avatar_url":"https://github.com/juntaoy.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Named Entity Recognition as Dependency Parsing\n\n## Introduction\nThis repository contains code introduced in the following paper:\n \n**[Named Entity Recognition as Dependency Parsing](https://www.aclweb.org/anthology/2020.acl-main.577/)**  \nJuntao Yu, Bernd Bohnet and Massimo Poesio  \nIn *Proceedings of the 58th Annual Conference of the Association for Computational Linguistics (ACL)*, 2020\n\n## Setup Environments\n* The code is written in Python 2 and Tensorflow 1.0, A Python3 and Tensorflow 2.0 version is provided by Amir (see **Other Versions**).  \n* Before starting, you need to install all the required packages listed in the requirment.txt using `pip install -r requirements.txt`.\n* Then download the BERT models, for English we used the [original cased BERT-Large model](https://storage.googleapis.com/bert_models/2018_10_18/cased_L-24_H-1024_A-16.zip) and for other languages we used the [cased BERT-Base multilingual model]( https://storage.googleapis.com/bert_models/2018_11_23/multi_cased_L-12_H-768_A-12.zip).\n* After that modify and run `extract_bert_features/extract_bert_features.sh` to compute the BERT embeddings for your training or testing.\n* You also need to download context-independent word embeddings such as fasttext or GloVe embeddings that required by the system.\n\n## To use a pre-trained model\n* Pre-trained models can be download from [this link](https://drive.google.com/file/d/1n_-I1kmZHwr0eMZ89xhnaEqxubJ1tvsM/view?usp=sharing). We provide all nine pre-trained models reported in our paper.\n* Choose the model you want to use and copy them to the `logs/` folder.\n* Modifiy the *test_path* accordingly in the `experiments.conf`:\n   * the *test_path* is the path to *.jsonlines* file, each line of the *.jsonlines* file is a batch of sentences and must in the following format:\n   \n   ```\n  {\"doc_key\": \"batch_01\", \n  \"ners\": [[[0, 0, \"PER\"], [3, 3, \"GPE\"], [5, 5, \"GPE\"]], \n  [[3, 3, \"PER\"], [10, 14, \"ORG\"], [20, 20, \"GPE\"], [20, 25, \"GPE\"], [22, 22, \"GPE\"]], \n  []], \n  \"sentences\": [[\"Anwar\", \"arrived\", \"in\", \"Shanghai\", \"from\", \"Nanjing\", \"yesterday\", \"afternoon\", \".\"], \n  [\"This\", \"morning\", \",\", \"Anwar\", \"attended\", \"the\", \"foundation\", \"laying\", \"ceremony\", \"of\", \"the\", \"Minhang\", \"China-Malaysia\", \"joint-venture\", \"enterprise\", \",\", \"and\", \"after\", \"that\", \"toured\", \"Pudong\", \"'s\", \"Jingqiao\", \"export\", \"processing\", \"district\", \".\"], \n  [\"(\", \"End\", \")\"]]}\n  ```\n  \n  * Each of the sentences in the batch corresponds to a list of NEs stored under `ners` key, if some sentences do not contain NEs use an empty list `[]` instead.\n* Then use `python evaluate.py config_name` to start your evaluation\n\n## To train your own model\n* You will need additionally to create the character vocabulary by using `python get_char_vocab.py train.jsonlines dev.jsonlines`\n* Then you can start training by using `python train.py config_name`\n\n## Other Versions\n* [Amir Zeldes](https://github.com/amir-zeldes) kindly created a tensorflow 2.0 and python 3 ready version and can be find [here](https://github.com/amir-zeldes/biaffine-ner)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuntaoy%2Fbiaffine-ner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuntaoy%2Fbiaffine-ner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuntaoy%2Fbiaffine-ner/lists"}