broadfield-dev commited on
Commit
fe5ff1b
·
verified ·
1 Parent(s): 7656238

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -2
app.py CHANGED
@@ -1,4 +1,18 @@
 
 
1
  from embedding_atlas.widget import EmbeddingAtlasWidget
2
 
3
- # Show the Embedding Atlas widget for your data frame:
4
- EmbeddingAtlasWidget()
 
 
 
 
 
 
 
 
 
 
 
 
 
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)