|
--- |
|
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 BertModel, 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 = BertModel.from_pretrained("indobenchmark/indobert-base-p1") |
|
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] |