Pipeline Stages
This section documents all the available pipeline stages for processing documents.
Extraction Stage
Extracts content from various document formats.
ExtractionStep
Bases: PipelineStep
Source code in eve/steps/extraction/extract_step.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | |
execute(documents)
async
Execute text extraction on input files or documents.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_data
|
List of file paths or Document objects to extract text from |
required |
Returns:
| Type | Description |
|---|---|
List[Document]
|
List of Document objects with extracted text |
Source code in eve/steps/extraction/extract_step.py
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | |
Extractors
PDF Extractor
PdfExtractor
Source code in eve/steps/extraction/pdfs.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | |
extract_text()
async
Extract text from a single PDF file.
Returns:
| Type | Description |
|---|---|
Optional[Document]
|
Document object with extracted text if successful, None otherwise |
Source code in eve/steps/extraction/pdfs.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | |
HTML Extractor
HtmlExtractor
Source code in eve/steps/extraction/htmls.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | |
extract_text()
async
Extract text from a single HTML file.
Returns:
| Type | Description |
|---|---|
Optional[Document]
|
Document object with extracted text if successful, None otherwise |
Source code in eve/steps/extraction/htmls.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | |
XML Extractor
XmlExtractor
Source code in eve/steps/extraction/xmls.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | |
extract_text()
async
Extract text from a single XML file.
Returns:
| Type | Description |
|---|---|
Optional[Document]
|
Document object with extracted text if successful, None otherwise |
Source code in eve/steps/extraction/xmls.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | |
Markdown Extractor
MarkdownExtractor
Source code in eve/steps/extraction/markdown.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | |
extract_text()
async
Extract text from a single markdown file.
Returns:
| Type | Description |
|---|---|
Optional[Document]
|
Document object with extracted text if successful, None otherwise |
Source code in eve/steps/extraction/markdown.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | |
Deduplication Stage
Removes duplicate and near-duplicate documents.
DuplicationStep
Bases: PipelineStep
Source code in eve/steps/dedup/dedup_step.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | |
execute(documents)
async
Execute deduplication on input files or documents.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_data
|
List of file paths or Document objects to deduplicate |
required |
Returns:
| Type | Description |
|---|---|
List[Document]
|
List of Document objects with duplicates removed |
Source code in eve/steps/dedup/dedup_step.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | |
Deduplication Methods
Exact Duplicates
ExactDuplication
this class does exact duplication by -
- calculate size as a first filter to save computation.
- calcuates checksum and finds the duplicates.
Source code in eve/steps/dedup/exact_duplicates.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | |
find_duplicates()
async
Find duplicate files based on size and SHA-256 checksum.
Source code in eve/steps/dedup/exact_duplicates.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | |
MinHash LSH
Adjust NUM_PERM: Higher values increase accuracy but use more memory. Adjust THRESHOLD: Higher values find closer duplicates but may miss some. Adjust SHINGLE_SIZE: Larger shingles are more specific but increase computation.
LSH
Source code in eve/steps/dedup/minhash.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | |
create_shingles(text)
Create shingles (word n-grams) from text.
Source code in eve/steps/dedup/minhash.py
38 39 40 41 | |
find_duplicates()
Find near-duplicate documents using LSH.
Source code in eve/steps/dedup/minhash.py
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | |
Cleaning Stage
Cleans and improves document quality.
Comprehensive cleaning step that applies all data cleaning components.
CleaningStep
Bases: PipelineStep
Comprehensive cleaning step that applies multiple data cleaning components.
This step processes extracted text through various cleaning components to:
- Fix OCR-induced errors
- Remove OCR duplicates
- Apply Nougat corrections
- Apply rule-based corrections
- Remove Nougat artifacts
- Correct LaTeX syntax errors (optional)
Source code in eve/steps/cleaning/cleaning_step.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 | |
__init__(config)
Initialize the cleaning step with configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
dict
|
Configuration dictionary with component settings. Expected keys:
|
required |
Source code in eve/steps/cleaning/cleaning_step.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | |
execute(documents)
async
Execute the cleaning step on input data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
documents
|
List[Document]
|
List of Documents. |
required |
Returns:
| Type | Description |
|---|---|
List[Document]
|
List of cleaned Documents. |
Source code in eve/steps/cleaning/cleaning_step.py
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 | |
get_component_info()
Get information about enabled cleaning processors.
Returns:
| Type | Description |
|---|---|
dict
|
Dictionary with processor information. |
Source code in eve/steps/cleaning/cleaning_step.py
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 | |
Cleaning Components
Processors
Consolidated text processing components for the cleaning pipeline.
This module combines all the individual cleaning components into a unified structure for better organization and maintainability.
DuplicateRemovalProcessor
Bases: TextProcessor
Processor for removing OCR-induced duplicate text segments.
Source code in eve/steps/cleaning/processors.py
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 | |
__init__(threshold=0.99, min_words=2, debug=False)
Initialize the duplicate removal processor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
threshold
|
float
|
Similarity threshold for duplicates. |
0.99
|
min_words
|
int
|
Minimum words required for a unit to be processed. |
2
|
debug
|
bool
|
Enable debug output. |
False
|
Source code in eve/steps/cleaning/processors.py
97 98 99 100 101 102 103 104 105 106 107 108 109 110 | |
process(document)
async
Remove duplicate content from the document.
Source code in eve/steps/cleaning/processors.py
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 | |
LaTeXProcessor
Bases: TextProcessor
Processor for detecting and correcting LaTeX syntax errors.
Source code in eve/steps/cleaning/processors.py
303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 | |
__init__(debug=False, api_key=None, model='anthropic/claude-3-haiku')
Initialize the LaTeX processor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
debug
|
bool
|
Enable debug output. |
False
|
api_key
|
Optional[str]
|
OpenRouter API key. If None, will use OPENROUTER_API_KEY environment variable. |
None
|
model
|
str
|
OpenRouter model to use for corrections. |
'anthropic/claude-3-haiku'
|
Source code in eve/steps/cleaning/processors.py
306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 | |
process(document)
async
Process document to detect and correct LaTeX syntax errors.
Source code in eve/steps/cleaning/processors.py
434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 | |
NougatProcessor
Bases: TextProcessor
Processor for fixing Nougat-related issues and artifacts.
Source code in eve/steps/cleaning/processors.py
207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 | |
process(document)
async
Process Nougat-specific issues in the document.
Source code in eve/steps/cleaning/processors.py
210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 | |
OCRProcessor
Bases: TextProcessor
Processor for fixing OCR-induced text issues.
Source code in eve/steps/cleaning/processors.py
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | |
process(document)
async
Fix OCR issues in the document content.
Source code in eve/steps/cleaning/processors.py
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | |
RuleBasedProcessor
Bases: TextProcessor
Processor for applying rule-based text corrections.
Source code in eve/steps/cleaning/processors.py
258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 | |
process(document)
async
Apply rule-based corrections to the document.
Source code in eve/steps/cleaning/processors.py
261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 | |
TextProcessor
Bases: ABC
Abstract base class for text processing components.
Source code in eve/steps/cleaning/processors.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | |
__init__(debug=False)
Initialize the text processor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
debug
|
bool
|
Enable debug output. |
False
|
Source code in eve/steps/cleaning/processors.py
35 36 37 38 39 40 41 42 | |
process(document)
abstractmethod
async
Process a document and return the cleaned result.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
document
|
Document
|
The document to process. |
required |
Returns:
| Type | Description |
|---|---|
Document
|
Processed document. |
Source code in eve/steps/cleaning/processors.py
44 45 46 47 48 49 50 51 52 53 54 | |
Nougat Helpers
Copyright (c) Meta Platforms, Inc. and affiliates.
This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.
Script from here - https://github.com/facebookresearch/nougat/blob/main/nougat/postprocessing.py
get_slices(lines, clean_lines)
Get slices of potentially hallucinated reference sections.
Source code in eve/steps/cleaning/nougat_helpers.py
103 104 105 106 107 108 109 110 111 112 | |
markdown_compatible(s)
Make text compatible with Markdown formatting.
This function makes various text formatting adjustments to make it compatible with Markdown.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
s
|
str
|
The input text to be made Markdown-compatible. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The Markdown-compatible text. |
Source code in eve/steps/cleaning/nougat_helpers.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | |
postprocess(generation, markdown_fix=True)
Postprocess generated text or a list of generated texts.
This function can be used to perform postprocessing on generated text, such as fixing Markdown formatting.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
generation
|
Union[str, List[str]]
|
The generated text or a list of generated texts. |
required |
markdown_fix
|
bool
|
Whether to perform Markdown formatting fixes. Default is True. |
True
|
Returns:
| Type | Description |
|---|---|
Union[str, List[str]]
|
Union[str, List[str]]: The postprocessed text or list of postprocessed texts. |
Source code in eve/steps/cleaning/nougat_helpers.py
293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 | |
postprocess_single(generation, markdown_fix=True)
Postprocess a single generated text.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
generation
|
str
|
The generated text to be postprocessed. |
required |
markdown_fix
|
bool
|
Whether to perform Markdown formatting fixes. Default is True. |
True
|
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The postprocessed text. |
Source code in eve/steps/cleaning/nougat_helpers.py
152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 | |
remove_hallucinated_references(text)
Remove hallucinated or missing references from the text.
This function identifies and removes references that are marked as missing or hallucinated from the input text.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
The input text containing references. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The text with hallucinated references removed. |
Source code in eve/steps/cleaning/nougat_helpers.py
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 | |
remove_numbers(lines)
Remove number patterns from lines.
Source code in eve/steps/cleaning/nougat_helpers.py
93 94 95 96 97 98 99 100 | |
remove_slice_from_lines(lines, clean_lines, sli)
Remove slice from lines and return the removed text.
Source code in eve/steps/cleaning/nougat_helpers.py
115 116 117 118 | |
truncate_repetitions(generation, score_cutoff=0.5, min_len=30)
Truncate repetitions in the given generation.
This function identifies and truncates repetitive content in the text.
Source code in eve/steps/cleaning/nougat_helpers.py
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | |
PII Removal Stage
Removes personally identifiable information from documents.
PiiStep
Bases: PipelineStep
Source code in eve/steps/pii/pii_step.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | |
Metadata Extraction Stage
Extracts structured metadata from documents.
Metadata extraction step for the EVE pipeline.
MetadataStep
Bases: PipelineStep
Metadata extraction step that extracts metadata from PDF and HTML documents.
Source code in eve/steps/metadata/metadata_step.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 | |
__init__(config)
Initialize the metadata extraction step.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
dict
|
Configuration dictionary with options:
|
required |
Source code in eve/steps/metadata/metadata_step.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | |
execute(documents)
async
Execute metadata extraction on input documents.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
documents
|
List[Document]
|
List of Document objects to extract metadata from |
required |
Returns:
| Type | Description |
|---|---|
List[Document]
|
List of Document objects with metadata added |
Source code in eve/steps/metadata/metadata_step.py
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 | |
Metadata Extractors
HTML Metadata Extractor
HtmlMetadataExtractor
Metadata extractor for HTML files and web pages.
Source code in eve/steps/metadata/extractors/html_extractor.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 | |
__init__(debug=False)
Initialize the HTML metadata extractor.
The HTML extractor relies on regex patterns defined in eve.common.regex_patterns for parsing HTML content efficiently without requiring a full HTML parser.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
debug
|
bool
|
Enable debug logging for detailed extraction information |
False
|
Source code in eve/steps/metadata/extractors/html_extractor.py
13 14 15 16 17 18 19 20 21 22 23 24 | |
extract_metadata(document)
async
Extract metadata from an HTML document using multi-source approach.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
document
|
Document
|
HTML document to extract metadata from |
required |
Returns:
| Type | Description |
|---|---|
Optional[Dict[str, Any]]
|
Dictionary containing extracted metadata with fields: |
Optional[Dict[str, Any]]
|
|
Optional[Dict[str, Any]]
|
|
Optional[Dict[str, Any]]
|
|
Optional[Dict[str, Any]]
|
|
Optional[Dict[str, Any]]
|
|
Optional[Dict[str, Any]]
|
|
Optional[Dict[str, Any]]
|
|
Optional[Dict[str, Any]]
|
|
Optional[Dict[str, Any]]
|
Returns None if document format is invalid |
Source code in eve/steps/metadata/extractors/html_extractor.py
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 | |
PDF Metadata Extractor
PDF metadata extractor is a two stage process.
- Extract content using monkeyocr.
- Use crossref to extract metadata from the content.
PdfMetadataExtractor
Source code in eve/steps/metadata/extractors/pdf_extractor.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 | |
__init__(debug=False)
Initialize the PDF metadata extractor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
debug
|
bool
|
Enable debug logging for detailed extraction information |
False
|
Source code in eve/steps/metadata/extractors/pdf_extractor.py
25 26 27 28 29 30 31 32 33 | |
extract_metadata(document)
async
Extract metadata from a PDF document using crossref.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
document
|
Document
|
PDF document to extract metadata from |
required |
Returns:
| Type | Description |
|---|---|
Optional[Dict[str, Any]]
|
Dictionary containing extracted metadata with fields: |
Optional[Dict[str, Any]]
|
|
Optional[Dict[str, Any]]
|
|
Optional[Dict[str, Any]]
|
|
Optional[Dict[str, Any]]
|
|
Optional[Dict[str, Any]]
|
|
Optional[Dict[str, Any]]
|
|
Optional[Dict[str, Any]]
|
Returns None if document format is invalid |
Source code in eve/steps/metadata/extractors/pdf_extractor.py
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 | |
Export Stage
Saves processed documents to output formats.
ExportStep
Bases: PipelineStep
Source code in eve/steps/export/export_step.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | |
__init__(config, name='ExportStep')
Initialize the export step.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
dict
|
Configuration containing:
|
required |
name
|
str
|
Name for logging purposes |
'ExportStep'
|
Source code in eve/steps/export/export_step.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | |