File size: 1,508 Bytes
d039373
2832074
 
 
 
 
 
d039373
2832074
 
d039373
2832074
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
---
language: en
tags:
- clip-classifier
- e5
- classification
license: mit
---
# Clip Classifier
This model is fine-tuned from [intfloat/multilingual-e5-large-instruct](https://huggingface.co/intfloat/multilingual-e5-large-instruct) for classifying text as "Clip Worthy" or "Not Clip Worthy".
## Model Details
- **Model Type:** Sequence classification fine-tuned from E5 Large Instruct
- **Task:** Binary classification (Clip worthy vs Not clip worthy)
- **Training Data:** Custom dataset
## Usage
```python
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
# Load model and tokenizer
model_name = "umarfarzan/clip-classifier-v9_50_50"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
# Example text
text = "Your text here"
# Tokenize and predict
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=512, padding="max_length")
with torch.no_grad():
    outputs = model(**inputs)
# Get prediction
probabilities = torch.nn.functional.softmax(outputs.logits, dim=1)
prediction = torch.argmax(probabilities, dim=1).item()
confidence = probabilities[0][prediction].item()
# Map prediction to label
id2label = {0: "Not Clip Worthy", 1: "Clip Worthy"}
result = id2label[prediction]
print(f"Prediction: {result}")
print(f"Confidence: {confidence:.2f}")
```
## Limitations
[Describe any limitations here]
## Citation
If you use this model, please cite:
[Your citation information]