YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

B2 -- Moment Type Classification Model

Local VS Code version (not Colab) -- plain Python scripts, pushes to Hugging Face directly from your machine.

Setup

python3 -m venv venv
source venv/bin/activate          # Windows: venv\Scripts\activate
pip install -r requirements.txt
huggingface-cli login             # paste a write token when prompted

Run

export MYVILLAGE_API_KEY=your_moments_read_key    # NOT the one from the MCP debugging saga -- a fresh key with moments:read scope
python pull_moments.py            # produces b2_moments.jsonl, prints real momentType values found
python train.py                   # trains, evaluates, asks before publishing

Before running train.py for real, open train.py and change HF_REPO to your actual Hugging Face username/repo.

Why this looks different from A2

  • Label set is discovered from data, not hardcoded. The roadmap and API docs both describe momentType as open-ended ("such as ... and others"), unlike A2's fixed 7-class list. train.py reads whatever labels actually appear in b2_moments.jsonl and builds the classifier around those.
  • No realistic-sounding synthetic fallback data. Moments cover personal and emotional content (wellness checks, support, mentorship) -- fabricating "realistic" examples for that risks looking like real personal disclosures that never happened. The fallback in train.py is deliberately generic placeholder text, only there to prove the pipeline runs, never to be mistaken for a real training result.
  • Uses the plain REST API, not the MCP server. pull_moments.py hits portal.myvillageproject.ai with a normal API key as a Bearer token -- a different, so far untested-but-promising path compared to the mcp.myvillageproject.ai auth issues hit on A2.

Known uncertainties (untested from outside this environment)

  • Response shape from GET /api/network/moments isn't fully confirmed -- pull_moments.py prints the raw first-page response so you can check/fix the extraction logic if it doesn't match.
  • Field name for the moment's main text -- the playbook calls it originalText, the API reference's POST example calls it description. The script tries both.
  • Once you know the real momentType values from pull_moments.py's output, go back into train.py's edge_cases list and replace the two generic placeholders with real ambiguous cases (e.g. two semantically similar types that might get confused) -- the current list is intentionally minimal since we don't know the real label set yet.

Privacy reminder (per the playbook)

Before pushing anything to Hugging Face -- model or dataset -- manually check that no villager names, contact info, or other unnecessary identifiers ended up in the text field. This can't be fully automated; it needs a human read-through of a sample.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support