{"id":16194686,"url":"https://github.com/yasufumy/sequence-classifier","last_synced_at":"2026-05-02T04:35:08.001Z","repository":{"id":204292935,"uuid":"711509900","full_name":"yasufumy/sequence-classifier","owner":"yasufumy","description":"A PyTorch Library for Sequence Labeling Tasks such as Named-entity Recognition or Part-of-speech Tagging","archived":false,"fork":false,"pushed_at":"2023-12-13T13:24:51.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-03-29T14:29:36.947Z","etag":null,"topics":["bert","deberta","named-entity-recognition","part-of-speech-tagging","pytorch","roberta","sequence-labeling","torch","transformers"],"latest_commit_sha":null,"homepage":"","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/yasufumy.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":"2023-10-29T13:46:22.000Z","updated_at":"2023-12-10T03:03:29.000Z","dependencies_parsed_at":"2023-12-10T03:33:17.847Z","dependency_job_id":null,"html_url":"https://github.com/yasufumy/sequence-classifier","commit_stats":null,"previous_names":["yasufumy/sequence-classifier"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/yasufumy/sequence-classifier","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yasufumy%2Fsequence-classifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yasufumy%2Fsequence-classifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yasufumy%2Fsequence-classifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yasufumy%2Fsequence-classifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yasufumy","download_url":"https://codeload.github.com/yasufumy/sequence-classifier/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yasufumy%2Fsequence-classifier/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32523427,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-02T01:12:54.858Z","status":"online","status_checked_at":"2026-05-02T02:00:05.923Z","response_time":132,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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","deberta","named-entity-recognition","part-of-speech-tagging","pytorch","roberta","sequence-labeling","torch","transformers"],"created_at":"2024-10-10T08:24:32.213Z","updated_at":"2026-05-02T04:35:07.986Z","avatar_url":"https://github.com/yasufumy.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sequence-classifier\n\n`sequence-classifier` is an open-source library designed for sequence classification in PyTorch. It provides utilities for sequence classifiers, particularly Conditional random fields (CRFs), and it can calculate the log likelihood of tag sequences and retrieve the best label sequences. `sequence-classifier` also offers the capability to compute the marginal log likelihood and the marginal probability. These features are handy when working with partially annotated datasets.\n\nIf you are searching for libraries to handle sequence labeling tasks such as named-entity recognition or part-of-speech tagging combined with the use of foundation models like BERT, RoBERTa, or DeBERTa, you will find `sequence-classifier` to be helpful.\n\n## Prerequisites\n\n- Python 3.8+\n\n## Installation\n\nYou can install sequence-classifier via pip:\n\n```bash\npip install sequence-classifier\n```\n\n## Basic Usage\n\n```python\nimport torch\nfrom sequence_classifier.crf import Crf\n\nbatch_size = 3\nsequence_length = 15\nnum_tags = 6\n\nlogits = torch.randn(batch_size, sequence_length, num_tags)\ntag_indices = torch.randint(0, num_tags, (batch_size, sequence_length))\n\nmodel = Crf(num_tags)\n\ndist = model(logits)\n\nnll_loss = dist.log_likelihood(tag_indices).sum().neg()\nbest_sequence = dist.argmax\n```\n\n## References\n\n- Alexander Rush. 2020. [Torch-Struct: Deep Structured Prediction Library](https://aclanthology.org/2020.acl-demos.38/). In _Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics: System Demonstrations_, pages 335–342, Online. Association for Computational Linguistics.\n- Yuta Tsuboi, Hisashi Kashima, Shinsuke Mori, Hiroki Oda, and Yuji Matsumoto. 2008. [Training Conditional Random Fields Using Incomplete Annotations](https://aclanthology.org/C08-1113/). In _Proceedings of the 22nd International Conference on Computational Linguistics (Coling 2008)_, pages 897–904, Manchester, UK. Coling 2008 Organizing Committee.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyasufumy%2Fsequence-classifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyasufumy%2Fsequence-classifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyasufumy%2Fsequence-classifier/lists"}