Russian Constructicon Classifier
A binary classification model for determining whether a Russian Constructicon pattern is present in a given text example. Fine-tuned from intfloat/multilingual-e5-large in two stages: first as a semantic model on Russian Constructicon data, then for binary classification.
Model Details
- Base model: intfloat/multilingual-e5-large
- Task: Binary text classification
- Language: Russian
- Training: Two-stage fine-tuning on Russian Constructicon data
Usage
Primary Usage (RusCxnPipe Library)
This model is designed for use with the RusCxnPipe library:
from ruscxnpipe import ConstructionClassifier
classifier = ConstructionClassifier(
model_name="Futyn-Maker/ruscxn-classifier"
)
# Classify candidates (output from semantic search)
queries = ["Петр так и замер."]
candidates = [[{"id": "pattern1", "pattern": "NP-Nom так и VP-Pfv"}]]
results = classifier.classify_candidates(queries, candidates)
print(results[0][0]['is_present']) # 1 if present, 0 if absent
Direct Usage
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
model = AutoModelForSequenceClassification.from_pretrained("Futyn-Maker/ruscxn-classifier")
tokenizer = AutoTokenizer.from_pretrained("Futyn-Maker/ruscxn-classifier")
# Format: "passage: [pattern][Sep]query: [example]"
text = "passage: NP-Nom так и VP-Pfv[Sep]query: Петр так и замер."
inputs = tokenizer(text, return_tensors="pt", truncation=True)
with torch.no_grad():
outputs = model(**inputs)
prediction = torch.softmax(outputs.logits, dim=-1)
is_present = torch.argmax(prediction, dim=-1).item()
print(f"Construction present: {is_present}") # 1 = present, 0 = absent
Input Format
The model expects input in the format: "passage: [pattern][Sep]query: [example]"
- query: The Russian text to analyze
- passage: The constructicon pattern to check for
Training
- Stage 1: Semantic embedding training on Russian Constructicon examples and patterns
- Stage 2: Binary classification fine-tuning to predict construction presence
Output
- Label 0: Construction is NOT present in the text
- Label 1: Construction IS present in the text
Framework Versions
- Transformers: 4.51.3
- PyTorch: 2.7.0+cu126
- Python: 3.10.12
- Downloads last month
- 26
Inference Providers
NEW
This model isn't deployed by any Inference Provider.
🙋
Ask for provider support
Model tree for Futyn-Maker/ruscxn-classifier
Base model
intfloat/multilingual-e5-large