RuangBaca Similarity
- Model
- Sentence Transformers
- Vector store
- ChromaDB
- Deploy
- Hugging Face Spaces
A microservice that computes semantic similarity between academic documents using dense vector embeddings. Built to power the plagiarism-detection layer of Ruang Baca Informatika.
Why semantic, not keyword
Keyword matching (TF-IDF, Jaccard) fails when two documents discuss the same topic using different vocabulary. A thesis on “network packet analysis” and one on “traffic monitoring” cover the same ground — keyword methods score them as dissimilar.
Sentence Transformers encode meaning into fixed-length vectors. Cosine similarity on those vectors catches paraphrasing and conceptual overlap that string matching misses entirely.
Architecture
POST /similarity
→ tokenise + encode (sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2)
→ store embedding in ChromaDB collection
→ query top-k nearest neighbours
→ return similarity scores + matched document IDsThe model is multilingual by design — Indonesian and English academic titles are both handled without separate preprocessing pipelines.
Deployment
Packaged as a Docker image and deployed to Hugging Face Spaces. The
docker SDK configuration in the Space keeps startup time under 30 seconds
on a cold container.
ONNX export was tested to reduce inference latency; the trade-off in accuracy on short Indonesian titles was not worth it, so the standard PyTorch model is used in production.