Lab record
Machine Learning Experiments
A collection of browser experiments in text generation and sentiment classification using Transformers.js, with image classification planned.
Experiments
Text Generation
activeGenerate text using GPT-2 and other language models
Transformers.js · GPT-2
Sentiment Analysis
activeClassify the sentiment of English text
DistilBERT · ONNX
Image Classification
plannedClassify images using Vision Transformer models
ViT · WebGPU
About This Lab
This lab collects browser demonstrations of text generation and sentiment classification using Transformers.js and ONNX models. They are small examples for inspecting model behavior and browser inference.
Available Experiments
Text Generation
Generate a continuation from a prompt using a small language model. Output quality and latency depend on the selected model, input, and device.
Open the text generation demo.
Sentiment Analysis
Classify English text using the SST-2 DistilBERT model. Its task labels are positive and negative; its scores should be interpreted within that binary classification task.
Open the sentiment analysis demo.
Image Classification
An image-classification interface is planned. It is not currently available in this lab.
Browser Execution
The text demos download model files from Hugging Face and run inference in the browser using WebAssembly. The initial download can take time. Device memory, browser support, and selected model size affect performance.
Text is supplied to the local inference pipeline. Model downloads require a network connection; this page does not claim the complete application is offline.
Getting Started
- Open one of the available demos above.
- Check the selected model and enter text.
- Choose Load & Run to download the model and run inference.
- Inspect the output and compare inputs within the model’s stated task.
Model Reference
| Experiment | Model | Task |
|---|---|---|
| Text generation | Xenova/distilgpt2 | text-generation |
| Sentiment analysis | Xenova/distilbert-base-uncased-finetuned-sst-2-english | text-classification |
These model identifiers describe the demo configuration. The interface may offer other model choices.