File size: 2,717 Bytes
a43649e
1665a27
 
 
ad3ee8a
 
 
5424d1f
 
 
 
 
 
 
 
 
fe71522
a43649e
 
e5333ab
17fdcf7
 
e5333ab
17fdcf7
 
 
 
 
 
b2fdd5e
 
17fdcf7
 
 
ad3ee8a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fd4298f
 
ad3ee8a
 
1665a27
 
fe71522
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
---
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
---

**Title:** IndoBERT-EcommerceReview   
**Short Summary:**  
A fine-tuned IndoBERT model for multi-label classification of customer reviews in e-commerce, focusing on product quality, customer service, and shipping/delivery.  

**Detailed Description:**
Explain that the model is based on IndoBERT-base-p1, a pre-trained IndoBERT model specifically designed for Indonesian text.
Highlight that it's fine-tuned on a dataset of e-commerce reviews, allowing it to understand the nuances of customer sentiment in this domain.
Clearly define the three output classes and their corresponding labels:
- Produk (Product): Customer satisfaction with product quality, performance, and description accuracy.
- Layanan Pelanggan (Customer Service): Interaction with sellers, their responsiveness, and complaint handling.
- Pengiriman (Shipping/Delivery): Speed of delivery, item condition upon arrival, and timeliness.  

Optionally, provide brief examples of reviews that would fall into each category to further illustrate how the model interprets sentiment.

**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 = AutoTokenizer.from_pretrained("fahrendrakhoirul/indobert-finetuned-ecommerce-reviews")
model = IndoBertEcommerceReview.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]