Skip to content

Commit

Permalink
Fixes to FT text-classification (#2654)
Browse files Browse the repository at this point in the history
  • Loading branch information
shivamMg authored Sep 22, 2023
1 parent 557069e commit b304ec7
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@
"outputs": [],
"source": [
"# save 10% of the rows from the train, validation and test dataframes into files with small_ prefix in the ./emotion-dataset folder\n",
"frac = 1\n",
"frac = 0.1\n",
"train_df.sample(frac=frac).to_json(\n",
" \"./emotion-dataset/small_train.jsonl\", orient=\"records\", lines=True\n",
")\n",
Expand Down Expand Up @@ -731,7 +731,7 @@
"source": [
"# create a json object with the key as \"inputs\" and value as a list of values from the text column of the test dataframe\n",
"test_df_copy = test_df[[\"text\"]]\n",
"test_json = {\"input_data\": test_df_copy.to_dict(\"split\")}\n",
"test_json = {\"inputs\": {\"text\": list(test_df_copy[\"text\"])}}\n",
"# save the json object to a file named sample_score.json in the ./emotion-dataset folder\n",
"with open(\"./emotion-dataset/sample_score.json\", \"w\") as f:\n",
" json.dump(test_json, f)"
Expand Down

0 comments on commit b304ec7

Please sign in to comment.