|
# README |
|
|
|
## Description |
|
|
|
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) |
|
|
|
## Load Example |
|
|
|
```python |
|
import torch |
|
from torch_geometric.data import InMemoryDataset |
|
|
|
|
|
class PubChemDataset(InMemoryDataset): |
|
def __init__(self, path): |
|
super(PubChemDataset, self).__init__() |
|
self.data, self.slices = torch.load(path) |
|
|
|
def __getitem__(self, idx): |
|
return self.get(idx) |
|
|
|
if __name__ == '__main__': |
|
dataset = PubChemDataset('./pretrain.pt') |
|
print(dataset[0]) |
|
``` |