Loading AI model...

๐Ÿง  Semantic Quiz

AI-powered answer grading using Transformers.js - 100% in your browser

Transformers.js MIT License 100% Client-Side Repo: ๐ŸŒŸ Repo: embeddings-quiz ๐Ÿ“– Read Article

๐ŸŽฏ Test Your Knowledge

Question 1 of 5 Score: 0/0 (0%)
Loading quiz...

๐Ÿ“– How Does Semantic Quiz Grading Work?

๐Ÿ”ค Text to Numbers

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.

๐Ÿ“ Cosine Similarity

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!

similarity = (A ยท B) / (||A|| ร— ||B||)
Dot product divided by the product of magnitudes

๐Ÿง  Why Embeddings?

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!

โšก 100% Browser-Based

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.

๐ŸŽฏ Scoring System

Your score is determined by how semantically similar your answer is to the expected answer:

Similarity Rating Points Meaning
โ‰ฅ 85% Excellent! 1.0 Your answer captures the core concept accurately
โ‰ฅ 70% Good! 0.8 Good understanding with minor gaps
โ‰ฅ 55% Partial 0.5 Some relevant concepts mentioned
< 55% Try Again 0 Answer doesn't match the expected concept