Update README.md
Browse files
README.md
CHANGED
|
@@ -1,27 +1,46 @@
|
|
| 1 |
---
|
| 2 |
license: mit
|
| 3 |
language:
|
| 4 |
-
- en
|
| 5 |
tags:
|
| 6 |
- legal
|
| 7 |
- patents
|
| 8 |
-
pretty_name:
|
| 9 |
size_categories:
|
| 10 |
- 10B<n<100B
|
| 11 |
---
|
| 12 |
-
#
|
| 13 |
|
| 14 |

|
| 15 |
|
| 16 |
## Dataset Summary
|
| 17 |
|
| 18 |
-
The **PatClass2011** dataset is a comprehensive collection of approximately 719,000 patent documents
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
## Dataset Structure
|
| 21 |
|
| 22 |
-
|
|
|
|
|
|
|
| 23 |
|
| 24 |
-
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
- `ucid`: Unique identifier for the patent document.
|
| 27 |
- `doc_number`: Patent document number.
|
|
@@ -30,7 +49,7 @@ Each record in the dataset represents a patent document with the following field
|
|
| 30 |
- `lang`: Language of the patent document.
|
| 31 |
- `date`: Publication date of the patent.
|
| 32 |
- `application_date`: Date when the patent application was filed.
|
| 33 |
-
- `date_produced`: Date when the data was
|
| 34 |
- `status`: Status of the patent document.
|
| 35 |
- `main_code`: Primary classification code assigned to the patent.
|
| 36 |
- `further_codes`: Additional classification codes.
|
|
@@ -43,13 +62,104 @@ Each record in the dataset represents a patent document with the following field
|
|
| 43 |
- `applicants`: Entities or individuals who applied for the patent.
|
| 44 |
- `inventors`: Inventors credited in the patent document.
|
| 45 |
|
| 46 |
-
|
| 47 |
|
| 48 |
-
|
| 49 |
|
| 50 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
|
| 52 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
|
| 54 |
```python
|
| 55 |
from datasets import load_dataset
|
|
@@ -57,26 +167,24 @@ from datasets import load_dataset
|
|
| 57 |
dataset = load_dataset("amylonidis/PatClass2011")
|
| 58 |
```
|
| 59 |
|
| 60 |
-
This will load the dataset into a `DatasetDict` object,
|
| 61 |
|
| 62 |
-
##
|
| 63 |
|
| 64 |
-
### Source Data
|
| 65 |
|
| 66 |
-
|
| 67 |
|
| 68 |
-
|
| 69 |
|
| 70 |
-
|
| 71 |
|
| 72 |
-
|
| 73 |
|
| 74 |
-
The PatClass2011 dataset
|
| 75 |
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
-
|
| 79 |
-
- Machine learning models for legal and technical document analysis.
|
| 80 |
|
| 81 |
## Licensing Information
|
| 82 |
|
|
@@ -86,4 +194,4 @@ This dataset is distributed under the [MIT License](https://opensource.org/licen
|
|
| 86 |
|
| 87 |
If you utilize the PatClass2011 dataset in your research or applications, please cite it appropriately.
|
| 88 |
|
| 89 |
-
---
|
|
|
|
| 1 |
---
|
| 2 |
license: mit
|
| 3 |
language:
|
| 4 |
+
- en,
|
| 5 |
tags:
|
| 6 |
- legal
|
| 7 |
- patents
|
| 8 |
+
pretty_name: PatClass2011
|
| 9 |
size_categories:
|
| 10 |
- 10B<n<100B
|
| 11 |
---
|
| 12 |
+
# PatClass2011 Dataset
|
| 13 |
|
| 14 |

|
| 15 |
|
| 16 |
## Dataset Summary
|
| 17 |
|
| 18 |
+
The **PatClass2011** dataset is a comprehensive collection of approximately 719,000 patent documents from the CLEF-IP 2011 Test Collection,
|
| 19 |
+
focusing on patent classification tasks. Each entry encompasses detailed metadata and textual content, including titles, abstracts, descriptions, and claims.
|
| 20 |
+
The dataset is structured to facilitate research in patent classification, information retrieval, and natural language processing.
|
| 21 |
+
|
| 22 |
+
## Languages
|
| 23 |
+
|
| 24 |
+
The dataset contains English, French and German text.
|
| 25 |
+
|
| 26 |
+
## Domain
|
| 27 |
+
|
| 28 |
+
Patents (intellectual property).
|
| 29 |
+
|
| 30 |
+
## Dataset Curators
|
| 31 |
+
|
| 32 |
+
The dataset was created by Eleni Kamateri and Tasos Mylonidis
|
| 33 |
|
| 34 |
## Dataset Structure
|
| 35 |
|
| 36 |
+
The dataset consists of 28 folders which correspond to a specific year, ranging from 1978 to 2005. Within each yearly subdirectory, you'll find a CSV file named in the format
|
| 37 |
+
clefip2011_en_classification_<year>.csv. These files contain patent data that were all published that year.
|
| 38 |
+
This structure facilitates year-wise analysis, allowing researchers to study trends and patterns in patent classifications over time. In total, there are 19 data fields for each CSV
|
| 39 |
|
| 40 |
+
|
| 41 |
+
### Data Fields
|
| 42 |
+
|
| 43 |
+
The dataset is provided in CSV format and includes the aforementioned fields
|
| 44 |
|
| 45 |
- `ucid`: Unique identifier for the patent document.
|
| 46 |
- `doc_number`: Patent document number.
|
|
|
|
| 49 |
- `lang`: Language of the patent document.
|
| 50 |
- `date`: Publication date of the patent.
|
| 51 |
- `application_date`: Date when the patent application was filed.
|
| 52 |
+
- `date_produced`: Date when the data was inserted in the dataset.
|
| 53 |
- `status`: Status of the patent document.
|
| 54 |
- `main_code`: Primary classification code assigned to the patent.
|
| 55 |
- `further_codes`: Additional classification codes.
|
|
|
|
| 62 |
- `applicants`: Entities or individuals who applied for the patent.
|
| 63 |
- `inventors`: Inventors credited in the patent document.
|
| 64 |
|
| 65 |
+
## Usage
|
| 66 |
|
| 67 |
+
## Loading the Dataset
|
| 68 |
|
| 69 |
+
### Sample ( 1985 March to April )
|
| 70 |
+
|
| 71 |
+
The following script can be used to load a sample version of the dataset, which contains all the patent applications
|
| 72 |
+
that were published from March until April in 1985.
|
| 73 |
+
|
| 74 |
+
|
| 75 |
+
'''
|
| 76 |
+
|
| 77 |
+
def load_csvs_from_huggingface( start_date, end_date):
|
| 78 |
+
"""
|
| 79 |
+
Load only the necessary CSV files from a Hugging Face dataset repository.
|
| 80 |
+
|
| 81 |
+
:param start_year: int, the start year (inclusive)
|
| 82 |
+
:param end_year: int, the end year (inclusive)
|
| 83 |
+
|
| 84 |
+
:return: pd.DataFrame, combined data from selected CSVs
|
| 85 |
+
"""
|
| 86 |
+
|
| 87 |
+
|
| 88 |
+
column_types = {
|
| 89 |
+
"ucid": "string",
|
| 90 |
+
"country": "category",
|
| 91 |
+
"doc_number": "int64",
|
| 92 |
+
"kind": "category",
|
| 93 |
+
"lang": "category",,
|
| 94 |
+
"date": "int32",
|
| 95 |
+
"application_date": "int32",
|
| 96 |
+
"date_produced": "int32",
|
| 97 |
+
"status": "category",
|
| 98 |
+
"main_code": "string",
|
| 99 |
+
"further_codes": "string",
|
| 100 |
+
"ipcr_codes": "string",
|
| 101 |
+
"ecla_codes": "string",
|
| 102 |
+
"title": "string",
|
| 103 |
+
"abstract": "string",
|
| 104 |
+
"description": "string",
|
| 105 |
+
"claims": "string",
|
| 106 |
+
"applicants": "string",
|
| 107 |
+
"inventors": "string",
|
| 108 |
+
}
|
| 109 |
+
|
| 110 |
+
|
| 111 |
+
dataset_years = ['1978', '1979', '1980', '1981', '1982', '1983', '1984', '1985', '1986',
|
| 112 |
+
'1987', '1988', '1989', '1990', '1991', '1992', '1993', '1994', '1995',
|
| 113 |
+
'1996','1997', '1998', '1999', '2000', '2001', '2002','2003', '2004', '2005']
|
| 114 |
+
|
| 115 |
+
start_date_int = int(datetime.strptime(start_date, "%Y-%m-%d").strftime("%Y%m%d"))
|
| 116 |
+
end_date_int = int(datetime.strptime(end_date, "%Y-%m-%d").strftime("%Y%m%d"))
|
| 117 |
|
| 118 |
+
start_year, end_year = str(start_date_int)[:4], str(end_date_int)[:4]
|
| 119 |
+
|
| 120 |
+
given_years = [str(year) for year in range(int(start_year), int(end_year) + 1)]
|
| 121 |
+
|
| 122 |
+
matching_years = [f for f in dataset_years for year in given_years if f==year]
|
| 123 |
+
|
| 124 |
+
if not matching_years:
|
| 125 |
+
raise ValueError(f"No matching CSV files found in dataset for the given dates")
|
| 126 |
+
|
| 127 |
+
df_list = []
|
| 128 |
+
for year in matching_years:
|
| 129 |
+
filepath = f"data/years/{year}/clefip2011_en_classification_{year}_validated.csv"
|
| 130 |
+
print(filepath)
|
| 131 |
+
|
| 132 |
+
try:
|
| 133 |
+
dataset = load_dataset("amylonidis/PatClass2011", data_files=filepath)
|
| 134 |
+
df = dataset["train"].to_pandas().astype(column_types)
|
| 135 |
+
df_list.append(df)
|
| 136 |
+
except Exception as e:
|
| 137 |
+
print(f"Error loading {filepath}: {e}")
|
| 138 |
+
|
| 139 |
+
|
| 140 |
+
if df_list:
|
| 141 |
+
df = pd.concat(df_list, ignore_index=True)
|
| 142 |
+
df["date"] = df["date"].astype(float).astype(int)
|
| 143 |
+
df_filtered = df[(df["date"] >= start_date_int) & (df["date"] <= end_date_int)]
|
| 144 |
+
return df_filtered
|
| 145 |
+
else:
|
| 146 |
+
return pd.DataFrame()
|
| 147 |
+
|
| 148 |
+
'''
|
| 149 |
+
|
| 150 |
+
'''
|
| 151 |
+
|
| 152 |
+
start_date = "1985-03-01"
|
| 153 |
+
end_date = "1985-04-30"
|
| 154 |
+
|
| 155 |
+
df = load_csvs_from_huggingface(start_date, end_date)
|
| 156 |
+
|
| 157 |
+
|
| 158 |
+
'''
|
| 159 |
+
|
| 160 |
+
### Full
|
| 161 |
+
|
| 162 |
+
To load the complete dataset using the Hugging Face `datasets` library:
|
| 163 |
|
| 164 |
```python
|
| 165 |
from datasets import load_dataset
|
|
|
|
| 167 |
dataset = load_dataset("amylonidis/PatClass2011")
|
| 168 |
```
|
| 169 |
|
| 170 |
+
This will load the dataset into a `DatasetDict` object, please make sure you have enough disk space.
|
| 171 |
|
| 172 |
+
## Google Colab Analytics
|
| 173 |
|
|
|
|
| 174 |
|
| 175 |
+
You can also use the following Google Colab notebooks to explore the Analytics that were performed to the dataset.
|
| 176 |
|
| 177 |
+
- [Date Analytics](https://colab.research.google.com/drive/1N2w5F1koWmZOyQaf0ZTB3gighPTXtUzD?usp=sharing)
|
| 178 |
|
| 179 |
+
## Dataset Creation
|
| 180 |
|
| 181 |
+
### Source Data
|
| 182 |
|
| 183 |
+
The PatClass2011 dataset aggregates the patent documents from the CLEF-IP 2011 Test Collection using a parsing script. The data includes both metadata and full-text fields, facilitating a wide range of research applications.
|
| 184 |
|
| 185 |
+
### Annotations
|
| 186 |
+
|
| 187 |
+
The dataset does not contain any human-written or computer-generated annotations beyond those produced by patent documents of the Source Data.
|
|
|
|
| 188 |
|
| 189 |
## Licensing Information
|
| 190 |
|
|
|
|
| 194 |
|
| 195 |
If you utilize the PatClass2011 dataset in your research or applications, please cite it appropriately.
|
| 196 |
|
| 197 |
+
---
|