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
File size: 745 Bytes
967b9df | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | """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
|