pierreguillou/DocLayNet-base
Viewer • Updated • 8.06k • 695 • 19
How to use kaixkhazaki/multilingual-e5-doclaynet with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="kaixkhazaki/multilingual-e5-doclaynet") # Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("kaixkhazaki/multilingual-e5-doclaynet")
model = AutoModelForSequenceClassification.from_pretrained("kaixkhazaki/multilingual-e5-doclaynet")This model is a fine-tuned version of intfloat/multilingual-e5-large for document text classification based on the DocLayNet dataset.
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="kaixkhazaki/multilingual-e5-doclaynet")
prediction = pipe("This is some text from a financial report")
print(prediction)
{
'financial_reports': 0,
'government_tenders': 1,
'laws_and_regulations': 2,
'manuals': 3,
'patents': 4,
'scientific_articles': 5
}
Trained on single gpu for 2 epochs for apx. 20 minutes.
hyperparameters:
{
'batch_size': 8,
'num_epochs': 10,
'learning_rate': 2e-5,
'weight_decay': 0.01,
'warmup_ratio': 0.1,
'gradient_clip': 1.0,
'label_smoothing': 0.1,
'optimizer': 'AdamW',
'scheduler': 'cosine_with_warmup'
}
Base model
intfloat/multilingual-e5-large