Downloads · 30 days
11
23% of all-time downloads
Amit5674/hebrew-multilabel-correctness-error-detection-evidence-to-claim
hebrew-multilabel-correctness-error-detection-evidence-to-claim is a machine learning model from Amit5674. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
Fine-tuned dicta-il/neodictabert for multi-label error type classification in Hebrew. Identifies specific factual error types in corrupted claims using evidence sentences extracted from source articles via semantic si…
Downloads · 30 days
11
23% of all-time downloads
All-time downloads
48
Public
Parameters
363M
4.4 GB on disk
Likes
0
Public
Click a slice to open those files.
.pt2.9 GB · 50%
From the Hugging Face model README
Fine-tuned dicta-il/neodictabert for multi-label error type classification in Hebrew. Identifies specific factual error types in corrupted claims using evidence sentences extracted from source articles via semantic similarity.
Task: Multi-label error type classification (15-20 error types)
Language: Hebrew
Max Context: 512 tokens (evidence + claim)
Granularity: Sentence-level with article context
dicta-il/neodictabert[CLS] evidence_sentences [SEP] corrupted_claim [SEP]from transformers import AutoTokenizer, AutoModelForSequenceClassification import torch from sentence_transformers import SentenceTransformer import numpy as np
model_name = "Amit5674/hebrew-multilabel-evidence-correctness-error-detection" tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True) model = AutoModelForSequenceClassification.from_pretrained( model_name, trust_remote_code=True, problem_type="multi_label_classification" ) model.eval()
evidence_model = SentenceTransformer('sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2')
def extract_evidence(article: str, claim: str, top_k: int = 3, threshold: float = 0.5): """Extract top-k most similar sentences from article to the claim""" article_sentences = article.split('.') claim_embedding = evidence_model.encode(claim) article_embeddings = evidence_model.encode(article_sentences)
similarities = np.dot(article_embeddings, claim_embedding) / (
np.linalg.norm(article_embeddings, axis=1) * np.linalg.norm(claim_embedding)
)
top_indices = np.argsort(similarities)[-top_k:][::-1]
evidence_sentences = [article_sentences[i] for i in top_indices if similarities[i] >= threshold]
return ' '.join(evidence_sentences)
article = "ישראל התחילה בהרעשה רגע אחרי הפסקת האש. הממשלה הודיעה על צעדים חדשים." corrupted_claim = "ישראל התחילה להתרגש רגע אחרי הפסקת האש"
evidence = extract_evidence(article, corrupted_claim, top_k=3, threshold=0.5)
inputs = tokenizer( evidence, corrupted_claim, return_tensors="pt", padding="max_length", max_length=512, truncation=True )
with torch.no_grad(): outputs = model(**inputs) logits = outputs.logits[0] probs = torch.sigmoid(logits)
# Get predicted error types (threshold = 0.5)
predicted_indices = (probs > 0.5).nonzero(as_tuple=True)[0].tolist()
predicted_labels = [model.config.id2label[i] for i in predicted_indices]
# Get all scores
all_scores = {
model.config.id2label[i]: float(probs[i].item())
for i in range(model.config.num_labels)
}
print(f"Predicted error types: {predicted_labels}") print(f"All scores: {all_scores}")
["hebrew_root_pattern_confusion", "verb_gender_swap"])Hebrew-Specific:
hebrew_root_pattern_confusion, verb_gender_swap, noun_gender_swap, morphological_connective_confusion, construct_state_confusion, specificity_shift_errors, verb_tense_swapCross-Language:
entity_person_swap, entity_location_swap, entity_organization_swap, sentence_negation, number_swap, measure_unit_swap, temporal@misc{hebrew_evidence_multilabel_classifier, title={Hebrew Multi-Label Error Type Classifier with Evidence-Based Context}, author={Your Name}, year={2025}, publisher={Hugging Face} }