Metadata-Version: 2.4
Name: social-jev
Version: 0.1.0a2
Summary: Jev-like classification foundation models for the social sciences
License-Expression: MIT
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: torch>=2.13
Requires-Dist: transformers<6,>=5.17
Requires-Dist: pydantic>=2
Provides-Extra: vllm
Requires-Dist: vllm==0.31.0; extra == "vllm"
Requires-Dist: httpx; extra == "vllm"
Dynamic: license-file

# SocialJev

SocialJev is a Jev-like classification foundation model for the social sciences,
inspired by TypeSafe Jev. It is trained to combine the flexibility of modern
language models pretrained on trillions of tokens of text with the speed of
traditional lightweight NLP methods. Define your task through a simple typed
interface and SocialJev returns typed outputs.

**Note**
SocialJev is under active development. The API and model interfaces may change,
including breaking changes between releases.

## Getting started

```bash
uv pip install social-jev
```

Load a model from Hugging Face and classify a batch of documents:

```python
from social_jev import Query, Request, SocialJev

model = SocialJev.from_pretrained("social-jev/social-jev-0.6B-v1")

query = Query(
    text="Which policy area does this document concern?",
    options=["Transport", "Education", "Healthcare"],
)

results = model.query(
    [
        Request(state="The council expanded the bus network.", queries=[query]),
        Request(state="The government recruited more teachers.", queries=[query]),
    ],
    batch_size=16,
)

print(results[0][0].model_dump())
```

Example result:

```python
{
    "choice": "Transport",
    "probabilities": {
        "Transport": 0.91,
        "Education": 0.03,
        "Healthcare": 0.06,
    },
}
```

Results follow document order, with one result per query. The probabilities above
are illustrative.
