Skip to main content
← All labs

Lab record

Machine Learning Experiments

A collection of browser experiments in text generation and sentiment classification using Transformers.js, with image classification planned.

Machine LearningNLPComputer VisionBrowser AI

Experiments

Text Generation

active

Generate text using GPT-2 and other language models

Transformers.js · GPT-2

Sentiment Analysis

active

Classify the sentiment of English text

DistilBERT · ONNX

Image Classification

planned

Classify 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

  1. Open one of the available demos above.
  2. Check the selected model and enter text.
  3. Choose Load & Run to download the model and run inference.
  4. Inspect the output and compare inputs within the model’s stated task.

Model Reference

ExperimentModelTask
Text generationXenova/distilgpt2text-generation
Sentiment analysisXenova/distilbert-base-uncased-finetuned-sst-2-englishtext-classification

These model identifiers describe the demo configuration. The interface may offer other model choices.