Spaces:
Runtime error
Runtime error
format code
Browse files
source/services/ner/train/train.py
CHANGED
@@ -10,9 +10,12 @@ from huggingface_hub import notebook_login
|
|
10 |
notebook_login()
|
11 |
|
12 |
"""
|
|
|
13 |
import datasets
|
14 |
import evaluate
|
15 |
import numpy as np
|
|
|
|
|
16 |
from transformers import Trainer, AutoModelForTokenClassification, TrainingArguments, DataCollatorForTokenClassification
|
17 |
|
18 |
dataset = datasets.load_dataset("json", data_files="data/ner_input_data/ner_dataset.json")
|
@@ -283,8 +286,6 @@ def postprocess(predictions, labels):
|
|
283 |
]
|
284 |
return true_labels, true_predictions
|
285 |
|
286 |
-
from tqdm.auto import tqdm
|
287 |
-
import torch
|
288 |
|
289 |
progress_bar = tqdm(range(num_training_steps))
|
290 |
|
|
|
10 |
notebook_login()
|
11 |
|
12 |
"""
|
13 |
+
import torch
|
14 |
import datasets
|
15 |
import evaluate
|
16 |
import numpy as np
|
17 |
+
from tqdm.auto import tqdm
|
18 |
+
|
19 |
from transformers import Trainer, AutoModelForTokenClassification, TrainingArguments, DataCollatorForTokenClassification
|
20 |
|
21 |
dataset = datasets.load_dataset("json", data_files="data/ner_input_data/ner_dataset.json")
|
|
|
286 |
]
|
287 |
return true_labels, true_predictions
|
288 |
|
|
|
|
|
289 |
|
290 |
progress_bar = tqdm(range(num_training_steps))
|
291 |
|