Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,40 @@
|
|
1 |
-
---
|
2 |
-
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language: en
|
3 |
+
tags:
|
4 |
+
- text-classification
|
5 |
+
- pytorch
|
6 |
+
- roberta
|
7 |
+
- self-beliefs
|
8 |
+
- multi-class-classification
|
9 |
+
- multi-label-classification
|
10 |
+
license: mit
|
11 |
+
widget:
|
12 |
+
- text: I am the coolest person I know.
|
13 |
+
---
|
14 |
+
|
15 |
+
#### Overview
|
16 |
+
|
17 |
+
Model trained from [roberta-large](https://huggingface.co/roberta-large) on a dataset of human and LLM annotated self-beliefs for multi-label classification.
|
18 |
+
|
19 |
+
### Training Details
|
20 |
+
|
21 |
+
Model training , hyper-parameters, and evaluation can be found in "Capturing Self-Beliefs in Natural Language" by Mangalik et al. 2024
|
22 |
+
|
23 |
+
### Inference
|
24 |
+
|
25 |
+
A sample way to use this model for classification
|
26 |
+
|
27 |
+
```python
|
28 |
+
from transformers import pipeline
|
29 |
+
huggingface_model = 'sidmangalik/selfBERTa'
|
30 |
+
model = RobertaForSequenceClassification.from_pretrained(huggingface_model)
|
31 |
+
tokenizer = RobertaTokenizerFast.from_pretrained(huggingface_model, max_length = 512, padding="max_length", truncation=True)
|
32 |
+
|
33 |
+
texts = ["I am the coolest person I know."]
|
34 |
+
|
35 |
+
inputs = tokenizer(texts, max_length=512, padding="max_length", truncation=True, return_tensors='pt')
|
36 |
+
outputs = model(**inputs)
|
37 |
+
logits = outputs.logits
|
38 |
+
soft_logits = torch.softmax(logits, dim=1).tolist()
|
39 |
+
predicted_classes = np.argmax(soft_logits, axis=1)
|
40 |
+
```
|