Metadata-Version: 2.4
Name: founder-game-classifier
Version: 0.1.0
Summary: Classify content into 6 founder games using trained ML models
Project-URL: Homepage, https://github.com/leoguinan/founder-game-classifier
Project-URL: Documentation, https://github.com/leoguinan/founder-game-classifier#readme
Project-URL: Repository, https://github.com/leoguinan/founder-game-classifier
Project-URL: Bug Tracker, https://github.com/leoguinan/founder-game-classifier/issues
Project-URL: Model Hub, https://huggingface.co/leoguinan/founder-game-classifier
Author-email: Leo Guinan <leo@leoguinan.com>
License: MIT
License-File: LICENSE
Keywords: classification,content-analysis,founders,machine-learning,nlp,sentence-transformers
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Text Processing :: Linguistic
Requires-Python: >=3.9
Requires-Dist: huggingface-hub>=0.14.0
Requires-Dist: joblib>=1.0.0
Requires-Dist: numpy>=1.20.0
Requires-Dist: scikit-learn>=1.0.0
Requires-Dist: sentence-transformers>=2.2.0
Provides-Extra: dev
Requires-Dist: black>=23.0.0; extra == 'dev'
Requires-Dist: mypy>=1.0.0; extra == 'dev'
Requires-Dist: pytest-cov>=4.0.0; extra == 'dev'
Requires-Dist: pytest>=7.0.0; extra == 'dev'
Requires-Dist: ruff>=0.1.0; extra == 'dev'
Description-Content-Type: text/markdown

# Founder Game Classifier

Classify content into 6 founder games using trained ML models.

## Installation

```bash
pip install founder-game-classifier
```

## Quick Start

```python
from founder_game_classifier import GameClassifier

# Load the model (downloads from Hugging Face Hub on first use)
classifier = GameClassifier.from_pretrained("leoguinan/founder-game-classifier")

# Classify text
result = classifier.predict("Here's a tactic you can steal for your next launch...")

print(result["primary_game"])      # "G2"
print(result["confidence"])        # 0.72
print(result["probabilities"])     # {"G1": 0.05, "G2": 0.72, ...}
```

## The 6 Founder Games

| Game | Name | Description |
|------|------|-------------|
| **G1** | Identity/Canon | Recruiting into identity, lineage, belonging, status |
| **G2** | Ideas/Play Mining | Extracting reusable tactics, heuristics; "do this / steal this" |
| **G3** | Models/Understanding | Building mental models, frameworks, explanations |
| **G4** | Performance/Competition | Winning, execution, metrics, zero-sum edges |
| **G5** | Meaning/Therapy | Healing, values, emotional processing, transformation |
| **G6** | Network/Coordination | Community building, protocols, collective action |

## Usage

### Single Text Classification

```python
result = classifier.predict("Here's the mental model I use...")

print(result)
# {
#     "primary_game": "G3",
#     "secondary_game": "G2",
#     "confidence": 0.68,
#     "probabilities": {"G1": 0.05, "G2": 0.22, "G3": 0.68, ...},
#     "primary_description": "Model/Understanding: building mental models...",
#     "secondary_description": "Idea/Play Mining: extracting reusable..."
# }
```

### Batch Classification

```python
texts = [
    "Here's the mental model I use for thinking about systems...",
    "Join our community of builders who are changing the world...",
    "I tried 47 different tactics. Here's what actually worked...",
]

results = classifier.predict_batch(texts)

for text, result in zip(texts, results):
    print(f"{result['primary_game']}: {text[:50]}...")
# G3: Here's the mental model I use for thinking about...
# G6: Join our community of builders who are changing...
# G2: I tried 47 different tactics. Here's what actual...
```

### Aggregate Game Signature

Analyze the overall game distribution of a corpus:

```python
# Load your content
texts = [
    open(f).read() for f in Path("my_blog_posts/").glob("*.txt")
]

# Get aggregate signature
signature = classifier.get_game_signature(texts)

print(signature)
# {'G1': 0.05, 'G2': 0.42, 'G3': 0.18, 'G4': 0.20, 'G5': 0.08, 'G6': 0.07}
```

### Local Model Loading

If you have the model files locally:

```python
classifier = GameClassifier.from_local(
    model_dir="./models/founder_classifier",
    manifolds_path="./game_manifolds.json",  # Optional
)
```

## Model Details

- **Embedding Model**: `all-MiniLM-L6-v2` (384 dimensions)
- **Classifier**: Logistic Regression
- **Training Data**: Labeled founder content (podcasts, blogs, tweets)

## Requirements

- Python 3.9+
- sentence-transformers
- scikit-learn
- huggingface-hub

## License

MIT License

## Links

- [Hugging Face Model](https://huggingface.co/leoguinan/founder-game-classifier)
- [GitHub Repository](https://github.com/leoguinan/founder-game-classifier)
