Views
No views yet
nlpaueb/bert-base-greek-uncased-v1 tokenizerDataCollatorWithPadding| Parameter | Value |
|---|---|
| Epochs | 5 |
| Per-device batch size | 32 |
| Learning rate | 5e-5 |
| LR scheduler | Linear with warmup |
| Warmup ratio | 0.1 |
| Precision | fp16 mixed precision |
| Evaluation strategy | Per epoch |
| Metric | Score |
|---|---|
| Macro-F1 | 0.51 |
| Accuracy | 0.66 |
1from transformers import AutoTokenizer, AutoModelForSequenceClassification
2import torch
3
4model_name = "anand095/greek-bert-5epoch-lr-5e-5-warmup"
5tokenizer = AutoTokenizer.from_pretrained(model_name)
6model = AutoModelForSequenceClassification.from_pretrained(model_name)
7
8text = "your ancient greek text here"
9inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=512)
10
11with torch.no_grad():
12 outputs = model(**inputs)
13 predicted_class = torch.argmax(outputs.logits, dim=1).item()
14
15print(f"Predicted location class: {predicted_class}")