Update models/prediction_sinhala.py
Browse files
models/prediction_sinhala.py
CHANGED
|
@@ -183,7 +183,7 @@ from faknow.evaluate.evaluator import Evaluator
|
|
| 183 |
|
| 184 |
import torch
|
| 185 |
from torch.utils.data import DataLoader
|
| 186 |
-
testing_path = "/
|
| 187 |
|
| 188 |
df = pd.read_json(testing_path)
|
| 189 |
df.head()
|
|
@@ -191,11 +191,10 @@ df =df[:100]
|
|
| 191 |
df["label"] = int(0)
|
| 192 |
df.head()
|
| 193 |
print(len(df))
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
df.to_json(path + testing_json, orient='records')
|
| 197 |
|
| 198 |
-
MODEL_SAVE_PATH = "
|
| 199 |
|
| 200 |
max_len, bert = 160 , 'sinhala-nlp/sinbert-sold-si'
|
| 201 |
tokenizer = TokenizerFromPreTrained(max_len, bert)
|
|
|
|
| 183 |
|
| 184 |
import torch
|
| 185 |
from torch.utils.data import DataLoader
|
| 186 |
+
testing_path = "data/test_data.json"
|
| 187 |
|
| 188 |
df = pd.read_json(testing_path)
|
| 189 |
df.head()
|
|
|
|
| 191 |
df["label"] = int(0)
|
| 192 |
df.head()
|
| 193 |
print(len(df))
|
| 194 |
+
new_testing_json_path = "data/testing.json"
|
| 195 |
+
df.to_json(new_testing_json_path, orient='records')
|
|
|
|
| 196 |
|
| 197 |
+
MODEL_SAVE_PATH = "models/last-epoch-model-2024-03-08-15_34_03_6.pth"
|
| 198 |
|
| 199 |
max_len, bert = 160 , 'sinhala-nlp/sinbert-sold-si'
|
| 200 |
tokenizer = TokenizerFromPreTrained(max_len, bert)
|