Skip to content

Commit 038b51a

Browse files
committed
updated readme
1 parent 8191412 commit 038b51a

File tree

6 files changed

+48
-16
lines changed

6 files changed

+48
-16
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,21 @@ The model is built on top of DistilBERT and has been adapted for question answer
4545
3. Answer Type: Linear layer to classify the type of answer
4646

4747
The model takes a question-answer pair as input, processes it through DistilBERT, and then uses these three linear layers to make predictions.
48+
49+
## Hyperparameters
50+
51+
Best performing configuration:
52+
- Learning rate: 0.00003882259533696199
53+
- Number of epochs: 2
54+
- Number of workers: 4
55+
- Random seed: 42
56+
- Weight decay: 0
57+
58+
## Model Performance
59+
60+
Final metrics achieved:
61+
- Precision: 0.6131
62+
- Recall: 0.4786
63+
- F1: 0.5376
64+
65+
For detailed training logs and complete output, refer to the output.log and output.log1 files generated during training.

__pycache__/data.cpython-39.pyc

-22 Bytes
Binary file not shown.

__pycache__/loss.cpython-39.pyc

0 Bytes
Binary file not shown.

__pycache__/train.cpython-39.pyc

586 Bytes
Binary file not shown.

output1.log

Lines changed: 15 additions & 1 deletion
Large diffs are not rendered by default.

train.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ def train(args, data, tokenizer, use_wandb=False):
283283
criterion=criterion,
284284
tokenizer=tokenizer,
285285
device=device,
286-
max_answer_length=30
286+
max_answer_length=100000000000
287287
)
288288

289289
# Print detailed metrics
@@ -299,21 +299,21 @@ def train(args, data, tokenizer, use_wandb=False):
299299
print(f"Recall: {eval_metrics['recall']:.4f}")
300300
print(f"F1: {eval_metrics['f1']:.4f}")
301301

302-
# print("\nDetailed Token Statistics:")
303-
# print(f"True Positives: {eval_metrics['true_positives']}")
304-
# print(f"False Positives: {eval_metrics['false_positives']}")
305-
# print(f"False Negatives: {eval_metrics['false_negatives']}")
302+
print("\nDetailed Token Statistics:")
303+
print(f"True Positives: {eval_metrics['true_positives']}")
304+
print(f"False Positives: {eval_metrics['false_positives']}")
305+
print(f"False Negatives: {eval_metrics['false_negatives']}")
306306

307-
# print("\nOverprediction Analysis:")
308-
# print(f"Total Questions: {eval_metrics['total_questions']}")
309-
# print(f"Overprediction Cases: {eval_metrics['overprediction_cases']}")
310-
# if eval_metrics['overprediction_cases'] > 0:
311-
# overpred_percentage = (eval_metrics['overprediction_cases'] / eval_metrics['total_questions']) * 100
312-
# print(f"Overprediction Percentage: {overpred_percentage:.1f}%")
313-
# print(f"Average Predicted Length: {eval_metrics['avg_overprediction_length']:.1f} tokens")
314-
# print(f"Average True Length: {eval_metrics['avg_true_length']:.1f} tokens")
315-
# avg_extra = eval_metrics['avg_overprediction_length'] - eval_metrics['avg_true_length']
316-
# print(f"Average Extra Tokens: {avg_extra:.1f}")
307+
print("\nOverprediction Analysis:")
308+
print(f"Total Questions: {eval_metrics['total_questions']}")
309+
print(f"Overprediction Cases: {eval_metrics['overprediction_cases']}")
310+
if eval_metrics['overprediction_cases'] > 0:
311+
overpred_percentage = (eval_metrics['overprediction_cases'] / eval_metrics['total_questions']) * 100
312+
print(f"Overprediction Percentage: {overpred_percentage:.1f}%")
313+
print(f"Average Predicted Length: {eval_metrics['avg_overprediction_length']:.1f} tokens")
314+
print(f"Average True Length: {eval_metrics['avg_true_length']:.1f} tokens")
315+
avg_extra = eval_metrics['avg_overprediction_length'] - eval_metrics['avg_true_length']
316+
print(f"Average Extra Tokens: {avg_extra:.1f}")
317317

318318
if use_wandb:
319319
wandb.log({

0 commit comments

Comments
 (0)