Sloth Inbox:以小型開源模型整理待分類筆記
Sloth Inbox: let a tiny open model sort the notes you keep avoiding
Sloth Inbox 使用 all-MiniLM-L6-v2 嵌入模型,在瀏覽器內將散亂筆記分類到自訂分類架,並可預覽及匯出 Markdown。模型量化權重約 23 MB;測試的 12 則合成筆記中,8 則自動分類,4 則因相似度分數較低而留待檢視。筆記文字不會傳送至推理伺服器,但初次使用須下載模型。
This is a submission for the Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady.
What I Built
A brain dump is very good at collecting things. Organizing those things is where it starts asking for a second job. 🦥
I built Sloth Inbox to take one small chore off that list: putting loose notes into sensible buckets. Paste a messy list, get suggested shelves, change anything that looks wrong, and leave with a tidy Markdown file.
The default shelves are Fix, Read, Buy, and Life. A broken login, an interesting paper, coffee beans, a dentist appointment: one pile in, a more useful list out. You can replace those shelves with your own names and descriptions.
The AI runs in the browser. There is no account, API key, or server waiting to read your notes. The slightly suspicious-looking sloth is an original SVG. It contributes absolutely nothing to inference, which feels appropriate.
I started and completed this project on October 22, inside this challenge’s window.
Demo
Open Sloth Inbox · Open the app directly
- Click Try an example, then Sort my inbox.
- Wait for the first model download. The quantized weights are about 23 MB; runtime and tokenizer files are additional.
- Look through the suggested shelves. Anything uncertain stays in Needs review.
- Change a dropdown, preview the Markdown, then download or copy your list.
Actual screenshot of the deployed app. All example notes are synthetic.
I tested the deployed example with twelve notes. Its top shelf suggestion matched the intended category for all twelve, but the app assigned only eight automatically. Four remained in review because their similarity scores were low. The displayed processing time was 1.24 seconds after model loading in that run.
That difference matters. “Dentist appointment” got the intended Life suggestion at a similarity of only 0.15, so it stayed in review. I changed its dropdown to Life and checked that the Markdown preview moved it into the correct section.
This is a small functional check on deliberately straightforward examples, not an accuracy benchmark. The runtime figure excludes downloading and loading the model.
Code
The project is Apache 2.0 licensed. It is plain HTML, CSS and JavaScript, with a worker for inference. No build step is needed. To run a downloaded copy with Python 3 installed:
python3 -m http.server 8000 --bind 127.0.0.1
Open http://127.0.0.1:8000. The README includes the exact model revision, runtime, limits and dependency credits. node check.mjs runs ten checks covering input limits, shelf validation, ranking, ambiguous matches and corrected exports.
How I Built It
The core is all-MiniLM-L6-v2, an open embedding model, running with Transformers.js 3.8.1 and WebAssembly. I pinned the ONNX model revision rather than following a moving model branch.
An embedding turns a piece of text into a vector: a list of numbers representing aspects of its meaning. Each note gets one. Each shelf description gets one too. Mean pooling and normalization produce vectors with 384 numbers; comparing their dot products gives cosine similarity.
So a shelf is more than a label. This description gives the model something useful to match:
Fix: bugs, broken software, errors, debugging and repairs
The app ranks the shelves for each note. If the best score is below 0.25, or its lead over the second-best shelf is below 0.04, the note stays in review. Those are simple heuristic defaults. They are not calibrated confidence guarantees.
Common mistake: treating similarity as certainty. A score of 0.35 does not mean “35% likely to be correct.” Making that number look like a confidence percentage would give the interface more authority than the model has earned.
I kept inference in a web worker so the model does not run on the main UI thread. Inputs are bounded to sixty notes, each at most 300 characters. There is no keyword fallback silently pretending the model worked: if model loading fails, the app reports an error.
Why Does Open Innovation Matter?
For this tool, the useful part of open innovation is control over where inference happens.
The model weights can be downloaded and executed in the visitor’s browser. The runtime and application code are inspectable. I can change the matching logic, the review thresholds or the shelf descriptions without depending on a hosted inference endpoint accepting those choices.
A closed API could also sort notes. This implementation gives me a different trade-off: a model download up front, then local inference without sending the notes to a model provider or supplying an inference credential. That is a practical fit for a scratchpad full of small personal tasks.
The lazy part is modest: the tool proposes the first pass through a pile of notes. The person still checks the shelves. I have not measured human time saved, so there is no invented “hours reclaimed” counter. Sometimes a useful automation just removes twelve tiny sorting decisions from the starting line.
Fine Print
English works best. Negation, vague wording and notes covering multiple topics can confuse the model; splitting a mixed note is often more useful than trusting its highest score. Every suggestion remains editable.
The app downloads code from jsDelivr and model files from Hugging Face. Those hosts receive normal download requests, but the application does not send note text to an inference server. Inputs stay in memory and disappear on reload. A connection is needed for initial downloads and to reopen the hosted page; this is not a packaged offline application. The tokenizer caps inputs at 128 tokens, so unusual text may still be truncated within the character limit.
References and Credits
- MiniLM ONNX model card and Apache 2.0 licence
- Original sentence-transformers model
- Transformers.js pipeline documentation
- Static HTML Spaces
Screenshot and sloth illustration were made for this project. No partner prize category is claimed.
AI disclosure
AI was used to draft the article.
來源:DEV Community · dev.to
