Views
No views yet
microsoft/deberta-v3-base specifically designed to classify marine incidents into 11 different categories. It was trained on the MAIB incident reports dataset and achieves high performance in maritime safety incident classification.| Metric | Score |
|---|---|
| Accuracy | 89.0% |
| Weighted F1-Score | 89.0% |
| Macro F1-Score | 70.2% |


baker-street/maib-incident-reports-5K dataset, which contains:1from transformers import pipeline
2
3# Load the model
4classifier = pipeline("text-classification",
5 model="your-username/maib-incident-classifier")
6
7# Classify an incident
8result = classifier("A crew member fell overboard from a motorboat")
9print(result)1from transformers import AutoTokenizer, AutoModelForSequenceClassification
2import torch
3
4# Load tokenizer and model
5tokenizer = AutoTokenizer.from_pretrained("your-username/maib-incident-classifier")
6model = AutoModelForSequenceClassification.from_pretrained("your-username/maib-incident-classifier")
7
8# Prepare input
9text = "Fire broke out in the engine room during routine maintenance"
10inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True)
11
12# Get predictions
13with torch.no_grad():
14 outputs = model(**inputs)
15 predictions = torch.nn.functional.softmax(outputs.logits, dim=-1)
16
17# Get class labels
18class_labels = [
19 "Accident to person(s)",
20 "Capsizing / Listing",
21 "Collision",
22 "Contact",
23 "Damage / Loss Of Equipment",
24 "Fire / Explosion",
25 "Flooding / Foundering",
26 "Grounding / Stranding",
27 "Hull Failure",
28 "Loss Of Control",
29 "Non-accidental Event"
30]
31
32# Get top prediction
33top_prediction = torch.argmax(predictions, dim=-1)
34print(f"Predicted class: {class_labels[top_prediction]}")
35print(f"Confidence: {predictions[0][top_prediction]:.3f}")1# Install the package
2pip install maib-incident-classifier
3
4# Run inference
5maib-inference --model_path your-username/maib-incident-classifier --text "Incident description"1@software{maib_classifier,
2 title={MAIB Incident Type Classifier},
3 author={Ilia Munaev},
4 year={2024},
5 url={https://huggingface.co/your-username/maib-incident-classifier}
6}