tjaffri commited on
Commit
bd969ff
1 Parent(s): fa2b1f9

Initial notebook commit

Browse files
Files changed (3) hide show
  1. .gitignore +1 -0
  2. README.md +25 -0
  3. explore.ipynb +129 -0
.gitignore ADDED
@@ -0,0 +1 @@
 
 
1
+ temp/
README.md CHANGED
@@ -1,3 +1,28 @@
1
  ---
2
  license: mit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: mit
3
+ language:
4
+ - en
5
+ multilinguality:
6
+ - monolingual
7
+ size_categories:
8
+ - 1K<n<10K
9
+ source_datasets:
10
+ - original
11
+ task_categories:
12
+ - text2text-generation
13
+ - text-generation
14
+ tags:
15
+ - docugami
16
+ - dfm-csl
17
+ pretty_name: DoContextual Semantic Lables (Small)
18
  ---
19
+
20
+ # Contextual Semantic Labels (Small) Benchmark Dataset
21
+
22
+ Please see [https://github.com/docugami/DFM-benchmarks](https://github.com/docugami/DFM-benchmarks) for more details, eval code, and current scores for different models.
23
+
24
+ # Using Dataset
25
+
26
+ Please refer to standard huggingface documentation to use this dataset: [https://huggingface.co/docs/datasets/index](https://huggingface.co/docs/datasets/index)
27
+
28
+ The [explore.ipynb](./explore.ipynb) notebook has some reference code.
explore.ipynb ADDED
@@ -0,0 +1,129 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "attachments": {},
5
+ "cell_type": "markdown",
6
+ "metadata": {},
7
+ "source": [
8
+ "# Explore Dataset: docugami/dfm-csl-small-benchmark\n",
9
+ "\n",
10
+ "See [README](./README.md) for more information"
11
+ ]
12
+ },
13
+ {
14
+ "cell_type": "code",
15
+ "execution_count": null,
16
+ "metadata": {},
17
+ "outputs": [],
18
+ "source": [
19
+ "DATASET_NAME=\"Docugami/dfm-csl-small-benchmark\""
20
+ ]
21
+ },
22
+ {
23
+ "cell_type": "code",
24
+ "execution_count": null,
25
+ "metadata": {},
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"
33
+ ]
34
+ },
35
+ {
36
+ "cell_type": "markdown",
37
+ "metadata": {},
38
+ "source": [
39
+ "# Explore Dataset"
40
+ ]
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(\"docugami/dfm-csl-small-benchmark\", 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]"
63
+ ]
64
+ },
65
+ {
66
+ "attachments": {},
67
+ "cell_type": "markdown",
68
+ "metadata": {},
69
+ "source": [
70
+ "# Update Dataset from Github\n",
71
+ "Note: this requires write access to the dataset."
72
+ ]
73
+ },
74
+ {
75
+ "cell_type": "code",
76
+ "execution_count": null,
77
+ "metadata": {},
78
+ "outputs": [],
79
+ "source": [
80
+ "# download latest CSV from github\n",
81
+ "!wget -P ./temp https://raw.githubusercontent.com/docugami/DFM-benchmarks/main/data/annotations/CSL-Small.csv"
82
+ ]
83
+ },
84
+ {
85
+ "cell_type": "code",
86
+ "execution_count": null,
87
+ "metadata": {},
88
+ "outputs": [],
89
+ "source": [
90
+ "from datasets import Dataset\n",
91
+ "\n",
92
+ "# Load the data from the csv\n",
93
+ "dataset = Dataset.from_csv('./temp/CSL-Small.csv')\n",
94
+ "\n",
95
+ "# Push the dataset to the Hugging Face Hub\n",
96
+ "dataset.push_to_hub(DATASET_NAME, split=\"eval\")"
97
+ ]
98
+ },
99
+ {
100
+ "cell_type": "code",
101
+ "execution_count": null,
102
+ "metadata": {},
103
+ "outputs": [],
104
+ "source": []
105
+ }
106
+ ],
107
+ "metadata": {
108
+ "kernelspec": {
109
+ "display_name": "Python 3",
110
+ "language": "python",
111
+ "name": "python3"
112
+ },
113
+ "language_info": {
114
+ "codemirror_mode": {
115
+ "name": "ipython",
116
+ "version": 3
117
+ },
118
+ "file_extension": ".py",
119
+ "mimetype": "text/x-python",
120
+ "name": "python",
121
+ "nbconvert_exporter": "python",
122
+ "pygments_lexer": "ipython3",
123
+ "version": "3.9.16"
124
+ },
125
+ "orig_nbformat": 4
126
+ },
127
+ "nbformat": 4,
128
+ "nbformat_minor": 2
129
+ }