Datasets:
Update README.md
Browse filesAdded data usage and quick baseline examples along with some minor improvements to the README.md
README.md
CHANGED
|
@@ -149,7 +149,7 @@ English
|
|
| 149 |
```
|
| 150 |
|
| 151 |
### Data Fields
|
| 152 |
-
|
| 153 |
- sentence: a tokenized line from the dataset
|
| 154 |
- label: a label corresponding to the class as a string: 'positive', 'negative' or 'neutral'
|
| 155 |
|
|
@@ -158,10 +158,37 @@ There's no train/validation/test split.
|
|
| 158 |
|
| 159 |
However the dataset is available in four possible configurations depending on the percentage of agreement of annotators:
|
| 160 |
|
| 161 |
-
`sentences_50agree`; Number of instances with >=50% annotator agreement: 4846
|
| 162 |
-
`sentences_66agree`: Number of instances with >=66% annotator agreement: 4217
|
| 163 |
-
`sentences_75agree`: Number of instances with >=75% annotator agreement: 3453
|
| 164 |
-
`sentences_allagree`: Number of instances with 100% annotator agreement: 2264
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 165 |
|
| 166 |
## Dataset Creation
|
| 167 |
|
|
|
|
| 149 |
```
|
| 150 |
|
| 151 |
### Data Fields
|
| 152 |
+
Each example contains:
|
| 153 |
- sentence: a tokenized line from the dataset
|
| 154 |
- label: a label corresponding to the class as a string: 'positive', 'negative' or 'neutral'
|
| 155 |
|
|
|
|
| 158 |
|
| 159 |
However the dataset is available in four possible configurations depending on the percentage of agreement of annotators:
|
| 160 |
|
| 161 |
+
- `sentences_50agree`; Number of instances with >=50% annotator agreement: 4846
|
| 162 |
+
- `sentences_66agree`: Number of instances with >=66% annotator agreement: 4217
|
| 163 |
+
- `sentences_75agree`: Number of instances with >=75% annotator agreement: 3453
|
| 164 |
+
- `sentences_allagree`: Number of instances with 100% annotator agreement: 2264
|
| 165 |
+
|
| 166 |
+
### Usage
|
| 167 |
+
|
| 168 |
+
```python
|
| 169 |
+
from datasets import load_dataset
|
| 170 |
+
|
| 171 |
+
# Load the highest-agreement configuration
|
| 172 |
+
ds = load_dataset("takala/financial_phrasebank", "sentences_allagree")
|
| 173 |
+
|
| 174 |
+
print(ds)
|
| 175 |
+
print(ds["train"][0])
|
| 176 |
+
```
|
| 177 |
+
|
| 178 |
+
Other configurations (e.g. `sentences_75agree`, `sentences_66agree`) can be loaded by changing the second argument.
|
| 179 |
+
|
| 180 |
+
## Quick baseline (Transformers)
|
| 181 |
+
|
| 182 |
+
```python
|
| 183 |
+
from datasets import load_dataset
|
| 184 |
+
from transformers import pipeline
|
| 185 |
+
|
| 186 |
+
ds = load_dataset("takala/financial_phrasebank", "sentences_allagree")["train"]
|
| 187 |
+
clf = pipeline("text-classification", model="distilbert-base-uncased-finetuned-sst-2-english")
|
| 188 |
+
|
| 189 |
+
print(ds[0]["sentence"])
|
| 190 |
+
print(clf(ds[0]["sentence"]))
|
| 191 |
+
```
|
| 192 |
|
| 193 |
## Dataset Creation
|
| 194 |
|