{"id":20462061,"url":"https://github.com/bact/sentimentdemo","last_synced_at":"2026-06-08T10:01:50.702Z","repository":{"id":245172318,"uuid":"816451017","full_name":"bact/sentimentdemo","owner":"bact","description":"AI BOM example. A simple sentiment analysis application, published solely as an artifact for the purpose of demonstrating a software bill of materials. Not recommended for any serious text classification task.","archived":false,"fork":false,"pushed_at":"2026-04-22T20:16:31.000Z","size":4804,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-30T22:27:04.342Z","etag":null,"topics":["ai","ai-bom","artificial-intelligence","demo","software-bill-of-materials","spdx","spdx-sbom"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bact.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-06-17T19:28:27.000Z","updated_at":"2026-04-30T11:18:07.000Z","dependencies_parsed_at":"2024-09-15T05:40:02.853Z","dependency_job_id":"0faa152d-7914-403b-ab52-211be73a887b","html_url":"https://github.com/bact/sentimentdemo","commit_stats":null,"previous_names":["bact/sentimentdemo"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/bact/sentimentdemo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bact%2Fsentimentdemo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bact%2Fsentimentdemo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bact%2Fsentimentdemo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bact%2Fsentimentdemo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bact","download_url":"https://codeload.github.com/bact/sentimentdemo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bact%2Fsentimentdemo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34057158,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"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":["ai","ai-bom","artificial-intelligence","demo","software-bill-of-materials","spdx","spdx-sbom"],"created_at":"2024-11-15T12:29:48.631Z","updated_at":"2026-06-08T10:01:50.696Z","avatar_url":"https://github.com/bact.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\nSPDX-FileContributor: Arthit Suriyawongkul\nSPDX-FileCopyrightText: 2024-present Arthit Suriyawongkul \u003csuriyawa@tcd.ie\u003e\nSPDX-FileType: DOCUMENTATION\nSPDX-License-Identifier: CC0-1.0\n---\n\n# Sentiment Demo: A Simple AI Application and its AI BOM Example\n\n[![PyPI - Version](https://img.shields.io/pypi/v/sentimentdemo)](https://pypi.org/project/sentimentdemo/)\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.14055332.svg)](https://doi.org/10.5281/zenodo.14055332)\n\nA simple text classification application, published solely to demonstrate\n[a software bill of materials (SBOM)](https://en.wikipedia.org/wiki/Software_supply_chain)\nin [SPDX 3.0 format](https://spdx.dev/use/specifications/).\n\n**The main content of the package is its software bill of materials at\n[bom.spdx3.json](./bom.spdx3.json).**\nOther files are given just to complete the illustration.\n\n*Not recommended for actual text classification tasks.*\n\nUpdates:\n\n- March 2026: Adopted as a development reference for the **[Pitloom][]**\n  SBOM generator.\n- May 2025: Added to the **[SPDX Usage Examples][spdx-examples]** repository\n  as [ai/example02][].\n  \nSBOM demonstration design goals:\n\n- **Comprehensible:** Small enough for a human to understand easily.\n- **Informative:** Elaborate enough to showcase the use of various information\n  fields within an SBOM.\n- **Testable:** Designed to facilitate testing and evaluation against specific\n  use case requirements.\n\nFor more information about implementing AI BOM using SPDX specification,\nsee *Karen Bennet, Gopi Krishnan Rajbahadur, Arthit Suriyawongkul,\nand Kate Stewart,\n[“Implementing AI Bill of Materials (AI BOM) with SPDX 3.0: A Comprehensive Guide to Creating AI and\nDataset Bill of Materials”](https://www.linuxfoundation.org/research/ai-bom),\nThe Linux Foundation, October 2024*.\n\n[spdx-examples]: https://github.com/spdx/spdx-examples\n[ai/example02]: https://github.com/spdx/spdx-examples/tree/master/ai/example02\n[Pitloom]: https://github.com/bact/pitloom\n\n## Content\n\n```text\n.\n├── LICENSE               License information\n├── README.md             This README file\n├── bom.spdx3.json        Software bill of materials, in SPDX 3 format\n├── data                  Dataset, preprocessed and tokenized\n│   ├── test.txt          Testing data\n│   ├── train.txt         Training data\n│   └── valid.txt         Validation data\n├── rawdata               Raw dataset, before preprocessing\n│   ├── test              Testing data\n│   │   ├── neg.txt       Testing samples for label \"neg\" (negative)\n│   │   ├── neu.txt       Testing samples for label \"neu\" (neutral)\n│   │   ├── pos.txt       Testing samples for label \"pos\" (positive)\n│   │   └── q.txt         Testing samples for label \"q\" (question)\n│   ├── train             Training data\n│   │   └── ...\n│   └── valid             Validation data\n│       └── ...\n├── src\n│   ├── evaluate.py       A script to evaluate prediction performance\n│   ├── model.bin         A sentiment analysis model\n│   ├── predict.py        A script to predict a label of a text\n│   ├── preprocess.py     A script to prepare training data\n│   └── train.py          A script to build a model\n└── techdocs              Technical documentation\n    ├── dataprepare.md    Data preparation\n    └── instructions.md   Instruction for use\n```\n\n[![A diagram showing relationships between elements in the Sentiment Demo package.](./bom.spdx3.png \"A diagram showing relationships between elements in the Sentiment Demo package.\")](./bom.spdx3.png)\n\n## Usage\n\nSee [instruction for use](./techdocs/instructions.md) for how to use the\napplication.\n\n## Data preparation\n\nSee [data preparation](./techdocs/dataprepare.md).\n\n## Notes\n\n- Development is in the `main` branch.\n- The diagram is generated from a PlantUML file:\n  [bom.spdx.puml](./bom.spdx3.puml).\n  The PlantUML file is generated by\n  [spdx3ToGraph](https://github.com/maxhbr/spdx3ToGraph).\n  To brevity, spdxIds and long strings are shortened by the\n  [shortenid.sh](./tools/shortenid.sh) script in tools/, and all but one\n  hyperparameter have been manually removed.\n- The energy used by the computer during model training is tracked by\n  [energy-tracker](https://github.com/rdegges/energy-tracker).\n  It measures how much energy the computer uses during the training.\n  This means the actual energy used for training the model might be a bit less\n  than the reported amount.\n- The SPDX 3.0.1 SBOM is validated structurally against the JSON Schema at\n  \u003chttps://spdx.org/schema/3.0.1/spdx-json-schema.json\u003e\n  and semantically against the SHACL model at\n  \u003chttps://spdx.org/rdf/3.0.1/spdx-model.ttl\u003e.\n- Next steps:\n  - Add external dependency relationships\n    (e.g. `dependsOn`, `hasProvidedDependency`)\n  - Get tested with an SBOM quality check tool like\n    [sbomsq](https://github.com/interlynk-io/sbomqs) (once it supports SPDX\n    3.0).\n  - Using information requirements and obligations in the EU AI Act as a\n    target, labeling all relevant properties and relationships with\n    corresponding difficulty levels and support levels, based on the\n    [BOM Maturity Model](https://scvs.owasp.org/bom-maturity-model/difficulty-levels/).\n\n## Licenses\n\nApart from the data and components listed in the table below, the code and\ncontent in this repository are dedicated to the public domain under the terms\nof Creative Commons Zero (\"CC0\") 1.0 Universal, which have no copyright and\nrelated or neighboring rights worldwide to the extent allowed by law.\n\n| Component | Name | License | Notes |\n| --------- | ---- | ------- | ----- |\n| Training data | [Wisesight Sentiment Corpus](https://github.com/PyThaiNLP/wisesight-sentiment) | CC0-1.0 | Samples from the corpus are in `rawdata/`. Preprocessed data is in `data/`. See [data preparation](./techdocs/dataprepare.md) for details. |\n| Text preprocessor | [th-simple-preprocessor](https://pypi.org/project/th-simple-preprocessor/) |  Apache-2.0 | |\n| Word tokenizer | [newmm-tokenizer](https://pypi.org/project/newmm-tokenizer/) | Apache-2.0 | Inherited the license from [PyThaiNLP](https://pypi.org/project/pythainlp/). |\n| Text classifier | [fastText](https://fasttext.cc/) | MIT | Use [fasttext-community](https://pypi.org/project/fasttext-community/), which is a community-maintained fork. |\n| Array package | [NumPy](https://pypi.org/project/numpy/) | BSD-3-Clause AND 0BSD AND MIT AND Zlib AND CC0-1.0 | |\n\nThe specific version information can be found in [pyproject.toml](./pyproject.toml).\n\n## Citation\n\nIf you use this software, including its software bill of materials (SBOM),\nplease cite it as follows:\n\n\u003e Suriyawongkul, Arthit. “Sentiment Demo: A Simple AI Application and Its AI BOM Example”. Zenodo, 8 November 2024. \u003chttps://doi.org/10.5281/zenodo.14055332\u003e.\n\nBibTeX:\n\n```bibtex\n@software{Suriyawongkul_Sentiment_Demo_A_2024,\n    author = {Suriyawongkul, Arthit},\n    doi = {10.5281/zenodo.14055332},\n    license = {CC0-1.0},\n    month = nov,\n    title = {{Sentiment Demo: A Simple AI Application and its AI BOM Example}},\n    url = {https://github.com/bact/sentimentdemo/},\n    version = {0.1},\n    year = {2024}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbact%2Fsentimentdemo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbact%2Fsentimentdemo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbact%2Fsentimentdemo/lists"}