File size: 1,181 Bytes
77fb120
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
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
"""
Módulo de extracción de eventos.

Contiene reglas y lógica para extraer tuplas 5W1H (Who, What, When, Where, Why, How)
a partir del texto procesado.

Incluye:
- ClassicExtractorV1: Extractor basado en reglas sintácticas (sin memoria)
- ClassicExtractorV2: Extractor con resolución de correferencias
- FineTunedExtractor: Extractor basado en LLM fine-tuned
- ZeroShotExtractor: Extractor zero-shot con LLM
- process_corpus: Función de procesamiento batch con checkpoints
"""

from .classic import ClassicExtractorV1, ClassicExtractorV2
from .batch_processor import (
    process_corpus,
    process_corpus_batched,
    extract_events_from_doc,
    parse_dbpedia_entities
)

from .extraction_rules import (
    extract_5w1h_rules, 
    get_full_text,
    extract_5w1h_with_offsets,
    extract_5w1h_from_document,
    get_subtree_span
)
from .fine_tuned import (
    FineTunedExtractor,
    build_prompt,
    build_prompt_few_shot,
    split_text_by_sentences_with_indices,
    parse_5w1h_from_chunk,
    parse_labeled_text_to_json
)
from .zero_shot import (
    ZeroShotExtractor,
    chunk_text_by_token_limit,
    extract_json_from_output,
    merge_chunk_annotations
)