dibyaaaaax commited on
Commit
15f4b64
1 Parent(s): cbfa0aa

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +136 -0
README.md ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ## Dataset Summary
2
+
3
+ A dataset for benchmarking keyphrase extraction and generation techniques from english scientific papers. For more details about the dataset please refer the original paper - [https://dl.acm.org/doi/abs/10.1145/313238.313437](https://dl.acm.org/doi/abs/10.1145/313238.313437)
4
+
5
+ Original source of the data - []()
6
+
7
+
8
+ ## Dataset Structure
9
+
10
+
11
+ ### Data Fields
12
+
13
+ - **id**: unique identifier of the document.
14
+ - **document**: Whitespace separated list of words in the document.
15
+ - **doc_bio_tags**: BIO tags for each word in the document. B stands for the beginning of a keyphrase and I stands for inside the keyphrase. O stands for outside the keyphrase and represents the word that isn't a part of the keyphrase at all.
16
+ - **extractive_keyphrases**: List of all the present keyphrases.
17
+ - **abstractive_keyphrase**: List of all the absent keyphrases.
18
+
19
+
20
+ ### Data Splits
21
+
22
+ |Split| #datapoints |
23
+ |--|--|
24
+ | Train | 130 |
25
+ | Test | 500 |
26
+
27
+
28
+ ## Usage
29
+
30
+ ### Full Dataset
31
+
32
+ ```python
33
+ from datasets import load_dataset
34
+
35
+ # get entire dataset
36
+ dataset = load_dataset("midas/cstr", "raw")
37
+
38
+ # sample from the train split
39
+ print("Sample from train dataset split")
40
+ test_sample = dataset["train"][0]
41
+ print("Fields in the sample: ", [key for key in test_sample.keys()])
42
+ print("Tokenized Document: ", test_sample["document"])
43
+ print("Document BIO Tags: ", test_sample["doc_bio_tags"])
44
+ print("Extractive/present Keyphrases: ", test_sample["extractive_keyphrases"])
45
+ print("Abstractive/absent Keyphrases: ", test_sample["abstractive_keyphrases"])
46
+ print("\n-----------\n")
47
+
48
+ # sample from the test split
49
+ print("Sample from test dataset split")
50
+ test_sample = dataset["test"][0]
51
+ print("Fields in the sample: ", [key for key in test_sample.keys()])
52
+ print("Tokenized Document: ", test_sample["document"])
53
+ print("Document BIO Tags: ", test_sample["doc_bio_tags"])
54
+ print("Extractive/present Keyphrases: ", test_sample["extractive_keyphrases"])
55
+ print("Abstractive/absent Keyphrases: ", test_sample["abstractive_keyphrases"])
56
+ print("\n-----------\n")
57
+ ```
58
+ **Output**
59
+
60
+ ```bash
61
+
62
+ ```
63
+
64
+ ### Keyphrase Extraction
65
+ ```python
66
+ from datasets import load_dataset
67
+
68
+ # get the dataset only for keyphrase extraction
69
+ dataset = load_dataset("midas/cstr", "extraction")
70
+
71
+ print("Samples for Keyphrase Extraction")
72
+
73
+ # sample from the train split
74
+ print("Sample from train data split")
75
+ test_sample = dataset["train"][0]
76
+ print("Fields in the sample: ", [key for key in test_sample.keys()])
77
+ print("Tokenized Document: ", test_sample["document"])
78
+ print("Document BIO Tags: ", test_sample["doc_bio_tags"])
79
+ print("\n-----------\n")
80
+
81
+ # sample from the test split
82
+ print("Sample from test data split")
83
+ test_sample = dataset["test"][0]
84
+ print("Fields in the sample: ", [key for key in test_sample.keys()])
85
+ print("Tokenized Document: ", test_sample["document"])
86
+ print("Document BIO Tags: ", test_sample["doc_bio_tags"])
87
+ print("\n-----------\n")
88
+ ```
89
+
90
+ ### Keyphrase Generation
91
+ ```python
92
+ # get the dataset only for keyphrase generation
93
+ dataset = load_dataset("midas/cstr", "generation")
94
+
95
+ print("Samples for Keyphrase Generation")
96
+
97
+ # sample from the train split
98
+ print("Sample from train data split")
99
+ test_sample = dataset["train"][0]
100
+ print("Fields in the sample: ", [key for key in test_sample.keys()])
101
+ print("Tokenized Document: ", test_sample["document"])
102
+ print("Extractive/present Keyphrases: ", test_sample["extractive_keyphrases"])
103
+ print("Abstractive/absent Keyphrases: ", test_sample["abstractive_keyphrases"])
104
+ print("\n-----------\n")
105
+
106
+ # sample from the test split
107
+ print("Sample from test data split")
108
+ test_sample = dataset["test"][0]
109
+ print("Fields in the sample: ", [key for key in test_sample.keys()])
110
+ print("Tokenized Document: ", test_sample["document"])
111
+ print("Extractive/present Keyphrases: ", test_sample["extractive_keyphrases"])
112
+ print("Abstractive/absent Keyphrases: ", test_sample["abstractive_keyphrases"])
113
+ print("\n-----------\n")
114
+ ```
115
+
116
+ ## Citation Information
117
+ ```
118
+ @inproceedings{10.1145/313238.313437,
119
+ author = {Witten, Ian H. and Paynter, Gordon W. and Frank, Eibe and Gutwin, Carl and Nevill-Manning, Craig G.},
120
+ title = {KEA: Practical Automatic Keyphrase Extraction},
121
+ year = {1999},
122
+ isbn = {1581131453},
123
+ publisher = {Association for Computing Machinery},
124
+ address = {New York, NY, USA},
125
+ url = {https://doi.org/10.1145/313238.313437},
126
+ doi = {10.1145/313238.313437},
127
+ booktitle = {Proceedings of the Fourth ACM Conference on Digital Libraries},
128
+ pages = {254–255},
129
+ numpages = {2},
130
+ location = {Berkeley, California, USA},
131
+ series = {DL '99}
132
+ }
133
+ ```
134
+
135
+ ## Contributions
136
+ Thanks to [@debanjanbhucs](https://github.com/debanjanbhucs), [@dibyaaaaax](https://github.com/dibyaaaaax) and [@ad6398](https://github.com/ad6398) for adding this dataset