Added section to select appropriate transformer backbone in the sample notebook for text classifier
"cell_type": "markdown",
"metadata": {},
"source": [
- "`TextClassifier` model in `arcgis.learn.text` is built on top of [Hugging Face Transformer](https://huggingface.co/transformers/v3.0.2/index.html) library. The model training and inferencing workflow is similar to computer vision models in `arcgis.learn`. "
+ "`TextClassifier` model in `arcgis.learn.text` is built on top of [Hugging Face Transformer](https://huggingface.co/transformers/v3.0.2/index.html) library. The model training and inferencing workflow is similar to computer vision models in `arcgis.learn`. \n",
+ "\n",
+ "Run the command below to see what backbones are supported for the text classification task."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "['BERT', 'RoBERTa', 'DistilBERT', 'ALBERT', 'FlauBERT', 'CamemBERT', 'XLNet', 'XLM', 'XLM-RoBERTa', 'Bart', 'ELECTRA', 'Longformer', 'MobileBERT']\n"
+ ]
+ }
+ ],
+ "source": [
+ "print(TextClassifier.supported_backbones)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Call the model's `available_backbone_models()` method with the backbone name to get the available models for that backbone. The call to **available_backbone_models** method will list out only few of the available models for each backbone. Visit [this](https://huggingface.co/transformers/pretrained_models.html) link to get a complete list of models for each backbone."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "('xlm-roberta-base', 'xlm-roberta-large')\n"
+ ]
+ }
+ ],
+ "source": [
+ "print(TextClassifier.available_backbone_models(\"xlm-roberta\"))"
]
},
{
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
- "version": "3.6.10"
+ "version": "3.6.9"
}
},
"nbformat": 4,
