{"id":15158099,"url":"https://github.com/doccano/spacy-partial-tagger","last_synced_at":"2025-10-24T14:32:04.282Z","repository":{"id":37828674,"uuid":"481847041","full_name":"doccano/spacy-partial-tagger","owner":"doccano","description":"A simple library for training named entity recognition model from partially annotated data","archived":false,"fork":false,"pushed_at":"2023-11-12T09:31:59.000Z","size":555,"stargazers_count":23,"open_issues_count":0,"forks_count":2,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-02-08T20:41:40.288Z","etag":null,"topics":["named-entity-recognition","natural-language-processing","nlp","spacy","weak","weak-supervision","weakly-supervised-learning"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","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/doccano.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"docs/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-04-15T05:26:34.000Z","updated_at":"2025-02-05T00:38:13.000Z","dependencies_parsed_at":"2024-09-22T07:00:53.722Z","dependency_job_id":null,"html_url":"https://github.com/doccano/spacy-partial-tagger","commit_stats":null,"previous_names":["tech-sketch/spacy-partial-tagger"],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doccano%2Fspacy-partial-tagger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doccano%2Fspacy-partial-tagger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doccano%2Fspacy-partial-tagger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doccano%2Fspacy-partial-tagger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/doccano","download_url":"https://codeload.github.com/doccano/spacy-partial-tagger/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237870902,"owners_count":19379377,"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":["named-entity-recognition","natural-language-processing","nlp","spacy","weak","weak-supervision","weakly-supervised-learning"],"created_at":"2024-09-26T20:23:24.856Z","updated_at":"2025-10-24T14:31:59.240Z","avatar_url":"https://github.com/doccano.png","language":"Jupyter Notebook","readme":"# spacy-partial-tagger\n\nThis is a library to build a CRF tagger for a partially annotated dataset in spaCy. You can build your own NER tagger only from dictionary. The algorithm of this tagger is based on Effland and Collins. (2021).\n\n## Overview\n\n![The overview of spacy-partial-tagger](https://raw.githubusercontent.com/doccano/spacy-partial-tagger/main/images/overview.png)\n\n## Dataset Preparation\n\nPrepare spaCy binary format file to train your tagger.\nIf you are not familiar with spaCy binary format, see [this page](https://spacy.io/api/data-formats#training).\n\nYou can prepare your own dataset with [spaCy's entity ruler](https://spacy.io/usage/rule-based-matching#entityruler) as follows:\n\n```py\nimport spacy\nfrom spacy.tokens import DocBin\n\n\nnlp = spacy.blank(\"en\")\n\npatterns = [{\"label\": \"LOC\", \"pattern\": \"Tokyo\"}, {\"label\": \"LOC\", \"pattern\": \"Japan\"}]\nruler = nlp.add_pipe(\"entity_ruler\")\nruler.add_patterns(patterns)\n\ndoc = nlp(\"Tokyo is the capital of Japan.\")\n\ndoc_bin = DocBin()\ndoc_bin.add(doc)\n\n# Replace /path/to/data.spacy with your own path\ndoc_bin.to_disk(\"/path/to/data.spacy\")\n```\n\n## Training\n\nTrain your tagger as follows:\n\n```sh\npython -m spacy train config.cfg --output outputs --paths.train /path/to/train.spacy --paths.dev /path/to/dev.spacy --gpu-id 0\n```\n\nThis library is implemented as [a trainable component](https://spacy.io/usage/layers-architectures#components) in spaCy,\nso you could control the training setting via spaCy's configuration system.\nWe provide you the default configuration file [here](https://github.com/tech-sketch/spacy-partial-tagger/blob/main/config.cfg).\nOr you could setup your own. If you are not familiar with spaCy's config file format, please check the [documentation](https://spacy.io/usage/training#config).\n\nDon't forget to replace `/path/to/train.spacy` and `/path/to/dev.spacy` with your own.\n\n## Evaluation\n\nEvaluate your tagger as follows:\n\n```sh\npython -m spacy evaluate outputs/model-best /path/to/test.spacy --gpu-id 0\n```\n\nDon't forget to replace `/path/to/test.spacy` with your own.\n\n## Installation\n\n```sh\npip install spacy-partial-tagger\n```\n\nIf you use M1 Mac, you might have problems installing `fugashi`. In that case, please try `brew install mecab` before the installation.\n\n## References\n\n- Thomas Effland and Michael Collins. 2021. [Partially Supervised Named Entity Recognition via the Expected Entity Ratio Loss](https://aclanthology.org/2021.tacl-1.78/). _Transactions of the Association for Computational Linguistics_, 9:1320–1335.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoccano%2Fspacy-partial-tagger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdoccano%2Fspacy-partial-tagger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoccano%2Fspacy-partial-tagger/lists"}