Spaces:
Sleeping
Sleeping
fix: prioritize extracted metadata over HF dataset fields to prevent mismatches
Browse files- src/bookDataService.js +3 -3
src/bookDataService.js
CHANGED
|
@@ -156,9 +156,9 @@ class HuggingFaceDatasetService {
|
|
| 156 |
// Try multiple metadata extraction approaches
|
| 157 |
const extractedMetadata = this.extractMetadata(originalText);
|
| 158 |
|
| 159 |
-
//
|
| 160 |
-
const title =
|
| 161 |
-
const author =
|
| 162 |
|
| 163 |
return {
|
| 164 |
id: rowData.id || Math.random().toString(36),
|
|
|
|
| 156 |
// Try multiple metadata extraction approaches
|
| 157 |
const extractedMetadata = this.extractMetadata(originalText);
|
| 158 |
|
| 159 |
+
// Prioritize extracted metadata over potentially incorrect HF dataset fields
|
| 160 |
+
const title = extractedMetadata.title || rowData.title || 'Classic Literature';
|
| 161 |
+
const author = extractedMetadata.author || rowData.author || 'Unknown Author';
|
| 162 |
|
| 163 |
return {
|
| 164 |
id: rowData.id || Math.random().toString(36),
|