Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
language:
|
| 4 |
+
- id
|
| 5 |
+
tags:
|
| 6 |
+
- nlp
|
| 7 |
+
- pytorch
|
| 8 |
+
- xlstm
|
| 9 |
+
- language-modeling
|
| 10 |
+
- aspect-based-sentiment-analysis
|
| 11 |
+
- sequence-labeling
|
| 12 |
+
- indonesian
|
| 13 |
+
pipeline_tag: token-classification
|
| 14 |
+
---
|
| 15 |
+
|
| 16 |
+
# Bi-xLSTM[7:1] for Indonesian End-to-End ABSA
|
| 17 |
+
|
| 18 |
+
This repository contains a Bi-xLSTM[7:1] model pretrained on large-scale Indonesian Wikipedia data and fine-tuned for Indonesian End-to-End Aspect-Based Sentiment Analysis (E2E-ABSA).
|
| 19 |
+
|
| 20 |
+
## Model Description
|
| 21 |
+
|
| 22 |
+
The model uses a bidirectional xLSTM-based architecture for contextual language modeling. It was first pretrained on Indonesian Wikipedia data using a forward and backward language modeling objective, then fine-tuned for E2E-ABSA using BIOES sentiment tagging and CRF decoding.
|
| 23 |
+
|
| 24 |
+
The final task is to extract aspect–sentiment pairs directly from Indonesian review text.
|
| 25 |
+
|
| 26 |
+
## Architecture
|
| 27 |
+
|
| 28 |
+
- Model: Bi-xLSTM[7:1]
|
| 29 |
+
- Pretraining objective: Bidirectional contextual language modeling
|
| 30 |
+
- Fine-tuning task: End-to-End Aspect-Based Sentiment Analysis
|
| 31 |
+
- Decoder: CRF
|
| 32 |
+
- Labeling scheme: BIOES with sentiment labels
|
| 33 |
+
- Framework: PyTorch
|
| 34 |
+
- Language: Indonesian
|
| 35 |
+
|
| 36 |
+
## Dataset
|
| 37 |
+
|
| 38 |
+
The model was pretrained using Indonesian Wikipedia data and fine-tuned on Indonesian review data for aspect-based sentiment analysis.
|
| 39 |
+
|
| 40 |
+
## Intended Use
|
| 41 |
+
|
| 42 |
+
This model is intended for research and academic purposes, especially for:
|
| 43 |
+
|
| 44 |
+
- Indonesian NLP
|
| 45 |
+
- Sequence labeling
|
| 46 |
+
- Aspect-Based Sentiment Analysis
|
| 47 |
+
- Contextual language modeling
|
| 48 |
+
- Comparison between xLSTM-based models and Transformer-based models
|
| 49 |
+
|
| 50 |
+
## Files
|
| 51 |
+
|
| 52 |
+
Recommended repository files:
|
| 53 |
+
|
| 54 |
+
- `checkpoint.pt` or `pytorch_model.bin`: trained model checkpoint
|
| 55 |
+
- `model.py`: Bi-xLSTM[7:1] model architecture
|
| 56 |
+
- `config.json`: model configuration
|
| 57 |
+
- `label2id.json`: label-to-index mapping
|
| 58 |
+
- `id2label.json`: index-to-label mapping
|
| 59 |
+
- `requirements.txt`: required Python libraries
|
| 60 |
+
- `inference_example.py`: example inference script
|
| 61 |
+
|
| 62 |
+
## Usage
|
| 63 |
+
|
| 64 |
+
This model uses a custom PyTorch architecture, so it is not directly loadable using `AutoModel.from_pretrained()` unless a custom Hugging Face Transformers wrapper is added.
|
| 65 |
+
|
| 66 |
+
Example loading format:
|
| 67 |
+
|
| 68 |
+
```python
|
| 69 |
+
import torch
|
| 70 |
+
from model import BiXLSTMCRF
|
| 71 |
+
|
| 72 |
+
checkpoint = torch.load("checkpoint.pt", map_location="cpu")
|
| 73 |
+
|
| 74 |
+
model = BiXLSTMCRF(**checkpoint["config"])
|
| 75 |
+
model.load_state_dict(checkpoint["model_state_dict"])
|
| 76 |
+
model.eval()
|