muhammadravi251001 commited on
Commit
b84e1be
1 Parent(s): 69bd761

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +68 -0
README.md CHANGED
@@ -32,4 +32,72 @@ test_dataset = Dataset.from_dict(df_test)
32
 
33
  dataset = DatasetDict({"train": train_dataset, "validation": validation_dataset, "test": test_dataset})
34
  dataset
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  ```
 
32
 
33
  dataset = DatasetDict({"train": train_dataset, "validation": validation_dataset, "test": test_dataset})
34
  dataset
35
+ ```
36
+
37
+ If you want to download keep-invalid-data-dataset:
38
+ ```
39
+ from datasets import load_dataset, Dataset, DatasetDict
40
+ import pandas as pd
41
+
42
+ data_files = {"train": "data_nli_train_df_keep.csv",
43
+ "validation": "data_nli_val_df_keep.csv",
44
+ "test": "data_nli_test_df_keep.csv"}
45
+
46
+ dataset = load_dataset("muhammadravi251001/debug-entailment", data_files=data_files)
47
+
48
+ # selected_columns = ["premise", "hypothesis", "label"]
49
+ selected_columns = dataset.column_names['train'] # Uncomment this line to retrieve all of the columns
50
+
51
+ df_train = pd.DataFrame(dataset["train"])
52
+ df_train = df_train[selected_columns]
53
+
54
+ df_val = pd.DataFrame(dataset["validation"])
55
+ df_val = df_val[selected_columns]
56
+
57
+ df_test = pd.DataFrame(dataset["test"])
58
+ df_test = df_test[selected_columns]
59
+
60
+ train_dataset = Dataset.from_dict(df_train)
61
+ validation_dataset = Dataset.from_dict(df_val)
62
+ test_dataset = Dataset.from_dict(df_test)
63
+
64
+ dataset = DatasetDict({"train": train_dataset, "validation": validation_dataset, "test": test_dataset})
65
+
66
+ data_qas_train_df = pd.DataFrame(dataset["train"])
67
+ data_qas_val_df = pd.DataFrame(dataset["validation"])
68
+ data_qas_test_df = pd.DataFrame(dataset["test"])
69
+ ```
70
+
71
+ If you want to download drop-invalid-data-dataset:
72
+ ```
73
+ from datasets import load_dataset, Dataset, DatasetDict
74
+ import pandas as pd
75
+
76
+ data_files = {"train": "data_nli_train_df_drop.csv",
77
+ "validation": "data_nli_val_df_drop.csv",
78
+ "test": "data_nli_test_df_drop.csv"}
79
+
80
+ dataset = load_dataset("muhammadravi251001/debug-entailment", data_files=data_files)
81
+
82
+ # selected_columns = ["premise", "hypothesis", "label"]
83
+ selected_columns = dataset.column_names['train'] # Uncomment this line to retrieve all of the columns
84
+
85
+ df_train = pd.DataFrame(dataset["train"])
86
+ df_train = df_train[selected_columns]
87
+
88
+ df_val = pd.DataFrame(dataset["validation"])
89
+ df_val = df_val[selected_columns]
90
+
91
+ df_test = pd.DataFrame(dataset["test"])
92
+ df_test = df_test[selected_columns]
93
+
94
+ train_dataset = Dataset.from_dict(df_train)
95
+ validation_dataset = Dataset.from_dict(df_val)
96
+ test_dataset = Dataset.from_dict(df_test)
97
+
98
+ dataset = DatasetDict({"train": train_dataset, "validation": validation_dataset, "test": test_dataset})
99
+
100
+ data_qas_train_df = pd.DataFrame(dataset["train"])
101
+ data_qas_val_df = pd.DataFrame(dataset["validation"])
102
+ data_qas_test_df = pd.DataFrame(dataset["test"])
103
  ```