Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# README
|
2 |
+
|
3 |
+
## Description
|
4 |
+
|
5 |
+
The second version of the PubChem324k Dataset used in the paper: [MolCA: Molecular Graph-Language Modeling with Cross-Modal Projector and Uni-Modal Adapter](https://arxiv.org/abs/2310.12798)
|
6 |
+
|
7 |
+
## Load Example
|
8 |
+
|
9 |
+
```python
|
10 |
+
import torch
|
11 |
+
from torch_geometric.data import InMemoryDataset
|
12 |
+
|
13 |
+
|
14 |
+
class PubChemDataset(InMemoryDataset):
|
15 |
+
def __init__(self, path):
|
16 |
+
super(PubChemDataset, self).__init__()
|
17 |
+
self.data, self.slices = torch.load(path)
|
18 |
+
|
19 |
+
def __getitem__(self, idx):
|
20 |
+
return self.get(idx)
|
21 |
+
|
22 |
+
if __name__ == '__main__':
|
23 |
+
dataset = PubChemDataset('./pretrain.pt')
|
24 |
+
print(dataset[0])
|
25 |
+
```
|