Adam-Al-Rahman commited on
Commit
1aaf2a9
1 Parent(s): 24c0e0f

add: how to download the dataset

Browse files
Files changed (1) hide show
  1. README.md +29 -0
README.md CHANGED
@@ -32,6 +32,35 @@ dataset_info:
32
 
33
  It is a preprocessed dataset that is used to build X_G85 ML Models. The collection of fake news that are collect from the following datasets
34
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
 
36
  ## Credit
37
 
 
32
 
33
  It is a preprocessed dataset that is used to build X_G85 ML Models. The collection of fake news that are collect from the following datasets
34
 
35
+ ## How to stream dataset & use as pandas dataframe
36
+
37
+ By streaming the dataset, it won't download on your host computer. Read more here [hugging face streaming dataset](https://huggingface.co/docs/datasets/stream).
38
+
39
+ ```py
40
+ import pandas as pd
41
+ from datasets import load_dataset
42
+ ```
43
+
44
+ > Note: The following operation may take some time depending on the size of the dataset.
45
+
46
+ ```py
47
+ dataset = load_dataset("x-g85/x_g85_fn_dataset", streaming=True)
48
+
49
+ train = pd.DataFrame(dataset["train"])
50
+ valid = pd.DataFrame(dataset["valid"])
51
+ test = pd.DataFrame(dataset["test"])
52
+ ```
53
+
54
+ ```py
55
+ X_train = train["text"]
56
+ y_train = train["label"]
57
+
58
+ X_valid = valid["text"]
59
+ y_vaild = valid["label"]
60
+
61
+ X_test = test["text"]
62
+ y_test = test["label"]
63
+ ```
64
 
65
  ## Credit
66