Skip to content

Latest commit

 

History

History

multilingual-minilmv2

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

multilingual-MiniLMv2

This multilingual model can perform natural language inference (NLI) on 100+ languages and is therefore also suitable for multilingual zero-shot classification.

input

A SENTENCE, CANDIDATE_LABELS and HYPOTHESIS_TEMPLATE.

output

Probability scores for each label.

Usage

Set the SENTENCE, CANDIDATE_LABELS and HYPOTHESIS_TEMPLATE as an argument.

$ python3 multilingual-minilmv2.py -s "今日、新しいiPhoneが発売されました" -c "スマートフォン, エンタメ, スポーツ" -t "This example is {}."
...
+ idx=0
  category=0[スマートフォン ]
  prob=0.8609882593154907
+ idx=1
  category=1[エンタメ ]
  prob=0.1195221021771431
+ idx=2
  category=2[スポーツ ]
  prob=0.019489625468850136

You can select a model from minilm_l6 | minilm_l12 by adding --arch (default: minilm_l12).

Reference

Framework

PyTorch

Model Format

ONNX opset = 14

Netron

minilm_l12.onnx
minilm_l6.onnx