模型:

akdeniz27/bert-base-turkish-cased-ner-quantized

英文

Turkish Named Entity Recognition (NER) 量化模型

这个模型是模型( https://akdeniz27/bert-base-turkish-cased-ner )的动态量化版本

如何使用:

# First install "optimum[onnxruntime]":
!pip install "optimum[onnxruntime]"

# and import "ORTModelForTokenClassification":
from transformers import AutoTokenizer, pipeline
from optimum.onnxruntime import ORTModelForTokenClassification

model = ORTModelForTokenClassification.from_pretrained("akdeniz27/bert-base-turkish-cased-ner-quantized", file_name="model_quantized.onnx")
tokenizer = AutoTokenizer.from_pretrained("akdeniz27/bert-base-turkish-cased-ner-quantized")
ner = pipeline('ner', model=model, tokenizer=tokenizer, aggregation_strategy="first")
ner("your text here")

请参考( https://github.com/akdeniz27/dynamic_quantization )获取量化的详细信息