C-BERT
Collection
2 items
•
Updated
A multi-task model to extract causal attribution from German texts.
| Task | Output Type | Labels / Classes |
|---|---|---|
| 1. Token Classification | Sequence Labeling (BIO) | 5 Span Labels (O, B-INDICATOR, I-INDICATOR, B-ENTITY, I-ENTITY) |
| 2. Relation Classification | Sentence-Pair Classification | 14 Relation Labels (e.g., MONO_POS_CAUSE, DIST_NEG_EFFECT, INTERDEPENDENCY, NO_RELATION) |
Find the custom library. Once installed, run inference like so:
from causalbert.infer import load_model, sentence_analysis
# NOTE: The model path accepts either a local directory or a Hugging Face Hub ID.
model, tokenizer, config, device = load_model("pdjohn/C-EBERT")
# Analyze a batch of sentences
sentences = ["Autoverkehr verursacht Bienensterben.", "Lärm ist der Grund für Stress."]
all_results = sentence_analysis(
model,
tokenizer,
config,
sentences,
batch_size=8
)
# The result is a list of dictionaries containing token_predictions and derived_relations.
print(all_results[0]['derived_relations'])
# Example Output:
# [(['Autoverkehr', 'verursacht'], ['Bienensterben']), {'label': 'MONO_POS_CAUSE', 'confidence': 0.954}]
Base model
EuroBERT/EuroBERT-610m