Skip to main content

Module error_analysis

Module error_analysis 

Source
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§

EntityInfo
Entity information for error reports.
ErrorAnalyzer
Analyzer for NER prediction errors.
ErrorInstance
A specific error instance.
ErrorPattern
Common error pattern.
ErrorReport
Comprehensive error analysis report.
PredictedEntity
A predicted entity for error analysis.
TypeErrorStats
Error statistics for a specific entity type.

Enums§

ErrorCategory
Error category for NER analysis.