{"id":52003318,"url":"https://github.com/stephanakkerman/stock-recognizer-model","last_synced_at":"2026-07-31T13:02:16.730Z","repository":{"id":369318142,"uuid":"1289224350","full_name":"StephanAkkerman/stock-recognizer-model","owner":"StephanAkkerman","description":null,"archived":false,"fork":false,"pushed_at":"2026-07-04T16:14:41.000Z","size":2197,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-07-04T18:06:20.782Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://huggingface.co/StephanAkkerman/stock-recognizer-model","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/StephanAkkerman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-07-04T13:28:55.000Z","updated_at":"2026-07-04T16:14:44.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/StephanAkkerman/stock-recognizer-model","commit_stats":null,"previous_names":["stephanakkerman/stock-recognizer-model"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/StephanAkkerman/stock-recognizer-model","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StephanAkkerman%2Fstock-recognizer-model","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StephanAkkerman%2Fstock-recognizer-model/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StephanAkkerman%2Fstock-recognizer-model/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StephanAkkerman%2Fstock-recognizer-model/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StephanAkkerman","download_url":"https://codeload.github.com/StephanAkkerman/stock-recognizer-model/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StephanAkkerman%2Fstock-recognizer-model/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":36118274,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-07-20T02:08:10.276Z","status":"online","status_checked_at":"2026-07-31T02:00:06.731Z","response_time":112,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-07-31T13:02:15.776Z","updated_at":"2026-07-31T13:02:16.714Z","avatar_url":"https://github.com/StephanAkkerman.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Stock Recognizer Model 🧠\n\nTraining pipeline and labeled data for the GLiNER2 adapter behind [`stock-recognizer`](https://github.com/StephanAkkerman/stock-recognizer)'s `recognize_ai()` — scraping, cleaning, labeling, augmentation, training, benchmarking, and publishing to the Hugging Face Hub.\n\n- Trained adapters are published to [`StephanAkkerman/stock-recognizer-model`](https://huggingface.co/StephanAkkerman/stock-recognizer-model) on the Hugging Face Hub, tagged per version — not committed to git.\n\n- Dataset exports are also pushed to the Hugging Face Hub to [`StephanAkkerman/wallstreetbets-ner`](https://huggingface.co/datasets/StephanAkkerman/wallstreetbets-ner).\n\n## Relationship to `stock-recognizer`\n\n- The trained adapter is used **by** the engine repo at inference time.\n- Several scripts here import `stock_recognizer` directly (its regex + market-data logic) to build/evaluate datasets. Install it as an editable sibling dependency:\n\n## Setup\n```bash\npip install -e ../stock-recognizer\npip install -r requirements.txt\n```\n\nInstall torch with CUDA separately if you want to train on GPU:\n\n```bash\npip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu130\n```\n\n## Pipeline\n\n```\nscraper.py → CSV → cleaner.py → preds/ → Label Studio (manual review) → data/labeled/\n                                                                                ↓\n                                                            augment_data.py → data/augmented/\n                                                                                ↓\n                                                                          train.py → models/\n                                                                                ↓\n                                                          push_model_to_hf.py → HF Hub\n```\n\n## Commands\n\n```bash\n# Run all tests\npytest\n\n# Benchmark all adapter versions under models/\npython src/core/benchmark.py\n\n# Fix label-policy violations in annotated data\npython src/maintenance/fix_label_policy.py          # preview changes\npython src/maintenance/fix_label_policy.py --apply  # apply fixes\n\n# Publish a trained adapter to the Hugging Face Hub\npython utils/hf/push_model_to_hf.py models/reddit_adapter_v18/final --version v18\n```\n\n## Trainer organization\n\nThe src code is organized by responsibility rather than as a single flat list of scripts. See [src/README.md](src/README.md) for the current\nlayout guide.\n\n## Utils organization\n\nThe helper scripts are grouped under [utils/README.md](utils/README.md) by task: labeling, scraping, augmentation, synthetic labeling, and Hugging Face\npublishing.\n\n## Label Guidelines 🏷️\n\nWhen annotating training data in Label Studio, use exactly two labels: `ticker` and `company`. The distinction is based on the **form of the text**, not the author's intent — this makes annotation consistent and removes judgment calls.\n\n### Decision tree\n\n**1. Cashtag (`$` prefix) → always `ticker`**\n```\n$AMC  $TSLA  $gme  $EUV  $DRAM\n```\n\n**2. ALL-CAPS, resolves to a known ticker → `ticker`**\n```\nAMC   META   NVDA   SOFI   BP\n```\n\n**3. ALL-CAPS, but the ticker symbol differs → `company`**\n```\nNVIDIA  (ticker is NVDA)\nTSMC    (ticker is TSM)\nAPPLE   (ticker is AAPL)\n```\n\n**4. Written / mixed-case name → `company`**\n```\nMeta   Nvidia   Micron   AMC Theatres   Goldman Sachs\n```\n\n**5. Informal lowercase ticker (Reddit shorthand) → `ticker`**\n```\ngme   amc   tsla   spy\n```\n\n### What not to label\n\n| Category | Examples |\n|---|---|\n| Government / regulatory bodies | `CSRC`, `SEC`, `NASA`, `FINRA`, `NDAA` |\n| Financial metric acronyms | `PDT`, `EV` (enterprise value), `SG\u0026A`, `RSUs`, `PT` (price target), `ATM`, `IV` |\n| Memory / chip technology terms | `DRAM`, `HBM`, `EUV`, `NAND` (without `$` prefix) |\n| Media outlets with no public stock | `CNBC`, `Bloomberg`, `HBO`, `MSNBC` |\n\nAfter fixing `data/labeled/`, regenerate `data/augmented/` before retraining.\n\n## License 📜\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstephanakkerman%2Fstock-recognizer-model","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstephanakkerman%2Fstock-recognizer-model","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstephanakkerman%2Fstock-recognizer-model/lists"}