--- language: en license: apache-2.0 library_name: transformers tags: - pharmacy - drug-classification - onnx --- # 药品分类模型(ONNX格式) ## 模型描述 BERT-base微调的药品分类模型,转换为ONNX格式 ## 使用方式 ```python from transformers import AutoTokenizer, pipeline from onnxruntime import InferenceSession tokenizer = AutoTokenizer.from_pretrained("您的用户名/模型名") session = InferenceSession("model.onnx") # 预处理 inputs = tokenizer("I have a headache", return_tensors="np") # 推理 outputs = session.run(None, dict(inputs)) predicted_id = outputs[0].argmax()