Datasets:
parquet-converter
commited on
Commit
•
0ab1a98
1
Parent(s):
fe72742
Update parquet files
Browse files- README.md +0 -64
- test.parquet → pszemraj--scientific_lay_summarisation-plos-norm/parquet-test.parquet +2 -2
- train.parquet → pszemraj--scientific_lay_summarisation-plos-norm/parquet-train-00000-of-00002.parquet +2 -2
- validation.parquet → pszemraj--scientific_lay_summarisation-plos-norm/parquet-train-00001-of-00002.parquet +2 -2
- pszemraj--scientific_lay_summarisation-plos-norm/parquet-validation.parquet +3 -0
README.md
DELETED
@@ -1,64 +0,0 @@
|
|
1 |
-
---
|
2 |
-
license: mit
|
3 |
-
task_categories:
|
4 |
-
- summarization
|
5 |
-
language:
|
6 |
-
- en
|
7 |
-
size_categories:
|
8 |
-
- 10K<n<100K
|
9 |
-
---
|
10 |
-
|
11 |
-
# scientific_lay_summarisation - PLOS - normalized
|
12 |
-
|
13 |
-
This dataset contains scientific lay summaries which have been preprocessed [with this code](https://gist.github.com/pszemraj/bd344637af7c0c10ecf4ab62c4d0ce91). The preprocessing includes fixing punctuation and whitespace issues, and calculating the token length of each text sample using a tokenizer from the T5 model.
|
14 |
-
## Data Cleaning
|
15 |
-
|
16 |
-
The text in both the "article" and "summary" columns was processed to ensure that punctuation and whitespace were consistent. The `fix_punct_whitespace` function was applied to each text sample to:
|
17 |
-
- Remove spaces before punctuation marks (except for parentheses)
|
18 |
-
- Add a space after punctuation marks (except for parentheses) if missing
|
19 |
-
- Handle spaces around parentheses
|
20 |
-
- Add a space after a closing parenthesis if followed by a word or opening parenthesis
|
21 |
-
- Handle spaces around quotation marks
|
22 |
-
- Handle spaces around single quotes
|
23 |
-
- Handle comma in numbers
|
24 |
-
## Tokenization
|
25 |
-
|
26 |
-
The length of each text sample was calculated in terms of tokens using the T5 tokenizer. The `calculate_token_length` function was used to encode each text sample using the tokenizer and return the number of resulting tokens. The resulting token lengths were added as new columns to the dataframes.
|
27 |
-
## Data Format
|
28 |
-
|
29 |
-
The resulting processed datasets are saved in separate directories as parquet files. The directories are named according to the dataset and split name, and each directory contains three parquet files for the train, test, and validation splits.
|
30 |
-
|
31 |
-
The datasets can be loaded using the `pandas` library or using the `datasets` library from the Hugging Face transformers package. The column names and data types are as follows:
|
32 |
-
- `article`: the scientific article text (string)
|
33 |
-
- `summary`: the lay summary text (string)
|
34 |
-
- `article_length`: the length of the article in terms of tokens (int)
|
35 |
-
- `summary_length`: the length of the summary in terms of tokens (int)
|
36 |
-
## Usage
|
37 |
-
|
38 |
-
To use the processed datasets, load the desired parquet file(s) using `pandas` or `datasets`. Here is an example using `pandas`:
|
39 |
-
|
40 |
-
```python
|
41 |
-
|
42 |
-
import pandas as pd
|
43 |
-
|
44 |
-
# Load a parquet file
|
45 |
-
df = pd.read_parquet("scientific_lay_summarisation-plos-norm/train.parquet")
|
46 |
-
|
47 |
-
# Print the first few rows
|
48 |
-
print(df.head())
|
49 |
-
```
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
And here is an example using `datasets`:
|
54 |
-
|
55 |
-
```python
|
56 |
-
|
57 |
-
from datasets import load_dataset
|
58 |
-
|
59 |
-
dataset = load_dataset("pszemraj/scientific_lay_summarisation-plos-norm")
|
60 |
-
|
61 |
-
# Print the first few samples
|
62 |
-
for i in range(5):
|
63 |
-
print(dataset[i])
|
64 |
-
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
test.parquet → pszemraj--scientific_lay_summarisation-plos-norm/parquet-test.parquet
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:860272b2828168c052afb8962f6a20ef290ab618c3bcaf266ea944a0008b21b7
|
3 |
+
size 27922034
|
train.parquet → pszemraj--scientific_lay_summarisation-plos-norm/parquet-train-00000-of-00002.parquet
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:22bcbedb0ac40118d31245f390fcbc2846f49984aa84a4bb3eb1ac92029e36aa
|
3 |
+
size 407678363
|
validation.parquet → pszemraj--scientific_lay_summarisation-plos-norm/parquet-train-00001-of-00002.parquet
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4d576886d2428e2a1e588ca33e3db239a76dcc080fce72fcaeb963c1e82b5087
|
3 |
+
size 97323512
|
pszemraj--scientific_lay_summarisation-plos-norm/parquet-validation.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b9924f46c92a2f918084ede2fcf7025755d8558b97b21069c83b48d660d3589c
|
3 |
+
size 28029033
|