dibyaaaaax commited on
Commit
c2045d7
1 Parent(s): 08de077

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +135 -0
README.md ADDED
@@ -0,0 +1,135 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ A dataset for benchmarking keyphrase extraction and generation techniques from long document English scientific papers. For more details about the dataset please refer the original paper - []().
2
+
3
+ Data source - []()
4
+
5
+ ## Dataset Summary
6
+
7
+
8
+ ## Dataset Structure
9
+
10
+
11
+ ### Data Fields
12
+
13
+ - **id**: unique identifier of the document.
14
+ - **sections**: list of all the sections present in the document.
15
+ - **sec_text**: list of white space separated list of words present in each section.
16
+ - **sec_bio_tags**: list of BIO tags of white space separated list of words present in each section.
17
+ - **extractive_keyphrases**: List of all the present keyphrases.
18
+ - **abstractive_keyphrase**: List of all the absent keyphrases.
19
+
20
+
21
+ ### Data Splits
22
+
23
+ |Split| #datapoints |
24
+ |--|--|
25
+ | Train-Small | 20,000 |
26
+ | Train-Medium | 50,000 |
27
+ | Train-Large | 90,019 |
28
+ | Test | 3413 |
29
+ | Validation | 3339 |
30
+
31
+ ## Usage
32
+
33
+ ### Small Dataset
34
+
35
+ ```python
36
+ from datasets import load_dataset
37
+
38
+ # get small dataset
39
+ dataset = load_dataset("midas/inspec", "small")
40
+
41
+ def order_sections(sample):
42
+ sections = []
43
+ sec_text = []
44
+ sec_bio_tags = []
45
+
46
+ if "title" in sample["sections"]:
47
+ title_idx = sample["sections"].index("title")
48
+ sections.append(sample["sections"].pop(title_idx))
49
+ sec_text.append(sample["sec_text"].pop(title_idx))
50
+ sec_bio_tags.append(sample["sec_bio_tags"].pop(title_idx))
51
+
52
+ if "abstract" in sample["sections"]:
53
+ abstract_idx = sample["sections"].index("abstract")
54
+ sections.append(sample["sections"].pop(abstract_idx))
55
+ sec_text.append(sample["sec_text"].pop(abstract_idx))
56
+ sec_bio_tags.append(sample["sec_bio_tags"].pop(abstract_idx))
57
+
58
+ sections += sample["sections"]
59
+ sec_text += sample["sec_text"]
60
+ sec_bio_tags += sample["sec_bio_tags"]
61
+
62
+ return sections, sec_text, sec_bio_tags
63
+
64
+ # sample from the train split
65
+ print("Sample from train data split")
66
+ train_sample = dataset["train"][0]
67
+
68
+ sections, sec_text, sec_bio_tags = order_sections(train_sample)
69
+ print("Fields in the sample: ", [key for key in train_sample.keys()])
70
+ print("Section names: ", sections)
71
+ print("Tokenized Document: ", sec_text)
72
+ print("Document BIO Tags: ", sec_bio_tags)
73
+ print("Extractive/present Keyphrases: ", train_sample["extractive_keyphrases"])
74
+ print("Abstractive/absent Keyphrases: ", train_sample["abstractive_keyphrases"])
75
+ print("\n-----------\n")
76
+
77
+ # sample from the validation split
78
+ print("Sample from validation data split")
79
+ validation_sample = dataset["validation"][0]
80
+
81
+ sections, sec_text, sec_bio_tags = order_sections(validation_sample)
82
+ print("Fields in the sample: ", [key for key in validation_sample.keys()])
83
+ print("Section names: ", sections)
84
+ print("Tokenized Document: ", sec_text)
85
+ print("Document BIO Tags: ", sec_bio_tags)
86
+ print("Extractive/present Keyphrases: ", validation_sample["extractive_keyphrases"])
87
+ print("Abstractive/absent Keyphrases: ", validation_sample["abstractive_keyphrases"])
88
+ print("\n-----------\n")
89
+
90
+ # sample from the test split
91
+ print("Sample from test data split")
92
+ test_sample = dataset["test"][0]
93
+
94
+ sections, sec_text, sec_bio_tags = order_sections(test_sample)
95
+ print("Fields in the sample: ", [key for key in test_sample.keys()])
96
+ print("Section names: ", sections)
97
+ print("Tokenized Document: ", sec_text)
98
+ print("Document BIO Tags: ", sec_bio_tags)
99
+ print("Extractive/present Keyphrases: ", test_sample["extractive_keyphrases"])
100
+ print("Abstractive/absent Keyphrases: ", test_sample["abstractive_keyphrases"])
101
+ print("\n-----------\n")
102
+
103
+ ```
104
+
105
+ **Output**
106
+ ```bash
107
+
108
+ ```
109
+
110
+ ### Medium Dataset
111
+
112
+ ```python
113
+ from datasets import load_dataset
114
+
115
+ # get medium dataset
116
+ dataset = load_dataset("midas/inspec", "medium")
117
+ ```
118
+
119
+ ### Medium Dataset
120
+
121
+ ```python
122
+ from datasets import load_dataset
123
+
124
+ # get large dataset
125
+ dataset = load_dataset("midas/inspec", "large")
126
+ ```
127
+
128
+ ## Citation Information
129
+ Please cite the works below if you use this dataset in your work.
130
+
131
+ ```
132
+ ```
133
+
134
+ ## Contributions
135
+ Thanks to [@debanjanbhucs](https://github.com/debanjanbhucs), [@dibyaaaaax](https://github.com/dibyaaaaax), [@UmaGunturi](https://github.com/UmaGunturi) and [@ad6398](https://github.com/ad6398) for adding this dataset