File size: 1,765 Bytes
a1447a7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
---
license: mit
language:
- en
tags:
- roberta
- text-classification
- ensemble
- clarity
- qevasion
pipeline_tag: text-classification
---

# RoBERTa Clarity Ensemble

This repository contains **3 RoBERTa-large models** fine-tuned for clarity classification (Clear Reply / Clear Non-Reply / Ambivalent).

## Models

| Model | Description |
|-------|-------------|
| `model-1/` | RoBERTa-large fine-tuned on clarity task |
| `model-2/` | RoBERTa-large fine-tuned on clarity task (different seed/split) |
| `model-3/` | RoBERTa-large fine-tuned on clarity task (different seed/split) |

## Usage

```python
from transformers import AutoModelForSequenceClassification, AutoTokenizer
import torch

# Load one model
model = AutoModelForSequenceClassification.from_pretrained("gigibot/ensemble-qeval", subfolder="model-1")
tokenizer = AutoTokenizer.from_pretrained("gigibot/ensemble-qeval", subfolder="model-1")

# Or load all 3 for ensemble voting
models = []
for i in [1, 2, 3]:
    m = AutoModelForSequenceClassification.from_pretrained(
        "gigibot/ensemble-qeval",
        subfolder=f"model-{{i}}"
    )
    models.append(m)

# Ensemble inference
def ensemble_predict(text, models, tokenizer):
    inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=256)
    logits_sum = None
    for model in models:
        model.eval()
        with torch.no_grad():
            out = model(**inputs)
            if logits_sum is None:
                logits_sum = out.logits
            else:
                logits_sum += out.logits
    return torch.argmax(logits_sum, dim=-1).item()
```

## Labels

- 0: Clear Reply
- 1: Clear Non-Reply  
- 2: Ambivalent

## Training

Each model was fine-tuned from `roberta-large` on the QEvasion clarity dataset.