AI-powered answer grading using Transformers.js - 100% in your browser
The answer is converted into a 384-dimensional vector (a list of 384 numbers) using the
all-MiniLM-L6-v2 transformer model. This captures the meaning
of the text, not just the exact words.
We compare the answer vector to the expected answer vector by measuring the angle between them. Smaller angle = higher similarity. This means paraphrased answers still get credit!
Unlike exact text matching, embeddings understand that "Paris is the capital" and "The capital of France is Paris" mean the same thing. This is the power of semantic understanding!
Everything runs locally in your browser using WebAssembly (WASM). No data is sent to any server - your answers stay private. The model is cached after first load for instant startup.