跳到正文
DEV Community· Samrat·· 4 小時前AI 評分41

ConfiDict:注重私隱的 AI 詞彙教練

ConfiDict: A Private AI Vocabulary Coach

AI 導讀

ConfiDict 是一款本地優先的開源詞彙訓練工具,透過 Ollama 運行 Gemma 4B,評估用戶以文字撰寫的詞義並提供簡短回饋。系統為每個詞設定 0 至 100 的信心分數,每日從信心最低的 15 個詞中加權抽選 5 張卡片練習。詞表及學習紀錄儲存在用戶瀏覽器,毋須帳戶或後端儲存,也不會把答案傳送至專有 AI API;專案以 MIT License 開源。

正文

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle.

What I Built

I built ConfiDict, a local-first vocabulary trainer that helps learners concentrate on the words they understand least.

Most flashcard applications show an answer and ask the learner to decide whether they were correct. That self-assessment is subjective: an answer may be partially correct, use a valid synonym, or miss one important part of the meaning.

ConfiDict changes that workflow. The learner sees a word and explains its definition in their own words. A local open-weight Gemma model evaluates the response, identifies whether it is strong, correct, partial, or incorrect, and gives concise feedback.

Every word has a visible confidence score between 0 and 100. Each day, ConfiDict creates a five-card session from the learner’s 15 lowest-confidence words. Weaker words have a greater chance of appearing, but weighted selection prevents every session from repeating the exact same cards.

The intended users include:

  • IELTS, TOEFL, GRE, and other exam candidates
  • Adults improving their workplace vocabulary
  • Students learning subject-specific terminology
  • Tutors who want learners to practice a curated word list

A learner is not paying for another digital deck of cards. They are paying for focused practice, objective feedback, and less time wasted reviewing words they already know.

Code

The project is open source under the MIT License:

ConfiDict

ConfiDict is a local-first vocabulary confidence trainer. Learners import the words they want to remember, define five words in their own language each day and receive semantic grading from an open-weight model that runs in the browser.

This project is being built for the Hacktoberfest Open-Source AI Challenge: Week 2 — Side Hustle.

The copy-ready DEV submission draft is in docs/dev-submission.md.

The problem

Traditional flashcards usually ask learners to reveal an answer and grade themselves. That makes progress subjective and gives learners little help when their answer is close but incomplete.

ConfiDict uses open-source AI to compare the learner's free-text definition with the reference meaning. It then adjusts a transparent confidence score and prioritizes the words that need the most attention.

MVP scope

The first version deliberately supports one learning task:

See a word and explain its definition in your own words.

The MVP includes:

  • Individual and…

Repository: github.com/MasterFloppa/ConfiDict

How I Built It

ConfiDict uses a deliberately small architecture:

  • React 19 and TypeScript for the responsive web interface
  • Vite for development and production builds
  • IndexedDB through Dexie for local persistence
  • Ollama with Gemma 4B for private semantic answer grading
  • Vitest for confidence-selection and import tests

Local-first storage

The MVP uses IndexedDB rather than a hosted SQL or document database.

The learner’s word list, definitions, confidence scores, daily sessions, and review history remain in their own browser. There are no accounts, database credentials, or backend storage costs.

The application stores only the information needed for learning:

  • Word
  • Reference definition
  • Confidence score
  • Number of attempts
  • Previous result
  • Local review history

Selecting the daily five

New words begin with a confidence score of 25.

For each daily session, ConfiDict:

  1. Sorts the library from lowest to highest confidence
  2. Creates a pool from the 15 weakest words
  3. Selects five cards using weighted randomness
  4. Gives lower-confidence cards a greater probability of selection

The confidence changes are intentionally transparent:
| Result | Confidence change |
| --- | ---: |
| Strong answer | +12 |
| Correct answer | +8 |
| Partially correct | -5 |
| Incorrect answer | -15 |

Gemma does not secretly choose review dates or directly manipulate scores. It returns a structured assessment, while deterministic application code applies the published confidence rules. The learner can also override an unfair AI assessment.

Local Gemma grading

The grading prompt sends Gemma:

  • The word
  • Its reference definition
  • The learner’s answer
  • A strict grading rubric

Gemma returns structured JSON containing the grade, a short explanation, and the important detail the learner captured or missed.

Running Gemma through Ollama keeps the inference pipeline under the learner’s control. No proprietary AI API receives the vocabulary list or answers, and there is no per-card inference bill.

Why Does Open Innovation Matter?

Open innovation is what makes ConfiDict’s side-hustle model practical.

A vocabulary product may grade thousands of short answers. With a closed API, every practice session creates a recurring inference cost. Those costs either reduce the product’s margin or force the learner into a more expensive subscription.

An open-weight model changes the economics:

  • Private: Personal vocabulary and answers can remain on the learner’s computer.
  • Affordable: Local inference removes per-answer API charges.
  • Replaceable: The model can be upgraded or exchanged without redesigning the learning system.
  • Customizable: Tutors and schools can change the rubric for a language, exam, or subject.
  • Self-hostable: Organizations can operate the complete grading pipeline themselves.

Open source also makes the product easier to trust. The confidence formula, selection algorithm, prompt, and storage model can all be inspected instead of being hidden behind a proprietary recommendation system.

Prize Categories

  • Best Use of Gemma
  • Best Use of GitHub Copilot

來源:DEV Community · dev.to