Icon

Zero Shot Text Classification with BERT

Zero Shot Text Classification

This example show how Zero Shot Classification node can be used in order to assign the user provided labels to the texts. No training is required to use Zero Shot classification model. User is only responsible to provide meaningful hypothesis and labels.

In this workflow we compare the predicted values with initial labels, however in practice Zero Shot classification is used in case when labeling the texts is very expensive. So this estimation is only done to demonstrate the performance of the model that has never been trained on the provided or similar data.

URL: Benchmarking Zero-shot Text Classification: Datasets, Evaluation and Entailment Approach https://arxiv.org/abs/1909.00161

1. Read a dataset of review sentences classified together with their classification (whether the review is positive or negative)

2. Assess what is the automatic classification that a BERT multi-language model gives to each review so then we can compare the real classification with the BERT prediction. NOTE: user needs to install the Redfield extensions

3. Inspect the accuracy, precision, and recall of using BERT for classification. 4. Export document predictions to excel (select "local)

Make predictions
Zero Shot Text Classifier
Select aBERT model
BERT Model Selector
Replace this nodewith your data(e.g., excel reader)
Table Creator
Scorer (JavaScript)
Export document predictions
Excel Writer

Nodes

Extensions

Links