该模型是在未知数据集上对 neuralmind/bert-large-portuguese-cased 进行微调的版本。 它在评估集上取得了以下结果:
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/google-play-sentiment-analysis-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="text-classification", model=model_path, top_k=None, device=device)
sentences = ["I am not having a great day"]
model_outputs = classifier(sentences)
print(model_outputs[0])
end_time = time.time()
print(f"硬件环境:{device},推理执行时间:{end_time - start_time}秒")
if __name__ == "__main__":
main()需要更多信息
需要更多信息
需要更多信息
训练过程中使用了以下超参数:
| 训练损失 | 轮次 | 步数 | 验证损失 | 准确率 |
|---|---|---|---|---|
| 0.8207 | 1.0 | 1200 | 0.7830 | 0.6571 |