Instructions to use ssg1/doc-compass with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ssg1/doc-compass with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="ssg1/doc-compass")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("ssg1/doc-compass", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download doccompass/splits.py from ssg1/doc-compass: direct link, hf CLI and curl.
- Browser
- Download file 745 Bytes
-
https://huggingface.co/ssg1/doc-compass/resolve/main/doccompass/splits.py
- Command line
-
hf download hf://ssg1/doc-compass/doccompass/splits.py
-
curl -L -o splits.py https://huggingface.co/ssg1/doc-compass/resolve/main/doccompass/splits.py
745 Bytes
| """Fixed splits, so every router is trained and scored on the same rows.""" | |
| import pandas as pd | |
| from sklearn.model_selection import train_test_split | |
| from .paths import PATIENT_COMMENTS | |
| SEED = 24679 | |
| def public_split() -> tuple[pd.DataFrame, pd.DataFrame, pd.DataFrame]: | |
| """Patient Comments as (train, val, held_out): about 76.5% / 8.5% / 15%, stratified by label. | |
| val picks the best epoch when fine-tuning; held_out is only ever scored. | |
| """ | |
| comments = pd.read_csv(PATIENT_COMMENTS) | |
| rest, held_out = train_test_split(comments, test_size=0.15, stratify=comments["label"], random_state=SEED) | |
| train, val = train_test_split(rest, test_size=0.10, stratify=rest["label"], random_state=SEED) | |
| return train, val, held_out | |