tjaffri commited on
Commit
19a16ef
1 Parent(s): 62bb12a

Update notebook

Browse files
Files changed (1) hide show
  1. explore.ipynb +16 -46
explore.ipynb CHANGED
@@ -12,7 +12,7 @@
12
  },
13
  {
14
  "cell_type": "code",
15
- "execution_count": 1,
16
  "metadata": {},
17
  "outputs": [],
18
  "source": [
@@ -26,7 +26,7 @@
26
  "outputs": [],
27
  "source": [
28
  "# install dependencies and get a token\n",
29
- "!pip install datasets huggingface_hub ipywidgets\n",
30
  "\n",
31
  "from huggingface_hub import notebook_login\n",
32
  "notebook_login()\n"
@@ -41,56 +41,22 @@
41
  },
42
  {
43
  "cell_type": "code",
44
- "execution_count": 2,
45
  "metadata": {},
46
- "outputs": [
47
- {
48
- "name": "stderr",
49
- "output_type": "stream",
50
- "text": [
51
- "Found cached dataset parquet (/root/.cache/huggingface/datasets/docugami___parquet/docugami--dfm-csl-large-benchmark-1b323996e223b130/0.0.0/2a3b91fbd88a2c90d1dbbb32b460cf621d31bd5b05b934492fdef7d8d6f236ec)\n"
52
- ]
53
- },
54
- {
55
- "data": {
56
- "text/plain": [
57
- "Dataset({\n",
58
- " features: ['Text', 'Ground Truth', 'docugami/dfm-csl-large'],\n",
59
- " num_rows: 1088\n",
60
- "})"
61
- ]
62
- },
63
- "execution_count": 2,
64
- "metadata": {},
65
- "output_type": "execute_result"
66
- }
67
- ],
68
  "source": [
69
  "from datasets import load_dataset\n",
70
  "\n",
71
  "# Download and check out metadata for dataset\n",
72
- "dataset = load_dataset(\"docugami/dfm-csl-large-benchmark\", split=\"eval\")\n",
73
  "dataset"
74
  ]
75
  },
76
  {
77
  "cell_type": "code",
78
- "execution_count": 3,
79
  "metadata": {},
80
- "outputs": [
81
- {
82
- "data": {
83
- "text/plain": [
84
- "{'Text': \"Tenant, at all times during the term of this Lease and at Tenant's expense, shall provide and keep in force with insurers reasonably approved by Landlord Commercial General Liability insurance against all claims for personal injury, bodily injury, death or property damage occurring upon, in or about the Premises, such insurance (a) to be on an occurrence basis with a general aggregate of not less than\",\n",
85
- " 'Ground Truth': 'Commercial General Liability Insurance',\n",
86
- " 'docugami/dfm-csl-large': 'Commercial General Liability Insurance'}"
87
- ]
88
- },
89
- "execution_count": 3,
90
- "metadata": {},
91
- "output_type": "execute_result"
92
- }
93
- ],
94
  "source": [
95
  "# let's look at one of the rows\n",
96
  "dataset[-1]"
@@ -111,8 +77,10 @@
111
  "metadata": {},
112
  "outputs": [],
113
  "source": [
114
- "# download latest CSV from github\n",
115
- "!wget -P ./temp https://raw.githubusercontent.com/docugami/DFM-benchmarks/main/data/annotations/CSL-Large.csv"
 
 
116
  ]
117
  },
118
  {
@@ -123,11 +91,13 @@
123
  "source": [
124
  "from datasets import Dataset\n",
125
  "\n",
126
- "# Load the data from the csv\n",
127
- "dataset = Dataset.from_csv('./temp/CSL-Large.csv')\n",
 
128
  "\n",
129
  "# Push the dataset to the Hugging Face Hub\n",
130
- "dataset.push_to_hub(DATASET_NAME, split=\"eval\")"
 
131
  ]
132
  }
133
  ],
 
12
  },
13
  {
14
  "cell_type": "code",
15
+ "execution_count": null,
16
  "metadata": {},
17
  "outputs": [],
18
  "source": [
 
26
  "outputs": [],
27
  "source": [
28
  "# install dependencies and get a token\n",
29
+ "!pip install datasets huggingface_hub ipywidgets --quiet\n",
30
  "\n",
31
  "from huggingface_hub import notebook_login\n",
32
  "notebook_login()\n"
 
41
  },
42
  {
43
  "cell_type": "code",
44
+ "execution_count": null,
45
  "metadata": {},
46
+ "outputs": [],
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  "source": [
48
  "from datasets import load_dataset\n",
49
  "\n",
50
  "# Download and check out metadata for dataset\n",
51
+ "dataset = load_dataset(DATASET_NAME, split=\"eval\")\n",
52
  "dataset"
53
  ]
54
  },
55
  {
56
  "cell_type": "code",
57
+ "execution_count": null,
58
  "metadata": {},
59
+ "outputs": [],
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  "source": [
61
  "# let's look at one of the rows\n",
62
  "dataset[-1]"
 
77
  "metadata": {},
78
  "outputs": [],
79
  "source": [
80
+ "# download latest CSVs from github\n",
81
+ "!rm -rf ./temp\n",
82
+ "!wget -P ./temp/eval https://raw.githubusercontent.com/docugami/DFM-benchmarks/main/data/annotations/eval/CSL-Large.csv\n",
83
+ "!wget -P ./temp/train https://raw.githubusercontent.com/docugami/DFM-benchmarks/main/data/annotations/train/CSL-Large.csv"
84
  ]
85
  },
86
  {
 
91
  "source": [
92
  "from datasets import Dataset\n",
93
  "\n",
94
+ "# Load the data from the csv files\n",
95
+ "eval_set = Dataset.from_csv('./temp/eval/CSL-Large.csv')\n",
96
+ "train_set = Dataset.from_csv('./temp/train/CSL-Large.csv')\n",
97
  "\n",
98
  "# Push the dataset to the Hugging Face Hub\n",
99
+ "eval_set.push_to_hub(DATASET_NAME, split=\"eval\")\n",
100
+ "train_set.push_to_hub(DATASET_NAME, split=\"train\")"
101
  ]
102
  }
103
  ],