Commit
·
340160f
1
Parent(s):
64c5978
Upload README.md
Browse files
README.md
ADDED
@@ -0,0 +1,129 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
## Dataset Summary
|
2 |
+
|
3 |
+
A dataset for benchmarking keyphrase extraction and generation techniques from english news articles. For more details about the dataset please refer the original paper - [https://arxiv.org/abs/1306.4886](https://arxiv.org/abs/1306.4886)
|
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 | 450 |
|
25 |
+
| Test | 50 |
|
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/kpcrowd", "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/kpcrowd", "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/kpcrowd", "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 |
+
@misc{marujo2013supervised,
|
119 |
+
title={Supervised Topical Key Phrase Extraction of News Stories using Crowdsourcing, Light Filtering and Co-reference Normalization},
|
120 |
+
author={Luis Marujo and Anatole Gershman and Jaime Carbonell and Robert Frederking and João P. Neto},
|
121 |
+
year={2013},
|
122 |
+
eprint={1306.4886},
|
123 |
+
archivePrefix={arXiv},
|
124 |
+
primaryClass={cs.CL}
|
125 |
+
}
|
126 |
+
```
|
127 |
+
|
128 |
+
## Contributions
|
129 |
+
Thanks to [@debanjanbhucs](https://github.com/debanjanbhucs), [@dibyaaaaax](https://github.com/dibyaaaaax) and [@ad6398](https://github.com/ad6398) for adding this dataset
|