visolex / phobert-v2-absa-restaurant

huggingface.co
Total runs: 51
24-hour runs: 3
7-day runs: -6
30-day runs: -64
Model's Last Updated: January 04 2026

Introduction of phobert-v2-absa-restaurant

Model Details of phobert-v2-absa-restaurant

phobert-v2-absa-restaurant: Aspect-based Sentiment Analysis for Vietnamese Reviews

This model is a fine-tuned version of vinai/phobert-base-v2 on the VLSP2018-ABSA-Restaurant dataset for aspect-based sentiment analysis in Vietnamese reviews.

Model Details
  • Base Model : vinai/phobert-base-v2
  • Description : PhoBERT-v2 (vinai/phobert-base) fine-tuned
  • Dataset : VLSP2018-ABSA-Restaurant
  • Fine-tuning Framework : HuggingFace Transformers
  • Task : Aspect-based Sentiment Classification (3 classes)
Hyperparameters
  • Batch size: 32
  • Learning rate: 3e-5
  • Epochs: 100
  • Max sequence length: 256
  • Weight decay: 0.01
  • Warmup steps: 500
  • Optimizer: AdamW
Dataset

Model was trained on VLSP2018 ABSA Restaurant dataset for aspect-based sentiment analysis.

Sentiment Labels:
  • 0 - Negative (Tiêu cực): Negative opinions
  • 1 - Neutral (Trung lập): Neutral, objective opinions
  • 2 - Positive (Tích cực): Positive opinions
Aspect Categories:

Model được train để phân tích sentiment cho các aspects sau:

  • AMBIENCE#GENERAL
  • DRINKS#PRICES
  • DRINKS#QUALITY
  • DRINKS#STYLE&OPTIONS
  • FOOD#PRICES
  • FOOD#QUALITY
  • FOOD#STYLE&OPTIONS
  • LOCATION#GENERAL
  • RESTAURANT#GENERAL
  • RESTAURANT#MISCELLANEOUS
  • RESTAURANT#PRICES
  • SERVICE#GENERAL
Evaluation Results

The model was evaluated on test set with the following metrics:

  • Accuracy : 0.8995
  • Macro-F1 : 0.6992
  • Weighted-F1 : 0.8244
  • Macro-Precision : 0.7928
  • Macro-Recall : 0.6332
Usage Example
import torch
from transformers import AutoTokenizer, AutoModel

# Load model and tokenizer
repo = "visolex/phobert-v2-absa-restaurant"
tokenizer = AutoTokenizer.from_pretrained(repo, trust_remote_code=True)
model = AutoModel.from_pretrained(repo, trust_remote_code=True)
model.eval()

# Aspect labels for VLSP2018-ABSA-Restaurant
aspect_labels = [
    "AMBIENCE#GENERAL",
    "DRINKS#PRICES",
    "DRINKS#QUALITY",
    "DRINKS#STYLE&OPTIONS",
    "FOOD#PRICES",
    "FOOD#QUALITY",
    "FOOD#STYLE&OPTIONS",
    "LOCATION#GENERAL",
    "RESTAURANT#GENERAL",
    "RESTAURANT#MISCELLANEOUS",
    "RESTAURANT#PRICES",
    "SERVICE#GENERAL"
]

# Sentiment labels
sentiment_labels = ["POSITIVE", "NEGATIVE", "NEUTRAL"]

# Example review text
text = "Nhà hàng có không gian đẹp, đồ ăn ngon nhưng giá hơi đắt."

# Tokenize
inputs = tokenizer(
    text,
    return_tensors="pt",
    padding=True,
    truncation=True,
    max_length=256
)
inputs.pop("token_type_ids", None)

# Predict
with torch.no_grad():
    outputs = model(**inputs)

# Get logits: shape [1, num_aspects, num_sentiments + 1]
logits = outputs.logits.squeeze(0)  # [num_aspects, num_sentiments + 1]
probs = torch.softmax(logits, dim=-1)

# Predict for each aspect
none_id = probs.size(-1) - 1  # Index of "none" class
results = []

for i, aspect in enumerate(aspect_labels):
    prob_i = probs[i]
    pred_id = int(prob_i.argmax().item())
    
    if pred_id != none_id and pred_id < len(sentiment_labels):
        score = prob_i[pred_id].item()
        if score >= 0.5:  # threshold
            results.append((aspect, sentiment_labels[pred_id].lower()))

print(f"Text: {text}")
print(f"Predicted aspects: {results}")
# Output example: [('aspects', 'positive'), ('aspects', 'positive'), ('aspects', 'negative')]
Citation

If you use this model, please cite:

@misc{visolex_absa_phobert_v2_absa_restaurant,
  title={PhoBERT-v2 (vinai/phobert-base) fine-tuned for Vietnamese Aspect-based Sentiment Analysis},
  author={ViSoLex Team},
  year={2025},
  url={https://huggingface.co/visolex/phobert-v2-absa-restaurant}
}
License

This model is released under the Apache-2.0 license.

Acknowledgments

Runs of visolex phobert-v2-absa-restaurant on huggingface.co

51
Total runs
3
24-hour runs
-1
3-day runs
-6
7-day runs
-64
30-day runs

More Information About phobert-v2-absa-restaurant huggingface.co Model

More phobert-v2-absa-restaurant license Visit here:

https://choosealicense.com/licenses/apache-2.0

phobert-v2-absa-restaurant huggingface.co

phobert-v2-absa-restaurant huggingface.co is an AI model on huggingface.co that provides phobert-v2-absa-restaurant's model effect (), which can be used instantly with this visolex phobert-v2-absa-restaurant model. huggingface.co supports a free trial of the phobert-v2-absa-restaurant model, and also provides paid use of the phobert-v2-absa-restaurant. Support call phobert-v2-absa-restaurant model through api, including Node.js, Python, http.

phobert-v2-absa-restaurant huggingface.co Url

https://huggingface.co/visolex/phobert-v2-absa-restaurant

visolex phobert-v2-absa-restaurant online free

phobert-v2-absa-restaurant huggingface.co is an online trial and call api platform, which integrates phobert-v2-absa-restaurant's modeling effects, including api services, and provides a free online trial of phobert-v2-absa-restaurant, you can try phobert-v2-absa-restaurant online for free by clicking the link below.

visolex phobert-v2-absa-restaurant online free url in huggingface.co:

https://huggingface.co/visolex/phobert-v2-absa-restaurant

phobert-v2-absa-restaurant install

phobert-v2-absa-restaurant is an open source model from GitHub that offers a free installation service, and any user can find phobert-v2-absa-restaurant on GitHub to install. At the same time, huggingface.co provides the effect of phobert-v2-absa-restaurant install, users can directly use phobert-v2-absa-restaurant installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

phobert-v2-absa-restaurant install url in huggingface.co:

https://huggingface.co/visolex/phobert-v2-absa-restaurant

Url of phobert-v2-absa-restaurant

phobert-v2-absa-restaurant huggingface.co Url

Provider of phobert-v2-absa-restaurant huggingface.co

visolex
ORGANIZATIONS

Other API from visolex

huggingface.co

Total runs: 80
Run Growth: 14
Growth Rate: 17.07%
Updated:January 05 2026
huggingface.co

Total runs: 49
Run Growth: -6
Growth Rate: -14.29%
Updated:January 05 2026
huggingface.co

Total runs: 45
Run Growth: 16
Growth Rate: 34.78%
Updated:January 05 2026
huggingface.co

Total runs: 33
Run Growth: 0
Growth Rate: 0.00%
Updated:January 05 2026
huggingface.co

Total runs: 22
Run Growth: 19
Growth Rate: 73.08%
Updated:January 05 2026
huggingface.co

Total runs: 17
Run Growth: -3
Growth Rate: -17.65%
Updated:June 20 2025
huggingface.co

Total runs: 14
Run Growth: -3
Growth Rate: -23.08%
Updated:January 05 2026
huggingface.co

Total runs: 7
Run Growth: -5
Growth Rate: -50.00%
Updated:January 05 2026
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:October 17 2025
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:October 29 2025