该模型是 bert-base-cased 在 conll2003 数据集上的微调版本。 它在评估集上取得了以下结果:
需要更多信息
from openmind import pipeline, is_torch_npu_available
from openmind import AutoTokenizer, AutoModelForCausalLM
from openmind_hub import snapshot_download
import torch.nn.functional as F
from torch import Tensor
import openmind
import torch
import argparse
import time
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument(
"--model_name_or_path",
type=str,
help="Path to model",
default="jeffding/bert-finetuned-ner-openmind",
)
args = parser.parse_args()
return args
def main():
args = parse_args()
model_path = args.model_name_or_path
if is_torch_npu_available():
device = "npu:0"
else:
device = "cpu"
start_time = time.time()
classifier = pipeline(task="token-classification", model=model_path, framework="pt", device=device)
output = classifier("Apple Inc. was founded on April 1, 1976, by Steve Jobs, Steve Wozniak, and Ronald Wayne in the garage of Steve Jobs childhood home in Los Altos, California. It was registered on January 3, 1977, initially named Apple Computer, but to commemorate its 30th anniversary and reflect the diversity of its products, the term computer was removed on January 9, 2015.")
print(output)
end_time = time.time()
print(f"硬件环境:{device},推理执行时间:{end_time - start_time}秒")
if __name__ == "__main__":
main()需要更多信息
需要更多信息
训练过程中使用了以下超参数:
| 训练损失 | 轮次 | 步数 | 验证损失 | 精确率 | 召回率 | F1值 | 准确率 |
|---|---|---|---|---|---|---|---|
| 0.0849 | 1.0 | 1756 | 0.0713 | 0.9144 | 0.9366 | 0.9253 | 0.9817 |
| 0.0359 | 2.0 | 3512 | 0.0658 | 0.9346 | 0.9500 | 0.9422 | 0.9860 |
| 0.0206 | 3.0 | 5268 | 0.0600 | 0.9355 | 0.9514 | 0.9433 | 0.9868 |