Text Classification
Transformers
Safetensors
English
multimodal
image-classification
distilbert
vit
gated-fusion
digital-humanities
Instructions to use xablex/prosody_models with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use xablex/prosody_models with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="xablex/prosody_models")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("xablex/prosody_models", device_map="auto") - Notebooks
- Google Colab
- Kaggle
| # Prosody ViT Image Classifier | |
| Fine-tuned `google/vit-base-patch16-224` for binary page classification in the | |
| [Princeton Prosody Archive](https://prosody.princeton.edu/) corpus, using the | |
| scanned page **image** only. | |
| - **Classes:** `TU` (0), `non-TU` (1) | |
| - **Architecture:** `ViTForImageClassification` (HF-native) | |
| ```python | |
| from transformers import AutoModelForImageClassification, AutoImageProcessor | |
| from PIL import Image | |
| import torch | |
| model = AutoModelForImageClassification.from_pretrained("./vit-image") | |
| proc = AutoImageProcessor.from_pretrained("./vit-image") | |
| img = Image.open("page.png").convert("RGB") | |
| inp = proc(img, return_tensors="pt") | |
| with torch.no_grad(): | |
| probs = model(**inp).logits.softmax(-1)[0] | |
| print({model.config.id2label[i]: float(p) for i, p in enumerate(probs)}) | |
| ``` | |