Skip to content

Commit c01d8df

Browse files
committed
consistently reorder dataset
1 parent 9e73e60 commit c01d8df

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

step_1/bert/run_classifier.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ def load_dataset(self, directory, set_type):
317317
pos_df["polarity"] = "positive"
318318
neg_df["polarity"] = "negative"
319319
return self._create_examples(
320-
pd.concat([pos_df, neg_df]).sample(frac=1).reset_index(drop=True),
320+
pd.concat([pos_df, neg_df]).sample(frac=1, random_state=42).reset_index(drop=True),
321321
set_type
322322
)
323323

step_2/bert/run_classifier.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ def load_dataset(self, directory, set_type):
325325
pos_df["polarity"] = "positive"
326326
neg_df["polarity"] = "negative"
327327
return self._create_examples(
328-
pd.concat([pos_df, neg_df]).sample(frac=1).reset_index(drop=True),
328+
pd.concat([pos_df, neg_df]).sample(frac=1, random_state=42).reset_index(drop=True),
329329
set_type
330330
)
331331

step_3/bert/run_classifier.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ def load_dataset(self, directory, set_type):
325325
pos_df["polarity"] = "positive"
326326
neg_df["polarity"] = "negative"
327327
return self._create_examples(
328-
pd.concat([pos_df, neg_df]).sample(frac=1).reset_index(drop=True),
328+
pd.concat([pos_df, neg_df]).sample(frac=1, random_state=42).reset_index(drop=True),
329329
set_type
330330
)
331331

step_4/bert/run_classifier.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ def load_dataset(self, directory, set_type):
325325
pos_df["polarity"] = "positive"
326326
neg_df["polarity"] = "negative"
327327
return self._create_examples(
328-
pd.concat([pos_df, neg_df]).sample(frac=1).reset_index(drop=True),
328+
pd.concat([pos_df, neg_df]).sample(frac=1, random_state=42).reset_index(drop=True),
329329
set_type
330330
)
331331

0 commit comments

Comments
 (0)