--- pipeline_tag: text-classification license: apache-2.0 tags: - toxicity - toxic detection --- This ONNX model is a dynamic quantized for the original model: [https://huggingface.co/unitary/multilingual-toxic-xlm-roberta](https://huggingface.co/unitary/multilingual-toxic-xlm-roberta) ### Usage Using `pipeline` from the `optimum` library ``` from optimum.pipelines import pipeline as pipeline_onnx quantized_pipeline = pipeline_onnx( "text-classification", model="hoan/multilingual-toxic-xlm-roberta-dynamic-quantized", accelerator="ort", top_k=None) text = """Artificial intelligence (AI), frequently depicted in mainstream media as a harbinger of both groundbreaking innovation and understandable concern, has seamlessly permeated and embedded itself within a multitude of diverse sectors that constitute the intricate tapestry of our contemporary society. This relentless integration spans a wide spectrum, extending from the realms of healthcare, where AI is catalyzing transformative breakthroughs in disease diagnosis, treatment planning, and medical research, to the intricate domain of finance, where algorithms are reshaping the landscape of investment strategies, risk assessment, and market predictions.""" result = quantized_pipeline(text) ``` The result is: ``` [[{'label': 'LABEL_0', 'score': 0.20129913091659546}, {'label': 'LABEL_7', 'score': 0.15916699171066284}, {'label': 'LABEL_8', 'score': 0.11170786619186401}, {'label': 'LABEL_4', 'score': 0.08739417046308517}, {'label': 'LABEL_14', 'score': 0.07075755298137665}, {'label': 'LABEL_10', 'score': 0.06712991744279861}, {'label': 'LABEL_2', 'score': 0.06049202010035515}, {'label': 'LABEL_13', 'score': 0.05316930636763573}, {'label': 'LABEL_3', 'score': 0.04292014613747597}, {'label': 'LABEL_12', 'score': 0.041316740214824677}, {'label': 'LABEL_15', 'score': 0.026307238265872}, {'label': 'LABEL_9', 'score': 0.024316439405083656}, {'label': 'LABEL_11', 'score': 0.017735131084918976}, {'label': 'LABEL_5', 'score': 0.015682993456721306}, {'label': 'LABEL_6', 'score': 0.01122154202312231}, {'label': 'LABEL_1', 'score': 0.009382889606058598}]] ```