v3.0: Add notes.csv, accords.csv, new voting format
Browse files- README.md +180 -78
- accords.csv +3 -0
- brands.csv +2 -2
- fragrance-database.py +144 -0
- fragrances.csv +2 -2
- notes.csv +3 -0
- perfumers.csv +2 -2
README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
---
|
| 2 |
-
license:
|
| 3 |
task_categories:
|
| 4 |
- feature-extraction
|
| 5 |
- text-classification
|
|
@@ -12,6 +12,7 @@ tags:
|
|
| 12 |
- recommendation-system
|
| 13 |
- e-commerce
|
| 14 |
- retail
|
|
|
|
| 15 |
size_categories:
|
| 16 |
- 10<n<100
|
| 17 |
configs:
|
|
@@ -25,6 +26,12 @@ configs:
|
|
| 25 |
- config_name: perfumers
|
| 26 |
data_files: perfumers.csv
|
| 27 |
sep: "|"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
dataset_info:
|
| 29 |
- config_name: fragrances
|
| 30 |
features:
|
|
@@ -84,6 +91,10 @@ dataset_info:
|
|
| 84 |
dtype: string
|
| 85 |
- name: news_ids
|
| 86 |
dtype: string
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
- config_name: brands
|
| 88 |
features:
|
| 89 |
- name: id
|
|
@@ -130,11 +141,55 @@ dataset_info:
|
|
| 130 |
dtype: int64
|
| 131 |
- name: biography
|
| 132 |
dtype: string
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 133 |
---
|
| 134 |
|
| 135 |
-
# FragDB — Fragrance Database (Sample)
|
| 136 |
|
| 137 |
-
The most comprehensive structured fragrance database available. This is a **free sample** containing 10 fragrances with related brands and
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 138 |
|
| 139 |
## Dataset Description
|
| 140 |
|
|
@@ -142,18 +197,22 @@ FragDB is a relational database of the fragrance industry containing:
|
|
| 142 |
|
| 143 |
| File | Records | Fields | Description |
|
| 144 |
|------|---------|--------|-------------|
|
| 145 |
-
| `fragrances.csv` | 10 |
|
| 146 |
-
| `brands.csv` |
|
| 147 |
-
| `perfumers.csv` |
|
|
|
|
|
|
|
| 148 |
|
| 149 |
### Full Database
|
| 150 |
|
| 151 |
| | Sample | Full Database |
|
| 152 |
|---|--------|---------------|
|
| 153 |
-
| Fragrances | 10 | **
|
| 154 |
-
| Brands |
|
| 155 |
-
| Perfumers |
|
| 156 |
-
|
|
|
|
|
|
|
|
| 157 |
|
| 158 |
Full database available at [fragdb.net](https://fragdb.net)
|
| 159 |
|
|
@@ -165,12 +224,11 @@ Full database available at [fragdb.net](https://fragdb.net)
|
|
| 165 |
from datasets import load_dataset
|
| 166 |
|
| 167 |
# Load all files
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
perfumers = dataset['perfumers']
|
| 174 |
```
|
| 175 |
|
| 176 |
### Using Pandas
|
|
@@ -181,6 +239,8 @@ import pandas as pd
|
|
| 181 |
fragrances = pd.read_csv('fragrances.csv', sep='|')
|
| 182 |
brands = pd.read_csv('brands.csv', sep='|')
|
| 183 |
perfumers = pd.read_csv('perfumers.csv', sep='|')
|
|
|
|
|
|
|
| 184 |
|
| 185 |
# Join fragrances with brands
|
| 186 |
fragrances['brand_id'] = fragrances['brand'].str.split(';').str[1]
|
|
@@ -191,7 +251,7 @@ print(df[['name', 'name_brand', 'country', 'rating']])
|
|
| 191 |
|
| 192 |
## Data Structure
|
| 193 |
|
| 194 |
-
### fragrances.csv (
|
| 195 |
|
| 196 |
#### Identity & Basic Info
|
| 197 |
| Field | Description | Example |
|
|
@@ -204,26 +264,26 @@ print(df[['name', 'name_brand', 'country', 'rating']])
|
|
| 204 |
| `gender` | Target gender | `for men`, `for women`, `for women and men` |
|
| 205 |
| `collection` | Collection within brand | Text |
|
| 206 |
|
| 207 |
-
#### Composition
|
| 208 |
| Field | Description | Format |
|
| 209 |
|-------|-------------|--------|
|
| 210 |
-
| `accords` | Scent accords with strength | `
|
| 211 |
-
| `notes_pyramid` | Notes by layer | `top(
|
| 212 |
| `perfumers` | Perfumer names and IDs | `Erwin Creed;p1;Olivier Creed;p2` |
|
| 213 |
| `description` | Fragrance description | HTML text |
|
| 214 |
|
| 215 |
-
#### Ratings & Votes
|
| 216 |
| Field | Description | Format |
|
| 217 |
|-------|-------------|--------|
|
| 218 |
| `rating` | Average rating & vote count | `4.33;24561` |
|
| 219 |
-
| `appreciation` | Love/like/ok/dislike/hate | `love:
|
| 220 |
-
| `price_value` | Price perception votes | `way_overpriced:6658;overpriced:2844;...` |
|
| 221 |
-
| `ownership` | Ownership status | `have_it:52.82;had_it:12.32
|
| 222 |
-
| `gender_votes` | Gender suitability votes | `female:149;unisex:866;male:7977
|
| 223 |
-
| `longevity` | Duration votes | `very_weak:784;weak:1459;moderate:5869;...` |
|
| 224 |
-
| `sillage` | Projection votes | `intimate:1816;moderate:8139;strong:4289;...` |
|
| 225 |
-
| `season` | Seasonal suitability | `winter:44.39;spring:97.60
|
| 226 |
-
| `time_of_day` | Day/night suitability | `day:100
|
| 227 |
|
| 228 |
#### Related Fragrances
|
| 229 |
| Field | Description | Format |
|
|
@@ -233,12 +293,37 @@ print(df[['name', 'name_brand', 'country', 'rating']])
|
|
| 233 |
| `reminds_of` | Similar fragrances | Semicolon-separated PIDs |
|
| 234 |
| `also_like` | Recommended fragrances | Semicolon-separated PIDs |
|
| 235 |
|
| 236 |
-
####
|
| 237 |
| Field | Description |
|
| 238 |
|-------|-------------|
|
| 239 |
-
| `
|
| 240 |
-
| `
|
| 241 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 242 |
|
| 243 |
### brands.csv (10 fields)
|
| 244 |
|
|
@@ -271,26 +356,73 @@ print(df[['name', 'name_brand', 'country', 'rating']])
|
|
| 271 |
| `perfumes_count` | Number of fragrances | `538` |
|
| 272 |
| `biography` | Biography | HTML text |
|
| 273 |
|
| 274 |
-
##
|
| 275 |
|
| 276 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 277 |
|
| 278 |
-
|
| 279 |
-
|
| 280 |
-
|
| 281 |
-
|
| 282 |
-
|
| 283 |
-
|
| 284 |
-
|
| 285 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 286 |
|
| 287 |
## Use Cases
|
| 288 |
|
| 289 |
- **Recommendation Systems** — Build "if you like X, try Y" engines using accords, notes, and also_like data
|
| 290 |
- **Market Analysis** — Analyze trends by brand, country, year, or perfumer
|
| 291 |
-
- **NLP** — Process
|
| 292 |
- **Collection Apps** — Build fragrance tracking and discovery apps
|
| 293 |
- **E-commerce** — Enrich product catalogs with detailed fragrance data
|
|
|
|
| 294 |
|
| 295 |
## File Format
|
| 296 |
|
|
@@ -298,37 +430,6 @@ The sample includes these iconic fragrances:
|
|
| 298 |
- **Encoding**: UTF-8
|
| 299 |
- **Quote Character**: `"` (double quote)
|
| 300 |
|
| 301 |
-
## Parsing Examples
|
| 302 |
-
|
| 303 |
-
### Parse brand field
|
| 304 |
-
```python
|
| 305 |
-
brand_name, brand_id = row['brand'].split(';')
|
| 306 |
-
# brand_name = "Chanel", brand_id = "b91"
|
| 307 |
-
```
|
| 308 |
-
|
| 309 |
-
### Parse rating field
|
| 310 |
-
```python
|
| 311 |
-
rating_avg, rating_votes = row['rating'].split(';')
|
| 312 |
-
# rating_avg = "4.33", rating_votes = "24561"
|
| 313 |
-
```
|
| 314 |
-
|
| 315 |
-
### Parse accords field
|
| 316 |
-
```python
|
| 317 |
-
accords = []
|
| 318 |
-
for accord in row['accords'].split(';'):
|
| 319 |
-
name, strength, bg_color, text_color = accord.split(':')
|
| 320 |
-
accords.append({'name': name, 'strength': int(strength)})
|
| 321 |
-
```
|
| 322 |
-
|
| 323 |
-
### Parse notes pyramid
|
| 324 |
-
```python
|
| 325 |
-
import re
|
| 326 |
-
layers = re.findall(r'(top|middle|base)\(([^)]*)\)', row['notes_pyramid'])
|
| 327 |
-
for layer_name, notes_str in layers:
|
| 328 |
-
notes = [n.split(',')[0] for n in notes_str.split(';')]
|
| 329 |
-
print(f"{layer_name}: {notes}")
|
| 330 |
-
```
|
| 331 |
-
|
| 332 |
## Links
|
| 333 |
|
| 334 |
- **Full Database**: [fragdb.net](https://fragdb.net)
|
|
@@ -337,7 +438,7 @@ for layer_name, notes_str in layers:
|
|
| 337 |
|
| 338 |
## License
|
| 339 |
|
| 340 |
-
This sample is released under the **
|
| 341 |
|
| 342 |
The full database requires a commercial license — see [fragdb.net](https://fragdb.net) for details.
|
| 343 |
|
|
@@ -345,10 +446,11 @@ The full database requires a commercial license — see [fragdb.net](https://fra
|
|
| 345 |
|
| 346 |
```bibtex
|
| 347 |
@dataset{fragdb2026,
|
| 348 |
-
title={FragDB Fragrance Database},
|
| 349 |
author={FragDB},
|
| 350 |
year={2026},
|
|
|
|
| 351 |
url={https://fragdb.net},
|
| 352 |
-
note={Sample dataset}
|
| 353 |
}
|
| 354 |
```
|
|
|
|
| 1 |
---
|
| 2 |
+
license: cc-by-nc-4.0
|
| 3 |
task_categories:
|
| 4 |
- feature-extraction
|
| 5 |
- text-classification
|
|
|
|
| 12 |
- recommendation-system
|
| 13 |
- e-commerce
|
| 14 |
- retail
|
| 15 |
+
- fragrantica
|
| 16 |
size_categories:
|
| 17 |
- 10<n<100
|
| 18 |
configs:
|
|
|
|
| 26 |
- config_name: perfumers
|
| 27 |
data_files: perfumers.csv
|
| 28 |
sep: "|"
|
| 29 |
+
- config_name: notes
|
| 30 |
+
data_files: notes.csv
|
| 31 |
+
sep: "|"
|
| 32 |
+
- config_name: accords
|
| 33 |
+
data_files: accords.csv
|
| 34 |
+
sep: "|"
|
| 35 |
dataset_info:
|
| 36 |
- config_name: fragrances
|
| 37 |
features:
|
|
|
|
| 91 |
dtype: string
|
| 92 |
- name: news_ids
|
| 93 |
dtype: string
|
| 94 |
+
- name: reviews_count
|
| 95 |
+
dtype: int64
|
| 96 |
+
- name: pros_cons
|
| 97 |
+
dtype: string
|
| 98 |
- config_name: brands
|
| 99 |
features:
|
| 100 |
- name: id
|
|
|
|
| 141 |
dtype: int64
|
| 142 |
- name: biography
|
| 143 |
dtype: string
|
| 144 |
+
- config_name: notes
|
| 145 |
+
features:
|
| 146 |
+
- name: id
|
| 147 |
+
dtype: string
|
| 148 |
+
- name: name
|
| 149 |
+
dtype: string
|
| 150 |
+
- name: url
|
| 151 |
+
dtype: string
|
| 152 |
+
- name: latin_name
|
| 153 |
+
dtype: string
|
| 154 |
+
- name: other_names
|
| 155 |
+
dtype: string
|
| 156 |
+
- name: group
|
| 157 |
+
dtype: string
|
| 158 |
+
- name: odor_profile
|
| 159 |
+
dtype: string
|
| 160 |
+
- name: main_icon
|
| 161 |
+
dtype: string
|
| 162 |
+
- name: alt_icons
|
| 163 |
+
dtype: string
|
| 164 |
+
- name: background
|
| 165 |
+
dtype: string
|
| 166 |
+
- name: fragrance_count
|
| 167 |
+
dtype: int64
|
| 168 |
+
- config_name: accords
|
| 169 |
+
features:
|
| 170 |
+
- name: id
|
| 171 |
+
dtype: string
|
| 172 |
+
- name: name
|
| 173 |
+
dtype: string
|
| 174 |
+
- name: bar_color
|
| 175 |
+
dtype: string
|
| 176 |
+
- name: font_color
|
| 177 |
+
dtype: string
|
| 178 |
+
- name: fragrance_count
|
| 179 |
+
dtype: int64
|
| 180 |
---
|
| 181 |
|
| 182 |
+
# FragDB v3.0 — Fragrantica Fragrance Database (Sample)
|
| 183 |
|
| 184 |
+
The most comprehensive structured fragrance database available. This is a **free sample** containing 10 fragrances with related brands, perfumers, notes, and accords.
|
| 185 |
+
|
| 186 |
+
## What's New in v3.0
|
| 187 |
+
|
| 188 |
+
- **2 new reference files**: `notes.csv` and `accords.csv`
|
| 189 |
+
- **New voting format**: `category:votes:percent` (e.g., `love:5000:45.2`)
|
| 190 |
+
- **New accords format**: `id:percent` (join with accords.csv for colors)
|
| 191 |
+
- **Enhanced notes pyramid**: includes opacity and weight values
|
| 192 |
+
- **Total**: 67 data fields across 5 files
|
| 193 |
|
| 194 |
## Dataset Description
|
| 195 |
|
|
|
|
| 197 |
|
| 198 |
| File | Records | Fields | Description |
|
| 199 |
|------|---------|--------|-------------|
|
| 200 |
+
| `fragrances.csv` | 10 | 30 | Iconic fragrances with notes, accords, ratings |
|
| 201 |
+
| `brands.csv` | 10 | 10 | Luxury brand profiles |
|
| 202 |
+
| `perfumers.csv` | 10 | 11 | Master perfumer profiles |
|
| 203 |
+
| `notes.csv` | 10 | 11 | Fragrance notes with Latin names, odor profiles |
|
| 204 |
+
| `accords.csv` | 10 | 5 | Scent accords with display colors |
|
| 205 |
|
| 206 |
### Full Database
|
| 207 |
|
| 208 |
| | Sample | Full Database |
|
| 209 |
|---|--------|---------------|
|
| 210 |
+
| Fragrances | 10 | **120,871** |
|
| 211 |
+
| Brands | 10 | **7,296** |
|
| 212 |
+
| Perfumers | 10 | **2,815** |
|
| 213 |
+
| Notes | 10 | **2,448** |
|
| 214 |
+
| Accords | 10 | **92** |
|
| 215 |
+
| **Total Records** | 50 | **133,522** |
|
| 216 |
|
| 217 |
Full database available at [fragdb.net](https://fragdb.net)
|
| 218 |
|
|
|
|
| 224 |
from datasets import load_dataset
|
| 225 |
|
| 226 |
# Load all files
|
| 227 |
+
fragrances = load_dataset("FragDBnet/fragrance-database", "fragrances")
|
| 228 |
+
brands = load_dataset("FragDBnet/fragrance-database", "brands")
|
| 229 |
+
perfumers = load_dataset("FragDBnet/fragrance-database", "perfumers")
|
| 230 |
+
notes = load_dataset("FragDBnet/fragrance-database", "notes")
|
| 231 |
+
accords = load_dataset("FragDBnet/fragrance-database", "accords")
|
|
|
|
| 232 |
```
|
| 233 |
|
| 234 |
### Using Pandas
|
|
|
|
| 239 |
fragrances = pd.read_csv('fragrances.csv', sep='|')
|
| 240 |
brands = pd.read_csv('brands.csv', sep='|')
|
| 241 |
perfumers = pd.read_csv('perfumers.csv', sep='|')
|
| 242 |
+
notes = pd.read_csv('notes.csv', sep='|')
|
| 243 |
+
accords = pd.read_csv('accords.csv', sep='|')
|
| 244 |
|
| 245 |
# Join fragrances with brands
|
| 246 |
fragrances['brand_id'] = fragrances['brand'].str.split(';').str[1]
|
|
|
|
| 251 |
|
| 252 |
## Data Structure
|
| 253 |
|
| 254 |
+
### fragrances.csv (30 fields)
|
| 255 |
|
| 256 |
#### Identity & Basic Info
|
| 257 |
| Field | Description | Example |
|
|
|
|
| 264 |
| `gender` | Target gender | `for men`, `for women`, `for women and men` |
|
| 265 |
| `collection` | Collection within brand | Text |
|
| 266 |
|
| 267 |
+
#### Composition (v3.0 Format)
|
| 268 |
| Field | Description | Format |
|
| 269 |
|-------|-------------|--------|
|
| 270 |
+
| `accords` | Scent accords with strength | `a1:100;a2:67;a3:45` (join with accords.csv) |
|
| 271 |
+
| `notes_pyramid` | Notes by layer | `top(name,id,url,opacity,weight;...)middle(...)base(...)` |
|
| 272 |
| `perfumers` | Perfumer names and IDs | `Erwin Creed;p1;Olivier Creed;p2` |
|
| 273 |
| `description` | Fragrance description | HTML text |
|
| 274 |
|
| 275 |
+
#### Ratings & Votes (v3.0 Format: category:votes:percent)
|
| 276 |
| Field | Description | Format |
|
| 277 |
|-------|-------------|--------|
|
| 278 |
| `rating` | Average rating & vote count | `4.33;24561` |
|
| 279 |
+
| `appreciation` | Love/like/ok/dislike/hate | `love:5000:45.2;like:3000:27.1;...` |
|
| 280 |
+
| `price_value` | Price perception votes | `way_overpriced:6658:30;overpriced:2844:13;...` |
|
| 281 |
+
| `ownership` | Ownership status | `have_it:5282:52.82;had_it:1232:12.32;...` |
|
| 282 |
+
| `gender_votes` | Gender suitability votes | `female:149:2;unisex:866:10;male:7977:88` |
|
| 283 |
+
| `longevity` | Duration votes | `very_weak:784:5;weak:1459:10;moderate:5869:40;...` |
|
| 284 |
+
| `sillage` | Projection votes | `intimate:1816:12;moderate:8139:55;strong:4289:29;...` |
|
| 285 |
+
| `season` | Seasonal suitability | `winter:4439:44.39;spring:9760:97.60;...` |
|
| 286 |
+
| `time_of_day` | Day/night suitability | `day:10000:100;night:6893:68.93` |
|
| 287 |
|
| 288 |
#### Related Fragrances
|
| 289 |
| Field | Description | Format |
|
|
|
|
| 293 |
| `reminds_of` | Similar fragrances | Semicolon-separated PIDs |
|
| 294 |
| `also_like` | Recommended fragrances | Semicolon-separated PIDs |
|
| 295 |
|
| 296 |
+
#### New in v3.0
|
| 297 |
| Field | Description |
|
| 298 |
|-------|-------------|
|
| 299 |
+
| `reviews_count` | Total number of user reviews |
|
| 300 |
+
| `pros_cons` | AI-generated pros/cons summary with vote counts |
|
| 301 |
+
|
| 302 |
+
### notes.csv (11 fields) — NEW in v3.0
|
| 303 |
+
|
| 304 |
+
| Field | Description | Example |
|
| 305 |
+
|-------|-------------|---------|
|
| 306 |
+
| `id` | Unique note identifier | `n1` |
|
| 307 |
+
| `name` | Note name | `Lavender` |
|
| 308 |
+
| `url` | Fragrantica note page | URL |
|
| 309 |
+
| `latin_name` | Latin/scientific name | `Lavandula angustifolia` |
|
| 310 |
+
| `other_names` | Alternative names | `English Lavender, True Lavender` |
|
| 311 |
+
| `group` | Note category | `Flowers`, `Woods`, `Citrus` |
|
| 312 |
+
| `odor_profile` | Scent description | `Fresh, herbal, floral...` |
|
| 313 |
+
| `main_icon` | Primary icon image URL | URL |
|
| 314 |
+
| `alt_icons` | Alternative icons | Semicolon-separated URLs |
|
| 315 |
+
| `background` | Background/splash image | URL |
|
| 316 |
+
| `fragrance_count` | Number of fragrances | `12229` |
|
| 317 |
+
|
| 318 |
+
### accords.csv (5 fields) — NEW in v3.0
|
| 319 |
+
|
| 320 |
+
| Field | Description | Example |
|
| 321 |
+
|-------|-------------|---------|
|
| 322 |
+
| `id` | Unique accord identifier | `a1` |
|
| 323 |
+
| `name` | Accord name | `woody` |
|
| 324 |
+
| `bar_color` | Display bar color (hex) | `#774414` |
|
| 325 |
+
| `font_color` | Text color (hex) | `#FFFFFF` |
|
| 326 |
+
| `fragrance_count` | Number of fragrances | `45892` |
|
| 327 |
|
| 328 |
### brands.csv (10 fields)
|
| 329 |
|
|
|
|
| 356 |
| `perfumes_count` | Number of fragrances | `538` |
|
| 357 |
| `biography` | Biography | HTML text |
|
| 358 |
|
| 359 |
+
## Parsing Examples (v3.0)
|
| 360 |
|
| 361 |
+
### Parse v3.0 voting format
|
| 362 |
+
```python
|
| 363 |
+
def parse_votes(votes_str):
|
| 364 |
+
"""Parse v3.0 voting format: category:votes:percent"""
|
| 365 |
+
result = {}
|
| 366 |
+
for item in votes_str.split(';'):
|
| 367 |
+
parts = item.split(':')
|
| 368 |
+
if len(parts) >= 3:
|
| 369 |
+
result[parts[0]] = {
|
| 370 |
+
'votes': int(parts[1]),
|
| 371 |
+
'percent': float(parts[2])
|
| 372 |
+
}
|
| 373 |
+
return result
|
| 374 |
+
|
| 375 |
+
longevity = parse_votes(row['longevity'])
|
| 376 |
+
# {'very_weak': {'votes': 784, 'percent': 5.0}, 'weak': {...}, ...}
|
| 377 |
+
```
|
| 378 |
+
|
| 379 |
+
### Parse v3.0 accords format with join
|
| 380 |
+
```python
|
| 381 |
+
def parse_accords(accords_str, accords_df):
|
| 382 |
+
"""Parse v3.0 accords format: id:percent and join with reference"""
|
| 383 |
+
result = []
|
| 384 |
+
for item in accords_str.split(';'):
|
| 385 |
+
accord_id, percent = item.split(':')
|
| 386 |
+
accord_info = accords_df[accords_df['id'] == accord_id].iloc[0]
|
| 387 |
+
result.append({
|
| 388 |
+
'name': accord_info['name'],
|
| 389 |
+
'percent': int(percent),
|
| 390 |
+
'bar_color': accord_info['bar_color'],
|
| 391 |
+
'font_color': accord_info['font_color']
|
| 392 |
+
})
|
| 393 |
+
return result
|
| 394 |
+
```
|
| 395 |
+
|
| 396 |
+
### Parse notes pyramid with opacity/weight
|
| 397 |
+
```python
|
| 398 |
+
import re
|
| 399 |
|
| 400 |
+
def parse_notes_pyramid(pyramid_str):
|
| 401 |
+
"""Parse v3.0 notes pyramid with opacity and weight"""
|
| 402 |
+
result = {'top': [], 'middle': [], 'base': []}
|
| 403 |
+
for layer in ['top', 'middle', 'base']:
|
| 404 |
+
match = re.search(rf'{layer}\(([^)]+)\)', pyramid_str)
|
| 405 |
+
if match:
|
| 406 |
+
for note in match.group(1).split(';'):
|
| 407 |
+
parts = note.split(',')
|
| 408 |
+
result[layer].append({
|
| 409 |
+
'name': parts[0],
|
| 410 |
+
'id': parts[1] if len(parts) > 1 else None,
|
| 411 |
+
'url': parts[2] if len(parts) > 2 else None,
|
| 412 |
+
'opacity': float(parts[3]) if len(parts) > 3 else None,
|
| 413 |
+
'weight': float(parts[4]) if len(parts) > 4 else None
|
| 414 |
+
})
|
| 415 |
+
return result
|
| 416 |
+
```
|
| 417 |
|
| 418 |
## Use Cases
|
| 419 |
|
| 420 |
- **Recommendation Systems** — Build "if you like X, try Y" engines using accords, notes, and also_like data
|
| 421 |
- **Market Analysis** — Analyze trends by brand, country, year, or perfumer
|
| 422 |
+
- **NLP** — Process descriptions, odor profiles, and pros/cons data
|
| 423 |
- **Collection Apps** — Build fragrance tracking and discovery apps
|
| 424 |
- **E-commerce** — Enrich product catalogs with detailed fragrance data
|
| 425 |
+
- **Data Visualization** — Create accord charts with actual display colors from accords.csv
|
| 426 |
|
| 427 |
## File Format
|
| 428 |
|
|
|
|
| 430 |
- **Encoding**: UTF-8
|
| 431 |
- **Quote Character**: `"` (double quote)
|
| 432 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 433 |
## Links
|
| 434 |
|
| 435 |
- **Full Database**: [fragdb.net](https://fragdb.net)
|
|
|
|
| 438 |
|
| 439 |
## License
|
| 440 |
|
| 441 |
+
This sample is released under the **CC BY-NC 4.0 License**. Free for non-commercial use with attribution.
|
| 442 |
|
| 443 |
The full database requires a commercial license — see [fragdb.net](https://fragdb.net) for details.
|
| 444 |
|
|
|
|
| 446 |
|
| 447 |
```bibtex
|
| 448 |
@dataset{fragdb2026,
|
| 449 |
+
title={FragDB Fragrantica Fragrance Database},
|
| 450 |
author={FragDB},
|
| 451 |
year={2026},
|
| 452 |
+
version={3.0},
|
| 453 |
url={https://fragdb.net},
|
| 454 |
+
note={Sample dataset with 5 files, 67 fields}
|
| 455 |
}
|
| 456 |
```
|
accords.csv
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fab7b73d5da8832c0b978ae09dfbe0e7e9b285d69b40f925914cc432a1bdb6bb
|
| 3 |
+
size 371
|
brands.csv
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:160518d03bc64c57c2b9f635804064713fb5378e020f9f6663239a100e8c5328
|
| 3 |
+
size 25798
|
fragrance-database.py
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""FragDB Fragrance Database - Custom loading script for pipe-delimited CSV files."""
|
| 2 |
+
|
| 3 |
+
import csv
|
| 4 |
+
import datasets
|
| 5 |
+
|
| 6 |
+
_DESCRIPTION = """
|
| 7 |
+
FragDB is the most comprehensive structured fragrance database available.
|
| 8 |
+
This sample contains 10 fragrances with related brands and perfumers.
|
| 9 |
+
"""
|
| 10 |
+
|
| 11 |
+
_HOMEPAGE = "https://fragdb.net"
|
| 12 |
+
_LICENSE = "MIT"
|
| 13 |
+
|
| 14 |
+
_URLS = {
|
| 15 |
+
"fragrances": "fragrances.csv",
|
| 16 |
+
"brands": "brands.csv",
|
| 17 |
+
"perfumers": "perfumers.csv",
|
| 18 |
+
}
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
class FragranceDatabase(datasets.GeneratorBasedBuilder):
|
| 22 |
+
"""FragDB Fragrance Database."""
|
| 23 |
+
|
| 24 |
+
VERSION = datasets.Version("2.0.0")
|
| 25 |
+
|
| 26 |
+
BUILDER_CONFIGS = [
|
| 27 |
+
datasets.BuilderConfig(name="fragrances", version=VERSION, description="Fragrance data"),
|
| 28 |
+
datasets.BuilderConfig(name="brands", version=VERSION, description="Brand data"),
|
| 29 |
+
datasets.BuilderConfig(name="perfumers", version=VERSION, description="Perfumer data"),
|
| 30 |
+
datasets.BuilderConfig(name="all", version=VERSION, description="All tables"),
|
| 31 |
+
]
|
| 32 |
+
|
| 33 |
+
DEFAULT_CONFIG_NAME = "all"
|
| 34 |
+
|
| 35 |
+
def _info(self):
|
| 36 |
+
if self.config.name == "fragrances":
|
| 37 |
+
features = datasets.Features({
|
| 38 |
+
"pid": datasets.Value("int64"),
|
| 39 |
+
"url": datasets.Value("string"),
|
| 40 |
+
"brand": datasets.Value("string"),
|
| 41 |
+
"name": datasets.Value("string"),
|
| 42 |
+
"year": datasets.Value("int64"),
|
| 43 |
+
"gender": datasets.Value("string"),
|
| 44 |
+
"collection": datasets.Value("string"),
|
| 45 |
+
"main_photo": datasets.Value("string"),
|
| 46 |
+
"info_card": datasets.Value("string"),
|
| 47 |
+
"user_photoes": datasets.Value("string"),
|
| 48 |
+
"accords": datasets.Value("string"),
|
| 49 |
+
"notes_pyramid": datasets.Value("string"),
|
| 50 |
+
"perfumers": datasets.Value("string"),
|
| 51 |
+
"description": datasets.Value("string"),
|
| 52 |
+
"rating": datasets.Value("string"),
|
| 53 |
+
"appreciation": datasets.Value("string"),
|
| 54 |
+
"price_value": datasets.Value("string"),
|
| 55 |
+
"ownership": datasets.Value("string"),
|
| 56 |
+
"gender_votes": datasets.Value("string"),
|
| 57 |
+
"longevity": datasets.Value("string"),
|
| 58 |
+
"sillage": datasets.Value("string"),
|
| 59 |
+
"season": datasets.Value("string"),
|
| 60 |
+
"time_of_day": datasets.Value("string"),
|
| 61 |
+
"by_designer": datasets.Value("string"),
|
| 62 |
+
"in_collection": datasets.Value("string"),
|
| 63 |
+
"reminds_of": datasets.Value("string"),
|
| 64 |
+
"also_like": datasets.Value("string"),
|
| 65 |
+
"news_ids": datasets.Value("string"),
|
| 66 |
+
})
|
| 67 |
+
elif self.config.name == "brands":
|
| 68 |
+
features = datasets.Features({
|
| 69 |
+
"id": datasets.Value("string"),
|
| 70 |
+
"name": datasets.Value("string"),
|
| 71 |
+
"url": datasets.Value("string"),
|
| 72 |
+
"logo_url": datasets.Value("string"),
|
| 73 |
+
"country": datasets.Value("string"),
|
| 74 |
+
"main_activity": datasets.Value("string"),
|
| 75 |
+
"website": datasets.Value("string"),
|
| 76 |
+
"parent_company": datasets.Value("string"),
|
| 77 |
+
"description": datasets.Value("string"),
|
| 78 |
+
"brand_count": datasets.Value("int64"),
|
| 79 |
+
})
|
| 80 |
+
elif self.config.name == "perfumers":
|
| 81 |
+
features = datasets.Features({
|
| 82 |
+
"id": datasets.Value("string"),
|
| 83 |
+
"name": datasets.Value("string"),
|
| 84 |
+
"url": datasets.Value("string"),
|
| 85 |
+
"photo_url": datasets.Value("string"),
|
| 86 |
+
"status": datasets.Value("string"),
|
| 87 |
+
"company": datasets.Value("string"),
|
| 88 |
+
"also_worked": datasets.Value("string"),
|
| 89 |
+
"education": datasets.Value("string"),
|
| 90 |
+
"web": datasets.Value("string"),
|
| 91 |
+
"perfumes_count": datasets.Value("int64"),
|
| 92 |
+
"biography": datasets.Value("string"),
|
| 93 |
+
})
|
| 94 |
+
else: # all
|
| 95 |
+
features = datasets.Features({
|
| 96 |
+
"table": datasets.Value("string"),
|
| 97 |
+
"data": datasets.Value("string"),
|
| 98 |
+
})
|
| 99 |
+
|
| 100 |
+
return datasets.DatasetInfo(
|
| 101 |
+
description=_DESCRIPTION,
|
| 102 |
+
features=features,
|
| 103 |
+
homepage=_HOMEPAGE,
|
| 104 |
+
license=_LICENSE,
|
| 105 |
+
)
|
| 106 |
+
|
| 107 |
+
def _split_generators(self, dl_manager):
|
| 108 |
+
if self.config.name == "all":
|
| 109 |
+
return [
|
| 110 |
+
datasets.SplitGenerator(
|
| 111 |
+
name="fragrances",
|
| 112 |
+
gen_kwargs={"filepath": dl_manager.download_and_extract(_URLS["fragrances"]), "table": "fragrances"},
|
| 113 |
+
),
|
| 114 |
+
datasets.SplitGenerator(
|
| 115 |
+
name="brands",
|
| 116 |
+
gen_kwargs={"filepath": dl_manager.download_and_extract(_URLS["brands"]), "table": "brands"},
|
| 117 |
+
),
|
| 118 |
+
datasets.SplitGenerator(
|
| 119 |
+
name="perfumers",
|
| 120 |
+
gen_kwargs={"filepath": dl_manager.download_and_extract(_URLS["perfumers"]), "table": "perfumers"},
|
| 121 |
+
),
|
| 122 |
+
]
|
| 123 |
+
else:
|
| 124 |
+
return [
|
| 125 |
+
datasets.SplitGenerator(
|
| 126 |
+
name="train",
|
| 127 |
+
gen_kwargs={"filepath": dl_manager.download_and_extract(_URLS[self.config.name]), "table": self.config.name},
|
| 128 |
+
),
|
| 129 |
+
]
|
| 130 |
+
|
| 131 |
+
def _generate_examples(self, filepath, table):
|
| 132 |
+
with open(filepath, encoding="utf-8") as f:
|
| 133 |
+
reader = csv.DictReader(f, delimiter="|")
|
| 134 |
+
for idx, row in enumerate(reader):
|
| 135 |
+
# Convert numeric fields
|
| 136 |
+
if table == "fragrances":
|
| 137 |
+
row["pid"] = int(row["pid"]) if row.get("pid") else 0
|
| 138 |
+
row["year"] = int(row["year"]) if row.get("year") else 0
|
| 139 |
+
elif table == "brands":
|
| 140 |
+
row["brand_count"] = int(row["brand_count"]) if row.get("brand_count") else 0
|
| 141 |
+
elif table == "perfumers":
|
| 142 |
+
row["perfumes_count"] = int(row["perfumes_count"]) if row.get("perfumes_count") else 0
|
| 143 |
+
|
| 144 |
+
yield idx, row
|
fragrances.csv
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f51d270e428f11b52547a3f997bb22c46806d27ca7cbac348d79015df0e00eff
|
| 3 |
+
size 57398
|
notes.csv
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9d3ccb57d026ff71467eceff0329e8876f86a141858e487683b05c2137449b1a
|
| 3 |
+
size 4095
|
perfumers.csv
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1356f510e5d79bee2eb9a6e0cd194b7a331d6c11a47f8dab842b35567e76f251
|
| 3 |
+
size 21689
|