Vietnamese-Sentiment-visobert

161.1K
34
514
Small context
96M
1 language
by
5CD-AI
Other
OTHER
Good
161K downloads
Production-ready
Edge AI:
Mobile
Laptop
Server
1GB+ RAM
Mobile
Laptop
Server
Quick Summary

--- language: - vi metrics: - accuracy - f1 tags: - sentiment-analysis - social-listening library_name: transformers ---

Device Compatibility

Mobile
4-6GB RAM
Laptop
16GB RAM
Server
GPU
Minimum Recommended
1GB+ RAM

Code Examples

Usage (HuggingFace Transformers)pythontransformers
from transformers import pipeline
model_path = '5CD-AI/Vietnamese-Sentiment-visobert'
sentiment_task = pipeline("sentiment-analysis", model=model_path, tokenizer=model_path)
sentiment_task("Miếng dán dễ xước , ko khít với dt 11 prm")
Usage (HuggingFace Transformers)pythontransformers
from transformers import pipeline
model_path = '5CD-AI/Vietnamese-Sentiment-visobert'
sentiment_task = pipeline("sentiment-analysis", model=model_path, tokenizer=model_path)
sentiment_task("Miếng dán dễ xước , ko khít với dt 11 prm")
Usage (HuggingFace Transformers)pythontransformers
from transformers import pipeline
model_path = '5CD-AI/Vietnamese-Sentiment-visobert'
sentiment_task = pipeline("sentiment-analysis", model=model_path, tokenizer=model_path)
sentiment_task("Miếng dán dễ xước , ko khít với dt 11 prm")
Usage (HuggingFace Transformers)pythontransformers
from transformers import pipeline
model_path = '5CD-AI/Vietnamese-Sentiment-visobert'
sentiment_task = pipeline("sentiment-analysis", model=model_path, tokenizer=model_path)
sentiment_task("Miếng dán dễ xước , ko khít với dt 11 prm")
Usage (HuggingFace Transformers)pythontransformers
from transformers import pipeline
model_path = '5CD-AI/Vietnamese-Sentiment-visobert'
sentiment_task = pipeline("sentiment-analysis", model=model_path, tokenizer=model_path)
sentiment_task("Miếng dán dễ xước , ko khít với dt 11 prm")
Usage (HuggingFace Transformers)pythontransformers
from transformers import pipeline
model_path = '5CD-AI/Vietnamese-Sentiment-visobert'
sentiment_task = pipeline("sentiment-analysis", model=model_path, tokenizer=model_path)
sentiment_task("Miếng dán dễ xước , ko khít với dt 11 prm")
Usage (HuggingFace Transformers)pythontransformers
from transformers import pipeline
model_path = '5CD-AI/Vietnamese-Sentiment-visobert'
sentiment_task = pipeline("sentiment-analysis", model=model_path, tokenizer=model_path)
sentiment_task("Miếng dán dễ xước , ko khít với dt 11 prm")
Usage (HuggingFace Transformers)pythontransformers
from transformers import pipeline
model_path = '5CD-AI/Vietnamese-Sentiment-visobert'
sentiment_task = pipeline("sentiment-analysis", model=model_path, tokenizer=model_path)
sentiment_task("Miếng dán dễ xước , ko khít với dt 11 prm")
Other examplestext
Sentence:  Đây là mô hình rất hay, đáp ứng tốt nhu cầu của nhiều doanh nghiệp Việt.
### Sentiment score ####
1) POS: 0.9995
2) NEG: 0.0003
3) NEU: 0.0003
Other examplestext
Sentence:  Đây là mô hình rất hay, đáp ứng tốt nhu cầu của nhiều doanh nghiệp Việt.
### Sentiment score ####
1) POS: 0.9995
2) NEG: 0.0003
3) NEU: 0.0003
Other examplestext
Sentence:  Đây là mô hình rất hay, đáp ứng tốt nhu cầu của nhiều doanh nghiệp Việt.
### Sentiment score ####
1) POS: 0.9995
2) NEG: 0.0003
3) NEU: 0.0003
Other examplestext
Sentence:  Đây là mô hình rất hay, đáp ứng tốt nhu cầu của nhiều doanh nghiệp Việt.
### Sentiment score ####
1) POS: 0.9995
2) NEG: 0.0003
3) NEU: 0.0003
Other examplestext
Sentence:  Đây là mô hình rất hay, đáp ứng tốt nhu cầu của nhiều doanh nghiệp Việt.
### Sentiment score ####
1) POS: 0.9995
2) NEG: 0.0003
3) NEU: 0.0003
Other examplestext
Sentence:  Đây là mô hình rất hay, đáp ứng tốt nhu cầu của nhiều doanh nghiệp Việt.
### Sentiment score ####
1) POS: 0.9995
2) NEG: 0.0003
3) NEU: 0.0003
Other examplestext
Sentence:  Đây là mô hình rất hay, đáp ứng tốt nhu cầu của nhiều doanh nghiệp Việt.
### Sentiment score ####
1) POS: 0.9995
2) NEG: 0.0003
3) NEU: 0.0003
Other examplestext
Sentence:  Đây là mô hình rất hay, đáp ứng tốt nhu cầu của nhiều doanh nghiệp Việt.
### Sentiment score ####
1) POS: 0.9995
2) NEG: 0.0003
3) NEU: 0.0003
Other examplestext
Sentence:  Qua vụ này thì uy tín của Trump càng lớn hơn nữa. Nhất là với hình ảnh đầy tính biểu tượng như trên.
### Sentiment score ####
1) POS: 0.9965
2) NEG: 0.0029
3) NEU: 0.0005
Other examplestext
Sentence:  Qua vụ này thì uy tín của Trump càng lớn hơn nữa. Nhất là với hình ảnh đầy tính biểu tượng như trên.
### Sentiment score ####
1) POS: 0.9965
2) NEG: 0.0029
3) NEU: 0.0005
Other examplestext
Sentence:  Qua vụ này thì uy tín của Trump càng lớn hơn nữa. Nhất là với hình ảnh đầy tính biểu tượng như trên.
### Sentiment score ####
1) POS: 0.9965
2) NEG: 0.0029
3) NEU: 0.0005
Other examplestext
Sentence:  Qua vụ này thì uy tín của Trump càng lớn hơn nữa. Nhất là với hình ảnh đầy tính biểu tượng như trên.
### Sentiment score ####
1) POS: 0.9965
2) NEG: 0.0029
3) NEU: 0.0005
Other examplestext
Sentence:  Qua vụ này thì uy tín của Trump càng lớn hơn nữa. Nhất là với hình ảnh đầy tính biểu tượng như trên.
### Sentiment score ####
1) POS: 0.9965
2) NEG: 0.0029
3) NEU: 0.0005
Other examplestext
Sentence:  Qua vụ này thì uy tín của Trump càng lớn hơn nữa. Nhất là với hình ảnh đầy tính biểu tượng như trên.
### Sentiment score ####
1) POS: 0.9965
2) NEG: 0.0029
3) NEU: 0.0005
Other examplestext
Sentence:  Qua vụ này thì uy tín của Trump càng lớn hơn nữa. Nhất là với hình ảnh đầy tính biểu tượng như trên.
### Sentiment score ####
1) POS: 0.9965
2) NEG: 0.0029
3) NEU: 0.0005
Other examplestext
Sentence:  Qua vụ này thì uy tín của Trump càng lớn hơn nữa. Nhất là với hình ảnh đầy tính biểu tượng như trên.
### Sentiment score ####
1) POS: 0.9965
2) NEG: 0.0029
3) NEU: 0.0005
Sentiment score ####pythontransformers
from transformers import AutoModelForSequenceClassification
from transformers import TFAutoModelForSequenceClassification
from transformers import AutoTokenizer, AutoConfig
import numpy as np
import torch

#### Load model
model_path = '5CD-AI/Vietnamese-Sentiment-visobert'
tokenizer = AutoTokenizer.from_pretrained(model_path)
config = AutoConfig.from_pretrained(model_path)
model = AutoModelForSequenceClassification.from_pretrained(model_path).to("cuda")

sentence = 'Cũng giống mấy khoá Youtube học cũng được'
print('Sentence: ', sentence)

input_ids = torch.tensor([tokenizer.encode(sentence)]).to("cuda")

with torch.no_grad():
    out = model(input_ids)
    scores = out.logits.softmax(dim=-1).cpu().numpy()[0]

# Print labels and scores
ranking = np.argsort(scores)
ranking = ranking[::-1]
print("### Sentiment score ####")
for i in range(scores.shape[0]):
    l = config.id2label[ranking[i]]
    s = scores[ranking[i]]
    print(f"{i+1}) {l}: {np.round(float(s), 4)}")
Sentiment score ####pythontransformers
from transformers import AutoModelForSequenceClassification
from transformers import TFAutoModelForSequenceClassification
from transformers import AutoTokenizer, AutoConfig
import numpy as np
import torch

#### Load model
model_path = '5CD-AI/Vietnamese-Sentiment-visobert'
tokenizer = AutoTokenizer.from_pretrained(model_path)
config = AutoConfig.from_pretrained(model_path)
model = AutoModelForSequenceClassification.from_pretrained(model_path).to("cuda")

sentence = 'Cũng giống mấy khoá Youtube học cũng được'
print('Sentence: ', sentence)

input_ids = torch.tensor([tokenizer.encode(sentence)]).to("cuda")

with torch.no_grad():
    out = model(input_ids)
    scores = out.logits.softmax(dim=-1).cpu().numpy()[0]

# Print labels and scores
ranking = np.argsort(scores)
ranking = ranking[::-1]
print("### Sentiment score ####")
for i in range(scores.shape[0]):
    l = config.id2label[ranking[i]]
    s = scores[ranking[i]]
    print(f"{i+1}) {l}: {np.round(float(s), 4)}")
Sentiment score ####pythontransformers
from transformers import AutoModelForSequenceClassification
from transformers import TFAutoModelForSequenceClassification
from transformers import AutoTokenizer, AutoConfig
import numpy as np
import torch

#### Load model
model_path = '5CD-AI/Vietnamese-Sentiment-visobert'
tokenizer = AutoTokenizer.from_pretrained(model_path)
config = AutoConfig.from_pretrained(model_path)
model = AutoModelForSequenceClassification.from_pretrained(model_path).to("cuda")

sentence = 'Cũng giống mấy khoá Youtube học cũng được'
print('Sentence: ', sentence)

input_ids = torch.tensor([tokenizer.encode(sentence)]).to("cuda")

with torch.no_grad():
    out = model(input_ids)
    scores = out.logits.softmax(dim=-1).cpu().numpy()[0]

# Print labels and scores
ranking = np.argsort(scores)
ranking = ranking[::-1]
print("### Sentiment score ####")
for i in range(scores.shape[0]):
    l = config.id2label[ranking[i]]
    s = scores[ranking[i]]
    print(f"{i+1}) {l}: {np.round(float(s), 4)}")
Sentiment score ####pythontransformers
from transformers import AutoModelForSequenceClassification
from transformers import TFAutoModelForSequenceClassification
from transformers import AutoTokenizer, AutoConfig
import numpy as np
import torch

#### Load model
model_path = '5CD-AI/Vietnamese-Sentiment-visobert'
tokenizer = AutoTokenizer.from_pretrained(model_path)
config = AutoConfig.from_pretrained(model_path)
model = AutoModelForSequenceClassification.from_pretrained(model_path).to("cuda")

sentence = 'Cũng giống mấy khoá Youtube học cũng được'
print('Sentence: ', sentence)

input_ids = torch.tensor([tokenizer.encode(sentence)]).to("cuda")

with torch.no_grad():
    out = model(input_ids)
    scores = out.logits.softmax(dim=-1).cpu().numpy()[0]

# Print labels and scores
ranking = np.argsort(scores)
ranking = ranking[::-1]
print("### Sentiment score ####")
for i in range(scores.shape[0]):
    l = config.id2label[ranking[i]]
    s = scores[ranking[i]]
    print(f"{i+1}) {l}: {np.round(float(s), 4)}")
Sentiment score ####pythontransformers
from transformers import AutoModelForSequenceClassification
from transformers import TFAutoModelForSequenceClassification
from transformers import AutoTokenizer, AutoConfig
import numpy as np
import torch

#### Load model
model_path = '5CD-AI/Vietnamese-Sentiment-visobert'
tokenizer = AutoTokenizer.from_pretrained(model_path)
config = AutoConfig.from_pretrained(model_path)
model = AutoModelForSequenceClassification.from_pretrained(model_path).to("cuda")

sentence = 'Cũng giống mấy khoá Youtube học cũng được'
print('Sentence: ', sentence)

input_ids = torch.tensor([tokenizer.encode(sentence)]).to("cuda")

with torch.no_grad():
    out = model(input_ids)
    scores = out.logits.softmax(dim=-1).cpu().numpy()[0]

# Print labels and scores
ranking = np.argsort(scores)
ranking = ranking[::-1]
print("### Sentiment score ####")
for i in range(scores.shape[0]):
    l = config.id2label[ranking[i]]
    s = scores[ranking[i]]
    print(f"{i+1}) {l}: {np.round(float(s), 4)}")
Sentiment score ####pythontransformers
from transformers import AutoModelForSequenceClassification
from transformers import TFAutoModelForSequenceClassification
from transformers import AutoTokenizer, AutoConfig
import numpy as np
import torch

#### Load model
model_path = '5CD-AI/Vietnamese-Sentiment-visobert'
tokenizer = AutoTokenizer.from_pretrained(model_path)
config = AutoConfig.from_pretrained(model_path)
model = AutoModelForSequenceClassification.from_pretrained(model_path).to("cuda")

sentence = 'Cũng giống mấy khoá Youtube học cũng được'
print('Sentence: ', sentence)

input_ids = torch.tensor([tokenizer.encode(sentence)]).to("cuda")

with torch.no_grad():
    out = model(input_ids)
    scores = out.logits.softmax(dim=-1).cpu().numpy()[0]

# Print labels and scores
ranking = np.argsort(scores)
ranking = ranking[::-1]
print("### Sentiment score ####")
for i in range(scores.shape[0]):
    l = config.id2label[ranking[i]]
    s = scores[ranking[i]]
    print(f"{i+1}) {l}: {np.round(float(s), 4)}")
Sentiment score ####pythontransformers
from transformers import AutoModelForSequenceClassification
from transformers import TFAutoModelForSequenceClassification
from transformers import AutoTokenizer, AutoConfig
import numpy as np
import torch

#### Load model
model_path = '5CD-AI/Vietnamese-Sentiment-visobert'
tokenizer = AutoTokenizer.from_pretrained(model_path)
config = AutoConfig.from_pretrained(model_path)
model = AutoModelForSequenceClassification.from_pretrained(model_path).to("cuda")

sentence = 'Cũng giống mấy khoá Youtube học cũng được'
print('Sentence: ', sentence)

input_ids = torch.tensor([tokenizer.encode(sentence)]).to("cuda")

with torch.no_grad():
    out = model(input_ids)
    scores = out.logits.softmax(dim=-1).cpu().numpy()[0]

# Print labels and scores
ranking = np.argsort(scores)
ranking = ranking[::-1]
print("### Sentiment score ####")
for i in range(scores.shape[0]):
    l = config.id2label[ranking[i]]
    s = scores[ranking[i]]
    print(f"{i+1}) {l}: {np.round(float(s), 4)}")
Sentiment score ####pythontransformers
from transformers import AutoModelForSequenceClassification
from transformers import TFAutoModelForSequenceClassification
from transformers import AutoTokenizer, AutoConfig
import numpy as np
import torch

#### Load model
model_path = '5CD-AI/Vietnamese-Sentiment-visobert'
tokenizer = AutoTokenizer.from_pretrained(model_path)
config = AutoConfig.from_pretrained(model_path)
model = AutoModelForSequenceClassification.from_pretrained(model_path).to("cuda")

sentence = 'Cũng giống mấy khoá Youtube học cũng được'
print('Sentence: ', sentence)

input_ids = torch.tensor([tokenizer.encode(sentence)]).to("cuda")

with torch.no_grad():
    out = model(input_ids)
    scores = out.logits.softmax(dim=-1).cpu().numpy()[0]

# Print labels and scores
ranking = np.argsort(scores)
ranking = ranking[::-1]
print("### Sentiment score ####")
for i in range(scores.shape[0]):
    l = config.id2label[ranking[i]]
    s = scores[ranking[i]]
    print(f"{i+1}) {l}: {np.round(float(s), 4)}")

Deploy This Model

Production-ready deployment in minutes

Together.ai

Instant API access to this model

Fastest API

Production-ready inference API. Start free, scale to millions.

Try Free API

Replicate

One-click model deployment

Easiest Setup

Run models in the cloud with simple API. No DevOps required.

Deploy Now

Disclosure: We may earn a commission from these partners. This helps keep LLMYourWay free.