mr4 commited on
Commit
fa12432
1 Parent(s): 1856586

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +91 -0
README.md ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - ja
4
+ library_name: transformers
5
+ pipeline_tag: text-classification
6
+ tags:
7
+ - sentiment
8
+ - analysis
9
+ - Japanses
10
+ ---
11
+
12
+ # Sentiment Analysis in Japanese - Phân tích cảm xúc trong tiếng Nhật
13
+ ## Bert phân tích cảm xúc
14
+
15
+
16
+ ## Model description
17
+
18
+ Mô hình có tác dụng xác định cảm xúc của đoạn văn.
19
+ Sử dụng nhãn: "positive", "negative"
20
+
21
+ Ví dụ:
22
+ 今日はいい天気ですね
23
+ ```text
24
+ negative: 6.001393558108248e-05
25
+ positive: 0.999940037727356
26
+ ```
27
+
28
+ 今日の食べ物はとてもつまらない
29
+ ```text
30
+ negative: 0.9999252557754517
31
+ positive: 7.470489799743518e-05
32
+ ```
33
+
34
+ ## Base model
35
+
36
+ Mô hình được đạo tạo dựa trên cơ sở của model Base Japanese
37
+
38
+ ## Training data
39
+
40
+ 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.
41
+
42
+ ## Model variations
43
+
44
+ Chưa xác định
45
+
46
+ ## Intended uses & limitations
47
+
48
+ Chưa xác định
49
+
50
+ ## License
51
+
52
+ Đâ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.
53
+ 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).
54
+
55
+ ### How to use
56
+
57
+ ```python
58
+ from transformers import AutoTokenizer, AutoModelForSequenceClassification
59
+ import torch
60
+ import os
61
+
62
+
63
+ def clear():
64
+ os.system('clear')
65
+
66
+
67
+ checkpoint = "mr4/bert-base-jp-sentiment-analysis"
68
+ tokenizer = AutoTokenizer.from_pretrained(checkpoint)
69
+ model = AutoModelForSequenceClassification.from_pretrained(checkpoint)
70
+ clear()
71
+ print("Ngày hôm nay của bạn thế nào?")
72
+ val = input("")
73
+ raw_inputs = [val]
74
+ inputs = tokenizer(raw_inputs, padding=True,
75
+ truncation=True, return_tensors="pt")
76
+ outputs = model(**inputs)
77
+ predictions = torch.nn.functional.softmax(outputs.logits, dim=-1)
78
+ clear()
79
+ print(">>>>>>>>>>>>>>>>>>>>>>>>>>")
80
+ for i, prediction in enumerate(predictions):
81
+ print(raw_inputs[i])
82
+ for j, value in enumerate(prediction):
83
+ print(
84
+ " " + model.config.id2label[j] + ": " + str(value.item()))
85
+ print("<<<<<<<<<<<<<<<<<<<<<<<<<<")
86
+
87
+ ```
88
+
89
+ ## Liên hệ
90
+
91
+ Mọi thông tin liên quan có thể liên hệ qua email: zZz4everzZz@live.co.uk.