--- tags: - pytorch_model_hub_mixin - model_hub_mixin - indobert - indobenchmark - indonlu datasets: - fahrendrakhoirul/ecommerce-reviews-multilabel-dataset language: - id metrics: - f1 - recall - precision library_name: transformers pipeline_tag: text-classification --- How to import in PyTorch: ```python import torch.nn as nn from huggingface_hub import PyTorchModelHubMixin from transformers import AutoModelForSequenceClassification, AutoTokenizer class IndoBertEcommerceReview(nn.Module, PyTorchModelHubMixin): def __init__(self, bert): super().__init__() self.bert = bert self.sigmoid = nn.Sigmoid() def forward(self, input_ids, attention_mask): outputs = self.bert(input_ids=input_ids, attention_mask=attention_mask) logits = outputs.logits probabilities = self.sigmoid(logits) return probabilities bert = AutoModelForSequenceClassification.from_pretrained("indobenchmark/indobert-base-p1", num_labels=3, problem_type="multi_label_classification") tokenizer = BertTokenizer.from_pretrained("fahrendrakhoirul/indobert-finetuned-ecommerce-reviews") model = AutoModelForSequenceClassification.from_pretrained("fahrendrakhoirul/indobert-finetuned-ecommerce-reviews", bert=bert) ``` This model has been pushed to the Hub using the [PytorchModelHubMixin](https://huggingface.co/docs/huggingface_hub/package_reference/mixins#huggingface_hub.PyTorchModelHubMixin) integration: - Library: [More Information Needed] - Docs: [More Information Needed]