Daimka commited on
Commit
d182f79
·
verified ·
1 Parent(s): 17818f1

Create train_ag_news.py

Browse files
Files changed (1) hide show
  1. train_ag_news.py +22 -0
train_ag_news.py ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Quick training script for AG News dataset
3
+ Usage: python train_ag_news.py
4
+ """
5
+ from train import train_model
6
+
7
+ if __name__ == '__main__':
8
+ train_model(
9
+ dataset_name='ag_news',
10
+ embedding_dim=128, # Balanced size
11
+ hidden_dim=192, # Same as emotion for consistency
12
+ num_layers=1, # Single layer for simple RNN
13
+ num_hidden_nodes=96, # Same as emotion for consistency
14
+ dropout=0.25, # Moderate dropout
15
+ batch_size=64, # Good batch size
16
+ max_length=50, # AG News works well with 50 tokens
17
+ learning_rate=0.001, # Slightly lower for stability
18
+ num_epochs=30, # Reasonable epochs
19
+ patience=7,
20
+ vocab_min_freq=5 # Higher threshold for formal news text
21
+ )
22
+