Instructions to use FlowRank/mailSort with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use FlowRank/mailSort with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="FlowRank/mailSort")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("FlowRank/mailSort", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download src/mailsort/dataset.py from FlowRank/mailSort: direct link, hf CLI and curl.
- Browser
- Download file 669 Bytes
-
https://huggingface.co/FlowRank/mailSort/resolve/main/src/mailsort/dataset.py
- Command line
-
hf download hf://FlowRank/mailSort/src/mailsort/dataset.py
-
curl -L -o dataset.py https://huggingface.co/FlowRank/mailSort/resolve/main/src/mailsort/dataset.py
669 Bytes
| from __future__ import annotations | |
| from datasets import DatasetDict, load_dataset | |
| DEFAULT_DATASET_ID = "FlowRank/labeled_emails" | |
| DEFAULT_DATASET_REVISION = "main" | |
| def load_labeled_emails( | |
| dataset_id: str = DEFAULT_DATASET_ID, | |
| revision: str | None = None, | |
| *, | |
| seed: int = 42, | |
| ) -> DatasetDict: | |
| """Charge le dataset labeled_emails (révision `main` = dernière version publiée).""" | |
| ds = load_dataset(dataset_id, revision=revision or DEFAULT_DATASET_REVISION) | |
| if "train" in ds and "test" in ds: | |
| return ds | |
| if "train" in ds and "test" not in ds: | |
| return ds["train"].train_test_split(test_size=0.1, seed=seed) | |
| return ds | |