File size: 2,876 Bytes
b20270a
 
 
 
 
 
 
 
 
bdd2bf5
169bc0e
26db169
169bc0e
26db169
169bc0e
 
 
 
 
26db169
169bc0e
26db169
 
 
 
169bc0e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26db169
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
169bc0e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
---
language:
- en
base_model:
- answerdotai/ModernBERT-base
tags:
- modernbert
- summarization
- regression
- qna
---
# Model Card for ModernBERT-base-cos

ModernBERT-base-cos is a ModernBERT-based sequence classification model specifically fine-tuned to assess the quality of summaries in a QnA context. This model is designed to evaluate how well a generated summary captures essential information needed for question-answering tasks as part of research on the "chain of summaries" approach.

## Model Details

### Model Description

This model evaluates the quality and completeness of summaries by providing a quality score. It helps determine whether a summary adequately captures the information needed for downstream QnA tasks, making it useful for:

- Researchers working on summarization evaluation
- QnA pipeline optimization
- Educational applications requiring assessment of student-generated summaries
- Content creation platforms where summary quality is important

- **Developed by:** [More Information Needed]
- **Funded by [optional]:** [More Information Needed]
- **Shared by [optional]:** [More Information Needed]
- **Model type:** [More Information Needed]
- **Language(s) (NLP):** [More Information Needed]
- **License:** [More Information Needed]
- **Finetuned from model [optional]:** [More Information Needed]

### Model Sources [optional]

- **Repository:** [More Information Needed]
- **Paper [optional]:** [More Information Needed]
- **Demo [optional]:** [More Information Needed]



## How to Get Started with the Model

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

# Load model and tokenizer
model_id = "williambrach/ModernBERT-base-cos"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForSequenceClassification.from_pretrained(model_id).to("cuda")

def summary_score(
    tokenizer,
    summaries: list[str],
    device: str = "cuda",
    return_tensor: bool = True,
):
    inputs = tokenizer(
        summaries, return_tensors="pt", padding=True, truncation=True
    ).to(device)
    with torch.no_grad():
        outputs = model(**inputs)
        logits = torch.sigmoid(outputs["logits"])
        if return_tensor:
            logits = logits
        else:
            logits = logits.cpu().numpy().tolist()
    return logits

# Example
texts = [
    "test",
    "Michael Jackson was a famous singer and dancer.",
    "Michael Jackson was a famous singer.",
    "Michael Jackson was a famous dancer.",
]
scores = summary_score(tokenizer, texts, return_tensor=False)
print(scores)
```


#### Hardware

[More Information Needed]

#### Software

[More Information Needed]

## Citation [optional]

<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->

**BibTeX:**

[More Information Needed]