done
Browse files
README.md
CHANGED
|
@@ -10,4 +10,56 @@ language:
|
|
| 10 |
metrics:
|
| 11 |
- accuracy
|
| 12 |
library_name: transformers
|
| 13 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
metrics:
|
| 11 |
- accuracy
|
| 12 |
library_name: transformers
|
| 13 |
+
---
|
| 14 |
+
# Model Card: BERT-based CEFR Classifier
|
| 15 |
+
|
| 16 |
+
## Overview
|
| 17 |
+
|
| 18 |
+
This repository contains a model trained to predict Common European Framework of Reference (CEFR) levels for a given text using a BERT-based model architecture. The model was fine-tuned on the CEFR dataset, and the `bert-base-...` pre-trained model was used as the base.
|
| 19 |
+
|
| 20 |
+
## Model Details
|
| 21 |
+
|
| 22 |
+
- Model architecture: BERT (base model: `bert-base-...`)
|
| 23 |
+
- Task: CEFR level prediction for text classification
|
| 24 |
+
- Training dataset: CEFR dataset
|
| 25 |
+
- Fine-tuning: Epochs, Loss, Accuracy, etc.
|
| 26 |
+
|
| 27 |
+
## Performance
|
| 28 |
+
|
| 29 |
+
The model's performance during training is summarized below:
|
| 30 |
+
|
| 31 |
+
| Epoch | Training Loss | Validation Loss | Accuracy |
|
| 32 |
+
|-------|---------------|-----------------|----------|
|
| 33 |
+
| 1 | 1.491800 | 1.319211 | 0.420690 |
|
| 34 |
+
| 2 | 1.238600 | 0.864768 | 0.700447 |
|
| 35 |
+
| 3 | 0.813200 | 0.538081 | 0.815057 |
|
| 36 |
+
|
| 37 |
+
Additional metrics:
|
| 38 |
+
|
| 39 |
+
- Training Loss: 1.1851
|
| 40 |
+
- Training Runtime: 7465.51 seconds
|
| 41 |
+
- Training Samples per Second: 7.633
|
| 42 |
+
- Total Floating Point Operations: 1.499392196785152e+16
|
| 43 |
+
|
| 44 |
+
## Usage
|
| 45 |
+
|
| 46 |
+
1. Install the required libraries by running `pip install transformers`.
|
| 47 |
+
2. Load the trained model and use it for CEFR level prediction.
|
| 48 |
+
|
| 49 |
+
|
| 50 |
+
from transformers import pipeline
|
| 51 |
+
|
| 52 |
+
# Load the model
|
| 53 |
+
model_name = "AbdulSami/bert-base-cased-cefr"
|
| 54 |
+
classifier = pipeline("text-classification", model=model_name)
|
| 55 |
+
|
| 56 |
+
# Text for prediction
|
| 57 |
+
text = "This is a sample text for CEFR classification."
|
| 58 |
+
|
| 59 |
+
# Predict CEFR level
|
| 60 |
+
predictions = classifier(text)
|
| 61 |
+
|
| 62 |
+
# Print the predictions
|
| 63 |
+
print(predictions)
|
| 64 |
+
|
| 65 |
+
|