Expand description
Error analysis for NER systems.
Categorizes and analyzes prediction errors to guide improvement efforts.
§Error Categories
- Boundary Errors: Correct type but wrong span
- Type Errors: Correct span but wrong type
- False Positives: Predicted entity that doesn’t exist
- False Negatives: Missed a real entity
§Example
use anno_eval::eval::error_analysis::{ErrorAnalyzer, PredictedEntity};
use anno_eval::eval::datasets::GoldEntity;
use anno::EntityType;
let analyzer = ErrorAnalyzer::default();
let predictions = vec![
PredictedEntity::new("John", "PER", 0, 4),
PredictedEntity::new("Google", "LOC", 14, 20), // Wrong type!
];
let gold = vec![
GoldEntity::with_span("John Smith", EntityType::Person, 0, 10), // Boundary error
GoldEntity::with_span("Google", EntityType::Organization, 14, 20), // Type error
];
let report = analyzer.analyze(&predictions, &gold);
println!("Boundary errors: {}", report.boundary_errors.len());
println!("Type errors: {}", report.type_errors.len());Structs§
- Entity
Info - Entity information for error reports.
- Error
Analyzer - Analyzer for NER prediction errors.
- Error
Instance - A specific error instance.
- Error
Pattern - Common error pattern.
- Error
Report - Comprehensive error analysis report.
- Predicted
Entity - A predicted entity for error analysis.
- Type
Error Stats - Error statistics for a specific entity type.
Enums§
- Error
Category - Error category for NER analysis.