Downloads · 30 days
32
0% of all-time downloads
mr4/bert-base-jp-sentiment-analysis
bert-base-jp-sentiment-analysis is a text classification model from mr4. Use it when you need a label for a piece of text. It is set up for transformers.
Mô hình có tác dụng xác định cảm xúc của đoạn văn. Sử dụng nhãn: "positive", "negative"
Downloads · 30 days
32
0% of all-time downloads
All-time downloads
16.4K
Public
Parameters
111M
890 MB on disk
Likes
1
Public
Click a slice to open those files.
.bin445 MB · 50%
How the weights are stored.
F32111M · 100%
From the Hugging Face model README
Mô hình có tác dụng xác định cảm xúc của đoạn văn. Sử dụng nhãn: "positive", "negative"
Ví dụ: 今日はいい天気ですね
negative: 6.001393558108248e-05
positive: 0.999940037727356
今日の食べ物はとてもつまらない
negative: 0.9999252557754517
positive: 7.470489799743518e-05
Mô hình được đạo tạo dựa trên cơ sở của model Base Japanese
Mô hình được đào tạo dựa trên dữ liệu được thu thập bởi TAKAHIRO KUBO (https://www.kaggle.com/datasets/takahirokubo0/chabsa) - có chỉnh sửa.
Chưa xác định
Chưa xác định
Đây là một open-source library, bạn có thể sử dụng nó với bất kì mục đích nào. Rất cảm ơn nếu bạn ghi nguồn khi sử dụng mô hình này (nếu không ghi cũng không sao).
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
import os
def clear():
os.system('clear')
checkpoint = "mr4/bert-base-jp-sentiment-analysis"
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
model = AutoModelForSequenceClassification.from_pretrained(checkpoint)
clear()
print("Ngày hôm nay của bạn thế nào?")
val = input("")
raw_inputs = [val]
inputs = tokenizer(raw_inputs, padding=True,
truncation=True, return_tensors="pt")
outputs = model(**inputs)
predictions = torch.nn.functional.softmax(outputs.logits, dim=-1)
clear()
print(">>>>>>>>>>>>>>>>>>>>>>>>>>")
for i, prediction in enumerate(predictions):
print(raw_inputs[i])
for j, value in enumerate(prediction):
print(
" " + model.config.id2label[j] + ": " + str(value.item()))
print("<<<<<<<<<<<<<<<<<<<<<<<<<<")
Mọi thông tin liên quan có thể liên hệ qua email: [email protected].