Update README.md
Browse files
README.md
CHANGED
|
@@ -65,6 +65,30 @@ Therefore, we use the code below to load meta info which contains the vocabulary
|
|
| 65 |
'timestamp2idx': {'name': [...], 'id': [...]},
|
| 66 |
```
|
| 67 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
|
| 69 |
<details>
|
| 70 |
<summary>π π Dataset statistics: queries_count</summary>
|
|
|
|
| 65 |
'timestamp2idx': {'name': [...], 'id': [...]},
|
| 66 |
```
|
| 67 |
|
| 68 |
+
Since the ids in the vocabulary are already sorted, we directly decode to access the name text:
|
| 69 |
+
|
| 70 |
+
```python
|
| 71 |
+
>>> query
|
| 72 |
+
[1426, 115, 28]
|
| 73 |
+
>>> args
|
| 74 |
+
['e1', 'r1', 't1']
|
| 75 |
+
>>> for idx, arg_type in zip(query, args):
|
| 76 |
+
if arg_type.startswith('e') or arg_type.startswith('s') or arg_type.startswith('o'): # s, o, e1, e2, ...
|
| 77 |
+
print(idx, meta_info['entity2idx']['name'][idx])
|
| 78 |
+
elif arg_type.startswith('r'): # r, r1, r2, ...
|
| 79 |
+
print(idx, meta_info['relation2idx']['name'][idx])
|
| 80 |
+
elif arg_type.startswith('t'): # t, t1, t2, ...
|
| 81 |
+
print(idx, meta_info['timestamp2idx']['name'][idx])
|
| 82 |
+
```
|
| 83 |
+
|
| 84 |
+
Besides, we also provide query-type-specific subparts.
|
| 85 |
+
|
| 86 |
+
```python
|
| 87 |
+
>>> dataset = load_dataset("linxy/ICEWS14", "e2i")
|
| 88 |
+
>>> some_datasets = [load_dataset("linxy/ICEWS14", query_name) for query_name in meta_info['query_meta']['query_name']]
|
| 89 |
+
```
|
| 90 |
+
|
| 91 |
+
Help yourself!
|
| 92 |
|
| 93 |
<details>
|
| 94 |
<summary>π π Dataset statistics: queries_count</summary>
|