linxy commited on
Commit
f7cb2a1
1 Parent(s): b914bf6

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +21 -21
README.md CHANGED
@@ -5,7 +5,7 @@ task_categories:
5
  language:
6
  - en
7
  size_categories:
8
- - 10M<n<100M
9
  ---
10
 
11
  TL;DR: The datasets for the temporal knowledge graph reasoning task.
@@ -25,21 +25,21 @@ See also: [[ICEWS14]](https://huggingface.co/datasets/linxy/ICEWS14) [[GDELT]](h
25
  ```python
26
  >>> dataset = load_dataset("linxy/ICEWS05_15", "all")
27
  >>> len(dataset["train"]) + len(dataset["validation"]) + len(dataset["test"])
28
- 1088769
29
  >>> dataset["train"][0]
30
- {'query_name': 'Pe_aPt',
31
- 'definition': 'def Pe_aPt(e1, r1, e2, r2, e3): return Pe(e1, r1, after(Pt(e2, r2, e3)))',
32
- 'query': [6291, 372, 5683, 283, 5264],
33
- 'answer': [1077],
34
- 'easy_answer': [],
35
- 'args': ['e1', 'r1', 'e2', 'r2', 'e3']}
36
- >>> dataset["test"][0]
37
  {'query_name': 'Pe',
38
  'definition': 'def Pe(e1, r1, t1): return Pe(e1, r1, t1)',
39
- 'query': [1426, 115, 28],
40
- 'answer': [3697],
41
  'easy_answer': [],
42
  'args': ['e1', 'r1', 't1']}
 
 
 
 
 
 
 
43
  ```
44
 
45
  'args' is the argument list of the query function, where name starting with 'e' is entity, and 'r' for relation, 't' for timestamp.
@@ -53,14 +53,14 @@ Therefore, we use the code below to load meta info which contains the vocabulary
53
  >>> dataset = load_dataset("linxy/ICEWS05_15", "meta")
54
  >>> meta_info = dataset_meta["train"][0]
55
  >>> meta_info
56
- {'dataset': 'ICEWS14',
57
- 'entity_count': 7128,
58
- 'relation_count': 230,
59
- 'timestamp_count': 365,
60
- 'valid_triples_count': 8941,
61
- 'test_triples_count': 8963,
62
- 'train_triples_count': 72826,
63
- 'triple_count': 90730,
64
  'query_meta': {'query_name': [...], 'queries_count': [...], 'avg_answers_count': [...], ...},
65
  'entity2idx': {'name': [...], 'id': [...]},
66
  'relation2idx': {'name': [...], 'id': [...]},
@@ -71,7 +71,7 @@ Since the ids in the vocabulary are already sorted, we directly decode to access
71
 
72
  ```python
73
  >>> query
74
- [1426, 115, 28]
75
  >>> args
76
  ['e1', 'r1', 't1']
77
  >>> for idx, arg_type in zip(query, args):
@@ -87,7 +87,7 @@ Besides, we also provide query-type-specific subparts.
87
 
88
  ```python
89
  >>> dataset = load_dataset("linxy/ICEWS05_15", "e2i")
90
- >>> some_datasets = [load_dataset("linxy/ICEWS14", query_name) for query_name in meta_info['query_meta']['query_name']]
91
  ```
92
 
93
  Help yourself!
 
5
  language:
6
  - en
7
  size_categories:
8
+ - 100M<n<1B
9
  ---
10
 
11
  TL;DR: The datasets for the temporal knowledge graph reasoning task.
 
25
  ```python
26
  >>> dataset = load_dataset("linxy/ICEWS05_15", "all")
27
  >>> len(dataset["train"]) + len(dataset["validation"]) + len(dataset["test"])
28
+ 4651939
29
  >>> dataset["train"][0]
 
 
 
 
 
 
 
30
  {'query_name': 'Pe',
31
  'definition': 'def Pe(e1, r1, t1): return Pe(e1, r1, t1)',
32
+ 'query': [3751, 125, 1330],
33
+ 'answer': [10136],
34
  'easy_answer': [],
35
  'args': ['e1', 'r1', 't1']}
36
+ >>> dataset["test"][0]
37
+ {'query_name': 'Pe2',
38
+ 'definition': 'def Pe2(e1, r1, t1, r2, t2): return Pe(Pe(e1, r1, t1), r2, t2)',
39
+ 'query': [7262, 425, 3943, 144, 2619],
40
+ 'answer': [2473, 5870],
41
+ 'easy_answer': [5870],
42
+ 'args': ['e1', 'r1', 't1', 'r2', 't2']}
43
  ```
44
 
45
  'args' is the argument list of the query function, where name starting with 'e' is entity, and 'r' for relation, 't' for timestamp.
 
53
  >>> dataset = load_dataset("linxy/ICEWS05_15", "meta")
54
  >>> meta_info = dataset_meta["train"][0]
55
  >>> meta_info
56
+ {'dataset': 'ICEWS05_15',
57
+ 'entity_count': 10488,
58
+ 'relation_count': 251,
59
+ 'timestamp_count': 4017,
60
+ 'valid_triples_count': 46275,
61
+ 'test_triples_count': 46092,
62
+ 'train_triples_count': 368962,
63
+ 'triple_count': 461329,
64
  'query_meta': {'query_name': [...], 'queries_count': [...], 'avg_answers_count': [...], ...},
65
  'entity2idx': {'name': [...], 'id': [...]},
66
  'relation2idx': {'name': [...], 'id': [...]},
 
71
 
72
  ```python
73
  >>> query
74
+ [3751, 125, 1330]
75
  >>> args
76
  ['e1', 'r1', 't1']
77
  >>> for idx, arg_type in zip(query, args):
 
87
 
88
  ```python
89
  >>> dataset = load_dataset("linxy/ICEWS05_15", "e2i")
90
+ >>> some_datasets = [load_dataset("linxy/ICEWS05_15", query_name) for query_name in meta_info['query_meta']['query_name']]
91
  ```
92
 
93
  Help yourself!