Giter Site home page Giter Site logo

bact / sentimentdemo Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 4.58 MB

A simple sentiment analysis application, published solely as an artifact for the purpose of demonstrating a software bill of materials. Not recommended for critical text classification tasks.

License: Creative Commons Zero v1.0 Universal

Python 70.58% Shell 29.42%
ai artificial-intelligence demo software-bill-of-materials spdx spdx-sbom ai-bom

sentimentdemo's Introduction

sentimentdemo

A simple text classification application, published solely as an artifact for the purpose of demonstrating a software bill of materials (SBOM) in SPDX 3.0 format.

Not recommended for critical text classification tasks.

The main content of this repository is the software bill of materials at bom.spdx3.json. Other files are given to complete the illustration.

SBOM demonstration design goals:

  • Comprehensible: Small enough for a human to understand easily.
  • Informative: Elaborate enough to showcase the use of various information fields within an SBOM.
  • Testable: Designed to facilitate testing and evaluation against specific use case requirements.

Development is in the dev branch. Will eventually be submitted to spdx/spdx-examples repo.

Content

├── LICENSE               License information
├── README.md             This README file
├── bom.spdx3.json        Software bill of materials, in SPDX 3 format
├── data                  Dataset, preprocessed and tokenized
│   ├── test.txt          Testing data
│   ├── train.txt         Training data
│   └── valid.txt         Validation data
├── evaluate.py           A script to evaluate prediction performance
├── model.bin             A sentiment analysis model
├── predict.py            A script to predict a label of a text
├── preprocess.py         A script to prepare training data
├── rawdata               Raw dataset, before preprocessing
│   ├── test              Testing data
│   │   ├── neg.txt       Testing samples for label "neg" (negative)
│   │   ├── neu.txt       Testing samples for label "neu" (neutral)
│   │   ├── pos.txt       Testing samples for label "pos" (positive)
│   │   └── q.txt         Testing samples for label "q" (question)
│   ├── train             Training data
│   │   └── ...
│   └── valid             Validation data
│       └── ...
├── requirements.txt      List of required Python libraries
├── techdocs              Technical documentation
│   ├── dataprepare.md    Data prepration
│   └── instructions.md   Instruction for use
└── train.py              A script to build a model

A diagram showing relationships between elements in the Sentiment Demo package.

The diagram is generated from a PlantUML file: bom.spdx.puml. The PlantUML file is generated by spdx3ToGraph. To save space, spdxIds and long strings are shortened by the shortenid.sh script in tools/, and all but one hyperparameter have been manually removed.

Usage

See instruction for use for how to use the application.

Data preparation

See data preparation.

Notes

  • The energy used by the computer during model training is tracked by energy-tracker. It measures how much energy the computer uses during the training. This means the actual energy used for training the model might be a bit less than the reported amount.
  • The SPDX 3.0 SBOM is validated structurally against the JSON Schema at https://spdx.org/schema/3.0.0/spdx-json-schema.json and semantically against the SHACL model at https://spdx.org/rdf/3.0.0/spdx-model.ttl.
  • Next steps:
    • Add external dependency relationships (e.g. dependsOn, hasProvidedDependency)
    • Get tested with an SBOM quality check tool like sbomsq (once it supports SPDX 3.0).
    • Using information requirements and obligations in the EU AI Act as a target, labeling all relevant properties and relationships with corresponding difficulty levels and support levels, based on the BOM Maturity Model.

Licenses

Apart from the data and components listed in the table below, the code and content in this repository are dedicated to the public domain under the terms of Creative Commons Zero ("CC0") 1.0 Universal, which have no copyright and related or neighboring rights worldwide to the extent allowed by law.

Component Name License Notes
Training data Wisesight Sentiment Corpus Creative Commons Zero v1.0 Universal Samples from the corpus are in rawdata/. Preprocessed data is in data/. See data preparation for details.
Text preprocessor th-simple-preprocessor Apache License 2.0
Word tokenizer newmm-tokenizer Apache License 2.0 Inherited the license from PyThaiNLP.
Text classifier fastText MIT License
Array package NumPy BSD License

The specific version information can be found in requirements.txt.

sentimentdemo's People

Contributors

bact avatar

Stargazers

 avatar

Watchers

 avatar Kostas Georgiou avatar

sentimentdemo's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.