{"id":13595192,"url":"https://github.com/chakki-works/seqeval","last_synced_at":"2025-05-14T13:05:50.662Z","repository":{"id":37910969,"uuid":"121575654","full_name":"chakki-works/seqeval","owner":"chakki-works","description":"A Python framework for sequence labeling evaluation(named-entity recognition, pos tagging, etc...)","archived":false,"fork":false,"pushed_at":"2024-08-28T11:35:51.000Z","size":184,"stargazers_count":1132,"open_issues_count":34,"forks_count":131,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-05-09T13:02:41.710Z","etag":null,"topics":["conlleval","deep-learning","machine-learning","named-entity-recognition","natural-language-processing","python","sequence-labeling","sequence-labeling-evaluation"],"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/chakki-works.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"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},"funding":{"github":"Hironsan"}},"created_at":"2018-02-15T00:02:36.000Z","updated_at":"2025-05-07T21:05:23.000Z","dependencies_parsed_at":"2023-01-25T10:45:26.537Z","dependency_job_id":"55c5e0a7-acc0-4970-8dab-b1d189cfe71f","html_url":"https://github.com/chakki-works/seqeval","commit_stats":{"total_commits":151,"total_committers":13,"mean_commits":"11.615384615384615","dds":0.2715231788079471,"last_synced_commit":"cd01b5210eaa65e691c22320aba56f2be9e9fc43"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chakki-works%2Fseqeval","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chakki-works%2Fseqeval/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chakki-works%2Fseqeval/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chakki-works%2Fseqeval/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chakki-works","download_url":"https://codeload.github.com/chakki-works/seqeval/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254149925,"owners_count":22022851,"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":["conlleval","deep-learning","machine-learning","named-entity-recognition","natural-language-processing","python","sequence-labeling","sequence-labeling-evaluation"],"created_at":"2024-08-01T16:01:45.548Z","updated_at":"2025-05-14T13:05:50.634Z","avatar_url":"https://github.com/chakki-works.png","language":"Python","readme":"# seqeval\n\nseqeval is a Python framework for sequence labeling evaluation.\nseqeval can evaluate the performance of chunking tasks such as named-entity recognition, part-of-speech tagging, semantic role labeling and so on.\n\nThis is well-tested by using the Perl script [conlleval](https://www.clips.uantwerpen.be/conll2002/ner/bin/conlleval.txt),\nwhich can be used for measuring the performance of a system that has processed the CoNLL-2000 shared task data.\n\n## Support features\n\nseqeval supports following schemes:\n\n- IOB1\n- IOB2\n- IOE1\n- IOE2\n- IOBES(only in strict mode)\n- BILOU(only in strict mode)\n\nand following metrics:\n\n| metrics  | description  |\n|---|---|\n| accuracy_score(y\\_true, y\\_pred)  | Compute the accuracy.  |\n| precision_score(y\\_true, y\\_pred)  | Compute the precision.  |\n| recall_score(y\\_true, y\\_pred)  | Compute the recall.  |\n| f1_score(y\\_true, y\\_pred)  | Compute the F1 score, also known as balanced F-score or F-measure.  |\n| classification_report(y\\_true, y\\_pred, digits=2)  | Build a text report showing the main classification metrics. `digits` is number of digits for formatting output floating point values. Default value is `2`. |\n\n## Usage\n\nseqeval supports the two evaluation modes. You can specify the following mode to each metrics:\n\n- default\n- strict\n\nThe default mode is compatible with [conlleval](https://www.clips.uantwerpen.be/conll2002/ner/bin/conlleval.txt). If you want to use the default mode, you don't need to specify it:\n\n```python\n\u003e\u003e\u003e from seqeval.metrics import accuracy_score\n\u003e\u003e\u003e from seqeval.metrics import classification_report\n\u003e\u003e\u003e from seqeval.metrics import f1_score\n\u003e\u003e\u003e y_true = [['O', 'O', 'O', 'B-MISC', 'I-MISC', 'I-MISC', 'O'], ['B-PER', 'I-PER', 'O']]\n\u003e\u003e\u003e y_pred = [['O', 'O', 'B-MISC', 'I-MISC', 'I-MISC', 'I-MISC', 'O'], ['B-PER', 'I-PER', 'O']]\n\u003e\u003e\u003e f1_score(y_true, y_pred)\n0.50\n\u003e\u003e\u003e classification_report(y_true, y_pred)\n              precision    recall  f1-score   support\n\n        MISC       0.00      0.00      0.00         1\n         PER       1.00      1.00      1.00         1\n\n   micro avg       0.50      0.50      0.50         2\n   macro avg       0.50      0.50      0.50         2\nweighted avg       0.50      0.50      0.50         2\n```\n\nIn strict mode, the inputs are evaluated according to the specified schema. The behavior of the strict mode is different from the default one which is designed to simulate conlleval. If you want to use the strict mode, please specify `mode='strict'` and `scheme` arguments at the same time:\n\n```python\n\u003e\u003e\u003e from seqeval.scheme import IOB2\n\u003e\u003e\u003e classification_report(y_true, y_pred, mode='strict', scheme=IOB2)\n              precision    recall  f1-score   support\n\n        MISC       0.00      0.00      0.00         1\n         PER       1.00      1.00      1.00         1\n\n   micro avg       0.50      0.50      0.50         2\n   macro avg       0.50      0.50      0.50         2\nweighted avg       0.50      0.50      0.50         2\n```\n\nA minimum case to explain differences between the default and strict mode:\n\n```python\n\u003e\u003e\u003e from seqeval.metrics import classification_report\n\u003e\u003e\u003e from seqeval.scheme import IOB2\n\u003e\u003e\u003e y_true = [['B-NP', 'I-NP', 'O']]\n\u003e\u003e\u003e y_pred = [['I-NP', 'I-NP', 'O']]\n\u003e\u003e\u003e classification_report(y_true, y_pred)\n              precision    recall  f1-score   support\n          NP       1.00      1.00      1.00         1\n   micro avg       1.00      1.00      1.00         1\n   macro avg       1.00      1.00      1.00         1\nweighted avg       1.00      1.00      1.00         1\n\u003e\u003e\u003e classification_report(y_true, y_pred, mode='strict', scheme=IOB2)\n              precision    recall  f1-score   support\n          NP       0.00      0.00      0.00         1\n   micro avg       0.00      0.00      0.00         1\n   macro avg       0.00      0.00      0.00         1\nweighted avg       0.00      0.00      0.00         1\n```\n\n## Installation\n\nTo install seqeval, simply run:\n\n```bash\npip install seqeval\n```\n\n## License\n\n[MIT](https://github.com/chakki-works/seqeval/blob/master/LICENSE)\n\n## Citation\n\n```tex\n@misc{seqeval,\n  title={{seqeval}: A Python framework for sequence labeling evaluation},\n  url={https://github.com/chakki-works/seqeval},\n  note={Software available from https://github.com/chakki-works/seqeval},\n  author={Hiroki Nakayama},\n  year={2018},\n}\n```\n","funding_links":["https://github.com/sponsors/Hironsan"],"categories":["Python","Evaluation"],"sub_categories":["Japanese"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchakki-works%2Fseqeval","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchakki-works%2Fseqeval","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchakki-works%2Fseqeval/lists"}