Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,18 @@
|
|
|
|
|
|
1 |
from embedding_atlas.widget import EmbeddingAtlasWidget
|
2 |
|
3 |
-
#
|
4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from datasets import load_dataset
|
2 |
+
import pandas as pd
|
3 |
from embedding_atlas.widget import EmbeddingAtlasWidget
|
4 |
|
5 |
+
# Hardcode the name of the Hugging Face dataset
|
6 |
+
dataset_name = "Trendyol/Trendyol-Cybersecurity-Instruction-Tuning-Dataset"
|
7 |
+
|
8 |
+
# Load the dataset from Hugging Face
|
9 |
+
# The load_dataset function can download datasets from the Hub. [3, 5, 6]
|
10 |
+
dataset = load_dataset(dataset_name, split="train")
|
11 |
+
|
12 |
+
# Convert the dataset to a Pandas DataFrame
|
13 |
+
# The .to_pandas() method is a convenient way to do this.
|
14 |
+
df = dataset.to_pandas()
|
15 |
+
|
16 |
+
# Show the Embedding Atlas widget for your data frame
|
17 |
+
# The widget takes a Pandas DataFrame as its primary input. [4]
|
18 |
+
EmbeddingAtlasWidget(df)
|