Skip to content

Sxnnyside-Project/TensorSuggestLite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

TensorSuggestLite

Configuration-Driven Text Classification
A CoreRed Experimental Tool

AboutFeaturesInstallationUsageArchitectureDocumentationContributing


About

TensorSuggestLite transforms structured configuration files (JSON, YAML, TOML) into trained TensorFlow/Keras text classification models with automatic TFLite export for embedded deployment.

Designed for rapid ML prototyping, TensorSuggestLite eliminates boilerplate code by treating configuration as training data. Define your categories and examples in a simple file format, and let the application handle tokenization, training, and model export.

Philosophy

"Configuration as training data."

TensorSuggestLite embodies pragmatic ML workflows: declarative inputs, transparent processing, portable outputs. No framework lock-in, no hidden complexity—just direct transformation from structured data to deployable models.

This is a CoreRed project, part of an experimental toolkit for developers who value simplicity and reproducibility.

Features

  • Multi-Format Input: Parse JSON, YAML, and TOML configuration files
  • Automated Training: TensorFlow/Keras model generation with progress tracking
  • Complete Artifact Export:
    • tokenizer.json - Vocabulary and preprocessing config
    • text_classifier.keras - Full Keras model for inference
    • label_encoder.json - Category-to-index mappings
    • text_classifier.tflite - Quantized model for mobile/edge
  • Dual Interface:
    • PyQt6 desktop GUI with real-time feedback
    • Python API for scripting and automation
  • Modular Architecture: Format-specific interpreters with isolated logic
  • Theme Support: Dark and light UI themes
  • Cross-Platform: Runs on Linux, macOS, and Windows

Installation

Quick Start

git clone https://github.com/Sxnnyside-Project/TensorSuggestLite.git
cd TensorSuggestLite
make setup

Prerequisites

  • Python 3.8 or later
  • pip (Python package manager)
  • 2 GB RAM minimum (4 GB recommended)

Manual Setup

# Create virtual environment
python3 -m venv .venv
source .venv/bin/activate  # Windows: .venv\Scripts\activate

# Install dependencies
pip install -r requirements-pinned.txt

Verification

# Test core imports
python -c "from json_interpreter import trainer; print('✓ Installation verified')"

# Launch GUI
make run

Usage

GUI Application

make run

Workflow:

  1. Click Import JSON/YAML/TOML → select configuration file
  2. Click Train Model → wait for training (1-5 minutes)
  3. Click Generate TFLite → convert to mobile format
  4. Click Export TFLite → save for deployment

Programmatic API

Basic Training

from json_interpreter import trainer

result = trainer.train_from_json('config.json')
print(f"Model: {result['model_path']}")

With Progress Callbacks

from json_interpreter import trainer

def on_progress(percent):
    print(f"Training: {percent}%")

def on_log(message):
    print(f"[LOG] {message}")

result = trainer.train_from_json(
    'config.json',
    progress_cb=on_progress,
    log_cb=on_log,
    epochs=12
)

TFLite Conversion

from json_interpreter import trainer

tflite_path = trainer.convert_to_tflite(
    model_dir='generated/json',
    progress_cb=on_progress,
    log_cb=on_log
)
print(f"TFLite: {tflite_path}")

Configuration Format

All formats follow this structure:

{
  "CATEGORY_NAME": {
    "respuestas": [
      {"respuesta": "training text example 1"},
      {"respuesta": "training text example 2"}
    ],
    "sinonimos": ["synonym1", "synonym2"]
  }
}

Example (test/question_data.json):

{
  "POSITIVE": {
    "respuestas": [
      {"respuesta": "This is excellent!"},
      {"respuesta": "I love this product"}
    ],
    "sinonimos": ["good", "great", "amazing"]
  },
  "NEGATIVE": {
    "respuestas": [
      {"respuesta": "This is terrible"},
      {"respuesta": "Very disappointing"}
    ],
    "sinonimos": ["bad", "poor", "awful"]
  }
}

Architecture

TensorSuggestLite/
├── tensorsuggestlite.py      # GUI entry point
├── json_interpreter/          # JSON format handler
│   └── trainer.py             # Training & conversion
├── yaml_interpreter/          # YAML format handler
│   └── trainer.py
├── toml_interpreter/          # TOML format handler
│   └── trainer.py
├── styles/                    # UI themes
│   ├── dark.qss
│   └── light.qss
├── examples/                  # Functional examples (English schema)
│   ├── example.json           # Recommended format
│   ├── example.yaml
│   └── example.toml
├── test/                      # Test data (legacy, Spanish)
├── generated/                 # Runtime output (git-ignored)
│   ├── json/
│   ├── yaml/
│   └── toml/
└── docs/                      # Documentation

Technology Stack

Component Technology
ML Framework TensorFlow/Keras
GUI PyQt6
Data Processing NumPy, scikit-learn
Config Parsing PyYAML, toml

Processing Pipeline

  1. Parse configuration → extract text samples and labels
  2. Tokenize → build vocabulary using Keras Tokenizer
  3. Encode → map labels to numeric IDs
  4. Train → simple neural network (Embedding → Dense → Softmax)
  5. Export → save tokenizer, model, label encoder
  6. Convert → TFLite with quantization optimization

Documentation

Makefile Commands

make help      # Show all commands
make setup     # Install dependencies
make run       # Launch GUI
make clean     # Remove generated files
make lint      # Run code quality checks
make test      # Run tests (when implemented)

Project Status

Version: 2.0 (Experimental)

TensorSuggestLite is functional and stable for prototyping. API is subject to change based on community feedback.

Known Limitations

  • No input validation (well-formed files required)
  • Single-threaded training (may freeze GUI briefly)
  • No hyperparameter tuning interface
  • No real-time evaluation metrics
  • Basic model architecture (not SOTA)

See REPOSITORY_STATUS.md for complete details.

Roadmap

  • CLI mode for headless operation
  • Input validation and error recovery
  • Model evaluation metrics display
  • Hyperparameter configuration UI
  • Batch processing support

Contributing

Contributions are welcome! See CONTRIBUTING.md for:

  • Development setup
  • Code standards
  • Pull request process
  • Review criteria

Priority Areas:

  1. Input validation
  2. Test coverage (pytest)
  3. CLI mode implementation
  4. Documentation improvements

Before contributing, read our Code of Conduct.

Security

For security vulnerabilities, see SECURITY.md.

Do not report security issues via GitHub Issues.

Contact: security.sxnnyside@sxnnysideproject.com

License

This project is licensed under the MIT License - see LICENSE for details.

Copyright (c) 2025-2026 CoreRed Project

Support


Built with discipline by CoreRed Project

About

TensorSuggestLite transforms structured configuration files (JSON, YAML, TOML) into trained TensorFlow/Keras text classification models with automatic TFLite export for embedded deployment.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

 
 
 

Contributors