Skip to content

Latest commit

 

History

History
 
 

bert_zero_shot_classification

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Zero Shot Classification Using Bert

input

A SENTENCE, CANDIDATE_LABELS and HYPOTHESIS_TEMPLATE.

output

Positive or Negative

Usage

Set the SENTENCE, CANDIDATE_LABELS and HYPOTHESIS_TEMPLATE as an argument.

$ python3 bert_zero_shot_classification.py -s "Who are you voting for in 2020?" -c "economics, politics, public health" -t "This example is {}."
...
Sentence :  Who are you voting for in 2020?
Candidate Labels :  economics, politics, public health
Hypothesis Template :  This example is {}.
Label Id : 1
Label :  politics
Score :  0.96848875

Reference

transformers

onnx-transformers

Framework

PyTorch 1.6.0

Model Format

ONNX opset = 11

Netron