{"id":31698804,"url":"https://github.com/se0831/yakkihou-checker","last_synced_at":"2026-04-18T01:31:41.793Z","repository":{"id":318463737,"uuid":"1071388879","full_name":"SE0831/yakkihou-checker","owner":"SE0831","description":"薬機法・景品表示法に抵触する可能性のある広告表現を自動検出するシステム","archived":false,"fork":false,"pushed_at":"2025-10-07T10:09:49.000Z","size":2265,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-07T11:40:37.623Z","etag":null,"topics":["advertising","compliance","fastapi","healthcare","japanese","legal-tech","marketing","nlp","python","streamlit"],"latest_commit_sha":null,"homepage":"http://localhost:8501/","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/SE0831.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":"2025-10-07T09:30:44.000Z","updated_at":"2025-10-07T10:09:52.000Z","dependencies_parsed_at":"2025-10-07T11:40:41.212Z","dependency_job_id":"97a13188-bfcc-4994-9b4a-80cb85492458","html_url":"https://github.com/SE0831/yakkihou-checker","commit_stats":null,"previous_names":["se0831/yakkihou-checker"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/SE0831/yakkihou-checker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SE0831%2Fyakkihou-checker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SE0831%2Fyakkihou-checker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SE0831%2Fyakkihou-checker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SE0831%2Fyakkihou-checker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SE0831","download_url":"https://codeload.github.com/SE0831/yakkihou-checker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SE0831%2Fyakkihou-checker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000701,"owners_count":26082805,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"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":["advertising","compliance","fastapi","healthcare","japanese","legal-tech","marketing","nlp","python","streamlit"],"created_at":"2025-10-08T19:10:56.138Z","updated_at":"2025-10-08T19:11:11.261Z","avatar_url":"https://github.com/SE0831.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 薬機・景表チェッカー (Yakkihou Checker)\n\n![Python](https://img.shields.io/badge/Python-3.11+-blue.svg)\n![FastAPI](https://img.shields.io/badge/FastAPI-0.115+-green.svg)\n![Streamlit](https://img.shields.io/badge/Streamlit-1.39+-red.svg)\n![License](https://img.shields.io/badge/License-MIT-yellow.svg)\n\n広告文を解析し、**薬機法/景品表示法**の観点で要注意表現を検出するツールです。  \nFastAPI で API、Streamlit で **日本語UI** を提供します。\n\n---\n\n## 主な機能\n\n- YAMLルールに基づく NG 表現検出  \n  （例：絶対表現 / 医薬品的効能の断定 / 過度な期間短縮 / 根拠不明 など）\n- スコア算出・検出一覧（表 / カード）・**テキストハイライト**\n- 結果を **CSV ダウンロード**（BOM付き UTF-8）\n- Swagger UI (`/docs`) で API 試験可能\n\n---\n\n## 📸 デモ画面\n\n### Streamlit UI\n![Streamlit UI - 入力画面](docs/images/demo-ui.png)\n*広告文を入力して解析を実行*\n\n### 解析結果\n![解析結果画面](docs/images/result.png)\n*NG表現の検出結果とリスクスコア*\n\n### API ドキュメント（Swagger UI）\n![Swagger UI](docs/images/api-docs.png)\n*FastAPI による自動生成されたAPI仕様書*\n\n---\n\n## 技術スタック\n\n- Python 3.11+\n- FastAPI / Uvicorn\n- Streamlit\n- Ruff / mypy / pytest\n\n---\n\n## セットアップ\n\n### 前提条件\n\n- Python 3.11以上がインストールされていること\n- Gitがインストールされていること\n\n### インストール手順\n\n```bash\n# 1. リポジトリをクローン\ngit clone https://github.com/SE0831/yakkihou-checker.git\ncd yakkihou-checker\n\n# 2. 仮想環境を作成\npython3 -m venv .venv\nsource .venv/bin/activate  # Windowsの場合: .venv\\Scripts\\activate\n\n# 3. 依存パッケージをインストール\npip install -r requirements.txt\n```\n\n---\n\n## 起動方法\n\nこのプロジェクトは2つのコンポーネントで構成されています。\n\n### 1️⃣ FastAPI（バックエンドAPI）\n\n**ターミナル1** で以下を実行：\n\n```bash\nsource .venv/bin/activate  # 仮想環境を有効化（Windowsの場合: .venv\\Scripts\\activate）\nuvicorn app.main:app --reload\n```\n\n起動後、以下のURLにアクセスできます：\n- **API ドキュメント（Swagger UI）**: http://127.0.0.1:8000/docs\n- **API エンドポイント**: http://127.0.0.1:8000/api/analyze\n\n### 2️⃣ Streamlit（フロントエンドUI）\n\n**ターミナル2**（別のターミナルウィンドウ）で以下を実行：\n\n```bash\nsource .venv/bin/activate  # 仮想環境を有効化（Windowsの場合: .venv\\Scripts\\activate）\nstreamlit run ui/app.py\n```\n\n起動後、以下のURLにアクセスできます：\n- **Web UI**: http://localhost:8501\n\n---\n\n## 使い方\n\n### Web UI での利用\n\n1. ブラウザで http://localhost:8501 を開く\n2. テキストエリアに広告文を入力\n3. 「解析実行」ボタンをクリック\n4. 検出されたNG表現と改善提案を確認\n\n### API での利用\n\n```bash\ncurl -X POST \"http://127.0.0.1:8000/api/analyze\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"text\": \"必ず痩せます！医師推薦の最高品質です。\"\n  }'\n```\n\n**レスポンス例**:\n```json\n{\n  \"text\": \"必ず痩せます！医師推薦の最高品質です。\",\n  \"risk_score\": 25,\n  \"risk_level\": \"high\",\n  \"total_violations\": 3,\n  \"violations\": [\n    {\n      \"rule_id\": \"ABS_001\",\n      \"label\": \"絶対表現\",\n      \"law\": \"keihyo\",\n      \"severity\": \"high\",\n      \"matched_text\": \"必ず\",\n      \"suggest\": \"「〜を目指します」など確実性を避けた表現に変更してください。\"\n    }\n  ]\n}\n```\n\n---\n\n## プロジェクト構成\n\n```\nyakkihou-checker/\n├── app/\n│   ├── main.py              # FastAPI エントリーポイント\n│   ├── nlp/\n│   │   ├── checker.py       # チェックロジック\n│   │   └── rules/\n│   │       └── ng_rules.yml # NGルール定義\n│   └── ...\n├── ui/\n│   └── app.py               # Streamlit UI\n├── tests/\n│   └── test_checker.py      # テストコード\n├── requirements.txt\n├── LICENSE\n└── README.md\n```\n\n---\n\n## テスト\n\n```bash\n# テスト実行\npytest\n\n# カバレッジ付き実行\npytest --cov=app --cov-report=html\n```\n\n---\n\n## ライセンス\n\nMIT License - 詳細は [LICENSE](LICENSE) をご覧ください。\n\n---\n\n## 作成者\n\n**SE0831**\n- GitHub: [@SE0831](https://github.com/SE0831)\n\n---\n\n## 注意事項\n\n⚠️ このツールは一次チェック用です。最終的な法的判断は必ず専門家にご相談ください。","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fse0831%2Fyakkihou-checker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fse0831%2Fyakkihou-checker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fse0831%2Fyakkihou-checker/lists"}