File size: 646 Bytes
b742813 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
---
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() |