Text Classification
Transformers
Safetensors
Vietnamese
vnsabsa
feature-extraction
finance
custom_code
Instructions to use ptdat/vn-smartphone-absa with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ptdat/vn-smartphone-absa with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="ptdat/vn-smartphone-absa", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("ptdat/vn-smartphone-absa", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
| from transformers import PretrainedConfig | |
| class VnSmartphoneAbsaConfig(PretrainedConfig): | |
| model_type = "vnsabsa" | |
| def __init__( | |
| self, | |
| vocab_size: int = 5272, | |
| embed_dim: int = 768, | |
| num_heads: int = 8, | |
| num_encoders: int = 4, | |
| encoder_dropout: float = 0.1, | |
| fc_dropout: float =0.4, | |
| fc_hidden_size: int = 128, | |
| **kwargs | |
| ): | |
| super().__init__(**kwargs) | |
| self.vocab_size = vocab_size | |
| self.embed_dim = embed_dim | |
| self.num_heads = num_heads | |
| self.num_encoders = num_encoders | |
| self.encoder_dropout = encoder_dropout | |
| self.fc_dropout = fc_dropout | |
| self.fc_hidden_size = fc_hidden_size | |
| super().__init__(**kwargs) |