Datasets:
File size: 744 Bytes
a9b60c5 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# Working with the embeddings
The embeddings are available as numpy files, where each row is a 768-dimension floating point embedding. Each row is associated with it's matching index in the metadata files.
#### Open an embedding file
The files are in numpy format, and can be opened with `numpy` in Python.
```python
import numpy as np
embeddings = np.load('pd12m.01.npy')
```
#### Join Embeddings to Metadata
If you already have the metadata files loaded with pandas, you can join the embeddings to the dataframe simply.
```python
df["embeddings"] = embeddings.tolist()
```
Alternatively, you could use a 0-based index to access both the metadata and associated embedding.
```python
i = 300
metadata = df.iloc[i]
embedding = embeddings[i]
|