Upload classify_arxiv_to_lance.py with huggingface_hub
Browse files
classify_arxiv_to_lance.py
CHANGED
|
@@ -234,7 +234,8 @@ def prepare_incremental_data(
|
|
| 234 |
|
| 235 |
# Select only the columns we need (drop nested columns that cause issues)
|
| 236 |
columns_to_keep = ["id", "title", "abstract", "categories", "update_date", "authors"]
|
| 237 |
-
|
|
|
|
| 238 |
|
| 239 |
# Add formatted text column for classification
|
| 240 |
logger.info("Formatting text for classification...")
|
|
@@ -251,7 +252,7 @@ def prepare_incremental_data(
|
|
| 251 |
|
| 252 |
# Collect the data
|
| 253 |
logger.info("Collecting data...")
|
| 254 |
-
df = lf_formatted.collect(streaming
|
| 255 |
|
| 256 |
if df.height == 0:
|
| 257 |
logger.info("No papers to classify")
|
|
|
|
| 234 |
|
| 235 |
# Select only the columns we need (drop nested columns that cause issues)
|
| 236 |
columns_to_keep = ["id", "title", "abstract", "categories", "update_date", "authors"]
|
| 237 |
+
available_columns = lf_cs.collect_schema().names()
|
| 238 |
+
lf_selected = lf_cs.select([col for col in columns_to_keep if col in available_columns])
|
| 239 |
|
| 240 |
# Add formatted text column for classification
|
| 241 |
logger.info("Formatting text for classification...")
|
|
|
|
| 252 |
|
| 253 |
# Collect the data
|
| 254 |
logger.info("Collecting data...")
|
| 255 |
+
df = lf_formatted.collect(engine="streaming")
|
| 256 |
|
| 257 |
if df.height == 0:
|
| 258 |
logger.info("No papers to classify")
|