File size: 756 Bytes
fe5ff1b
 
5d7eb35
 
 
7656238
 
fe5ff1b
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from datasets import load_dataset
import pandas as pd

import os
os.system("pip install git+https://github.com/apple/embedding-atlas.git ")
from embedding_atlas.widget import EmbeddingAtlasWidget

# Hardcode the name of the Hugging Face dataset
dataset_name = "Trendyol/Trendyol-Cybersecurity-Instruction-Tuning-Dataset"

# Load the dataset from Hugging Face
# The load_dataset function can download datasets from the Hub. [3, 5, 6]
dataset = load_dataset(dataset_name, split="train")

# Convert the dataset to a Pandas DataFrame
# The .to_pandas() method is a convenient way to do this.
df = dataset.to_pandas()

# Show the Embedding Atlas widget for your data frame
# The widget takes a Pandas DataFrame as its primary input. [4]
EmbeddingAtlasWidget(df)