HoangVuSnape commited on
Commit
3e21a38
·
verified ·
1 Parent(s): 2b74a09

Add new SentenceTransformer model

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
1_Pooling/config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "word_embedding_dimension": 768,
3
+ "pooling_mode_cls_token": true,
4
+ "pooling_mode_mean_tokens": false,
5
+ "pooling_mode_max_tokens": false,
6
+ "pooling_mode_mean_sqrt_len_tokens": false,
7
+ "pooling_mode_weightedmean_tokens": false,
8
+ "pooling_mode_lasttoken": false,
9
+ "include_prompt": true
10
+ }
README.md ADDED
@@ -0,0 +1,1603 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - sentence-transformers
4
+ - sentence-similarity
5
+ - feature-extraction
6
+ - dense
7
+ - generated_from_trainer
8
+ - dataset_size:1472
9
+ - loss:MatryoshkaLoss
10
+ - loss:MultipleNegativesRankingLoss
11
+ base_model: dangvantuan/vietnamese-document-embedding
12
+ widget:
13
+ - source_sentence: Những điểm đặc biệt của chương trình học là gì?
14
+ sentences:
15
+ - 'Các phòng thí nghiệm này giúp sinh viên thực hành và nghiên cứu các phản ứng
16
+ hoá học, phân tích chất lượng sản phẩm và môi trường. CÁC ĐIỂM ĐẶC BIỆT
17
+
18
+
19
+ Chương trình học thực tiễn: Sinh viên có cơ hội tham gia các nghiên cứu thực tế
20
+ tại các phòng thí nghiệm của trường và các công ty, giúp họ phát triển các kỹ
21
+ năng thực hành và nghiên cứu hoá học. Môi trường học tập quốc tế: Sinh viên có
22
+ cơ hội tham gia các chương trình trao đổi sinh viên và hợp tác nghiên cứu với
23
+ các đối tác quốc tế trong lĩnh vực hoá học. Học bổng và cơ hội du học: Các chương
24
+ trình học bổng và cơ hội du học bậc thạc sĩ, tiến sĩ tại các trường đại học danh
25
+ tiếng trên thế giới. TRIỂN VỌNG NGHỀ NGHIỆP & CƠ HỘI VIỆC LÀM
26
+
27
+
28
+ Sinh viên tốt nghiệp ngành Hoá học có thể làm việc trong các lĩnh vực như:
29
+
30
+
31
+ Công nghiệp hoá chất và dược phẩm: Làm việc tại các công ty sản xuất hoá chất,
32
+ dược phẩm, sản xuất vật liệu và sản phẩm hoá học khác. Ngành thực phẩm và bảo
33
+ vệ môi trường: Nghiên cứu và phát triển các sản phẩm thực phẩm, phân tích chất
34
+ lượng thực phẩm, và xử lý chất thải hoá học trong công nghiệp.'
35
+ - 'Trường Đại học Ngoại Thương Cơ sở II
36
+
37
+
38
+ Tiếng Anh: Foreign Trade University Ho Chi Minh City Campus (FTU2) Trường Đại
39
+ học Ngoại Thương cơ sở II là cơ sở đào tạo phía Nam của Trường Đại học Ngoại thương
40
+ tại Hà Nội, đại học chuyên ngành kinh tế đầu ngành tại Việt Nam và thành viên
41
+ của Bộ Giáo dục và Đào tạo. Cơ sở này được thành lập dựa trên nhu cầu đào tạo
42
+ cán bộ trong lĩnh vực kinh tế và kinh doanh quốc tế tại các tỉnh thành phía Nam
43
+ trong giai đoạn hội nhập kinh tế quốc tế. Cơ sở được thành lập theo Quyết định
44
+ số 1485/GD-ĐT ngày 16/07/1993 của Bộ trưởng Bộ Giáo dục và Đào tạo Việt Nam. Tên
45
+ trường: Trường Đại học Ngoại thương (Cơ sở 2)
46
+
47
+
48
+ Tên tiếng Anh: Foreign Trade University (FTU)
49
+
50
+
51
+ Mã trường: NTS
52
+
53
+
54
+ Trực thuộc: Bộ Giáo dục và Đào tạo
55
+
56
+
57
+ Loại trường: Công lập
58
+
59
+
60
+ Loại hình đào tạo: Đại học – Sau đại học
61
+
62
+
63
+ Lĩnh vực: Kinh tế
64
+
65
+
66
+ Địa chỉ: Số 15 Đường D5, Khu Văn Thánh Bắc, Phường 25, Quận Bình Thạnh, TP Hồ
67
+ Chí Minh
68
+
69
+
70
+ Điện thoại:
71
+
72
+
73
+ Email:
74
+
75
+
76
+ Website: http://cs2.ftu.edu.vn/
77
+
78
+
79
+ Fanpage: https://www.facebook.com/ftu2hcmc/
80
+
81
+
82
+ Lịch sử
83
+
84
+
85
+ 1962
86
+
87
+
88
+ Ngày 20/06/1962, theo Quyết định của Thủ tướng Chính phủ, Khoa Quan hệ Quốc tế
89
+ tách khỏi Trường Đại học Kinh tế - Tài chính để thành lập Trường Cán bộ Ngoại
90
+ giao - Ngoại thương trực thuộc Bộ Ngoại giao. Trụ sở ban đầu được đặt tại làng
91
+ Láng, tỉnh Hà Đông (nay là phường Láng Thượng, Hà Nội). 1967
92
+
93
+
94
+ Ngày 05/08/1967, theo đề nghị của Bộ Ngoại giao và Bộ Ngoại thương, Thủ tướng
95
+ Phạm Văn Đồng đã ký Quyết định số 123/CP, chia tách Trường Cán bộ Ngoại giao -
96
+ Ngoại thương thành hai trường:
97
+
98
+
99
+ Trường Ngoại giao (nay là Học viện Ngoại giao) trực thuộc Bộ Ngoại giao. Trường
100
+ Ngoại thương thuộc Bộ Ngoại thương (nay là Bộ Công Thương). 1985
101
+
102
+
103
+ Trường Đại học Ngoại thương chuyển từ Bộ Ngoại thương sang trực thuộc Bộ Đại học
104
+ và Trung học Chuyên nghiệp (nay là Bộ Giáo dục và Đào tạo). 1993
105
+
106
+
107
+ Ngày 16/07/1993, xuất phát từ nhu cầu đào tạo cán bộ kinh tế và kinh doanh quốc
108
+ tế tại Thành phố Hồ Chí Minh và các tỉnh thành phía Nam, Cơ sở II Trường Đại học
109
+ Ngoại thương tại TP.'
110
+ - 'Điểm xét tuyển được làm tròn đến 02 chữ số thập phân. - Điểm xét tuyển được xác
111
+ định như sau (làm tròn đến 02 chữ số thập phân): Điểm xét tuyển = [(ĐM1*HS môn
112
+ 1+ ĐM2*HS môn 2 + ĐM3 * HS môn 3)*3]/(Tổng hệ số) + Điểm ưu tiên Khu vực + Điểm
113
+ ưu tiên đối tượng. (*) Điểm trúng tuyển ngành Luật, Luật kinh tế: tổ hợp Văn,
114
+ Sử, Địa cao hơn 1.5 điểm. (1) Ngành ngôn ngữ Anh, ngôn ngữ Trung Quốc, ngôn ngữ
115
+ Nhật, ngôn ngữ Hàn Quốc: Ngoại ngữ nhân hệ số 2. (2) Các ngành Khoa học máy tính,
116
+ Khoa học máy tính Chất lượng cao, Công nghệ thông tin, CTKT công trình xây dựng,
117
+ CNKT công trình xây dựng Chất lượng cao, Quản lý xây dựng: Toán nhân hệ số 2.
118
+ (3) Các ngành Chất lượng cao: Luật kinh tế, Ngôn ngữ Anh, Ngôn ngữ Trung Quốc,
119
+ Quản trị kinh doanh, Tài chính ngân hàng, Kế toán: Ngoại ngữ hệ số 2. VII.Điểm
120
+ chuẩn Trường ĐH Mở TP.HCM năm 2021 dựa vào kết quả học tập THPT(học bạ)
121
+
122
+
123
+ i.'
124
+ - source_sentence: Nguyên tắc xét tuyển của Trường được áp dụng như thế nào khi thí
125
+ sinh đăng ký nhiều nguyện vọng hoặc nhiều phương thức xét tuyển?
126
+ sentences:
127
+ - '4. Đối với phương thức kết hợp thi tuyển và xét tuyển
128
+
129
+
130
+ 4.1. Thí sinh dự xét tuyển ngành Giáo dục Mầm non trình độ đại học
131
+
132
+
133
+ Phải tham gia kỳ thi năng khiếu do Trường Đại học Sư phạm Thành phố Hồ Chí Minh
134
+ tổ chức và có kết quả đạt từ 5,0 điểm trở lên;
135
+
136
+
137
+ Đối với thí sinh xét tuyển sử dụng kết quả thi tốt nghiệp THPT năm 2024: ngưỡng
138
+ điểm đảm bảo chất lượng đầu vào, điều kiện nhận hồ sơ đăng ký xét tuyển được thông
139
+ báo chính thức sau khi Bộ Giáo dục và Đào tạo xác định ngưỡng đảm bảo chất lượng
140
+ đầu vào đại học (căn cứ kết quả kỳ thi tốt nghiệp THPT năm 2024). Đối với thí
141
+ sinh xét tuyển sử dụng kết quả học tập THPT: chỉ áp dụng đối với thí sinh tốt
142
+ nghiệp THPT năm 2024 đồng thời phải thỏa một trong hai điều kiện sau:
143
+
144
+
145
+ + Có học lực lớp 12 xếp loại giỏi;
146
+
147
+
148
+ + Có điểm xét tốt nghiệp THPT từ 8,0 trở lên. 4.2. Thí sinh dự xét tuyển ngành
149
+ Giáo dục Mầm non trình độ cao đẳng
150
+
151
+
152
+ Phải tham gia kỳ thi năng khiếu do Trường Đại học Sư phạm Thành phố Hồ Chí Minh
153
+ tổ chức và có kết quả đạt từ 5,0 điểm trở lên;
154
+
155
+
156
+ Đối với thí sinh xét tuyển sử dụng kết quả thi tốt nghiệp THPT năm 2024: ngưỡng
157
+ điểm đảm bảo chất lượng đầu vào, điều kiện nhận hồ sơ đăng ký xét tuyển được thông
158
+ báo chính thức sau khi Bộ Giáo dục và Đào tạo xác định ngưỡng đảm bảo chất lượng
159
+ đầu vào đại học (căn cứ kết quả kỳ thi tốt nghiệp THPT năm 2024). Đối với thí
160
+ sinh xét tuyển sử dụng kết quả học tập THPT: chỉ áp dụng đối với thí sinh tốt
161
+ nghiệp THPT năm 2024 đồng thời phải thỏa một trong hai điều kiện sau:
162
+
163
+
164
+ + Có học lực lớp 12 xếp loại khá;
165
+
166
+
167
+ + Có điểm xét tốt nghiệp THPT từ 6,5 trở lên. 4.3. Thí sinh dự xét tuyển ngành
168
+ Giáo dục Thể chất
169
+
170
+
171
+ Phải tham gia kỳ thi năng khiếu do Trường Đại học Sư phạm Thành phố Hồ Chí Minh
172
+ tổ chức và có kết quả đạt từ 5,0 điểm trở lên;
173
+
174
+
175
+ Đối với thí sinh xét tuyển sử dụng điểm thi tốt nghiệp THPT năm 2024: ngưỡng điểm
176
+ đảm bảo chất lượng đầu vào, điều kiện nhận hồ sơ đăng ký xét tuyển được thông
177
+ báo chính thức sau khi Bộ Giáo dục và Đào tạo xác định ngưỡng đảm bảo chất lượng
178
+ đầu vào đại học (căn cứ kết quả kỳ thi tốt nghiệp THPT năm 2024);
179
+
180
+
181
+ Đối với thí sinh xét tuyển sử dụng kết quả học tập THPT: chỉ áp dụng đối với thí
182
+ sinh tốt nghiệp THPT năm 2024 đồng thời thỏa thêm một trong các điều kiện sau:
183
+
184
+
185
+ + Có học lực lớp 12 xếp loại khá trở lên;
186
+
187
+
188
+ + Có điểm xét tốt nghiệp THPT từ 6,5 trở lên;
189
+
190
+
191
+ + Là vận động viên cấp 1, kiện tướng, vận động viên đã từng đoạt huy chương tại
192
+ Hội khỏe Phù Đổng, các giải trẻ quốc gia và quốc tế hoặc giải vô địch quốc gia
193
+ và quốc tế có điểm thi năng khiếu do trường tổ chức đạt loại xuất sắc (từ 9,0
194
+ trở lên theo thang điểm 10,0).'
195
+ - 'Danh mục các ngành điều kiện nộp hồ sơ xét tuyển (xem tại đây). Quy định chứng
196
+ chỉ tiếng Anh quốc tế tương đương (xem tại đây)
197
+
198
+
199
+ 6. Xét tuyển thẳng, ưu tiên xét tuyển theo Quy chế của Bộ GD&ĐT – Mã phương thức
200
+ 301: Thực hiện theo quy định của Bộ GD&ĐT
201
+
202
+
203
+ 7. Các lưu ý khi đăng ký NVXT và nguyên tắc xét tuyển trên hệ thống Bộ
204
+
205
+
206
+ a. Các lưu ý khi đăng ký NVXT
207
+
208
+
209
+ Thí sinh nên tra cứu thông tin các nguyện vọng đăng ký xét tuyển vào TDTU theo
210
+ phương thức riêng tại: https://tracuuxettuyen.tdtu.edu.vn trước khi đăng ký nguyện
211
+ vọng lên hệ thống của Bộ GD&ĐT. Số CMND/CCCD thí sinh đã đăng ký xét tuyển trên
212
+ hệ thống của TDTU; đăng ký phương thức 4 trên hệ thống của Đại học Quốc gia TP.HCM
213
+ phải trùng khớp với số CMND/CCCD sử dụng đăng ký tài khoản trên hệ thống của Bộ
214
+ GD&ĐT. Trường hợp thí sinh đã đăng ký số CMND/CCCD không trùng khớp nhau giữa
215
+ các hệ thống trên, thí sinh phải liên hệ với TDTU để được hỗ trợ cập nhật lại
216
+ số CMND/CCCD cho trùng khớp với hệ thống của Bộ trước khi đăng ký nguyện vọng.
217
+ Thí sinh sẽ không đủ điều kiện xét tuyển nếu không sử dụng cùng 1 số CMND/CCCD
218
+ đăng ký giữa các hệ thống trên. Thí sinh xét tuyển vào chương trình đại học bằng
219
+ tiếng Anh, chương trình liên kết quốc tế nhưng không nộp chứng chỉ tiếng Anh theo
220
+ quy định, không dự thi năng lực tiếng Anh hoặc dự thi năng lực tiếng Anh kết quả
221
+ không đạt nếu đủ điểm trúng tuyển sẽ trúng tuyển vào chương trình dự bị tiếng
222
+ Anh. Khi thí sinh làm thủ tục nhập học, Nhà trường sẽ tổ chức cho thí sinh thi
223
+ đánh giá năng lực tiếng Anh. Nếu kết quả thi đánh giá năng lực của thí sinh đạt
224
+ trình độ tiếng Anh theo yêu cầu của chương trình (B1 đối với chương trình đại
225
+ học bằng tiếng Anh, B2 đối với chương trình liên kết đào tạo quốc tế) sẽ được
226
+ nhập học vào chương trình chính thức. Trường hợp chưa đạt năng lực tiếng Anh đầu
227
+ vào, thí sinh sẽ học chương trình dự bị tiếng Anh. b. Nguyên tắc xét tuyển
228
+
229
+
230
+ Nếu một NVXT của thí sinh đăng ký vào Trường có chọn nhiều căn cứ xét tuyển và
231
+ tương ứng có nhiều phương thức xét tuyển (Phương thức 1, 2, 3, 4) thì Trường sẽ
232
+ thực hiện việc xét tuyển theo thứ tự ưu tiên lần lượt của các phương thức như
233
+ sau: Phương thức 1, Phương thức 3, Phương thức 4, Phương thức 2. Thí sinh có nhiều
234
+ NVXT đủ điều kiện trúng tuyển thì chỉ được công nhận trúng tuyển và gọi nhập học
235
+ theo nguyện vọng cao nhất.'
236
+ - 'Thí sinh có thể dự thi cả 2 đợt thi năng khiếu để dùng điểm cao nhất của 2 đợt
237
+ thi xét tuyển (đợt thi 1 dự kiến ngày 15-17/08/2021; đợt thi 2 dự kiến ngày 17-20/8/2021).
238
+ TDTU không nhận điểm thi năng khiếu của các Trường khác chuyển sang. Xem chi tiết
239
+ thông báo thi năng khiếu tại https://admission.tdtu.edu.vn
240
+
241
+
242
+ + Thí sinh thuộc đối tượng 2- đợt 2 xét tuyển vào chương trình đại học bằng tiếng
243
+ Anh phải có Chứng chỉ tiếng Anh quốc tế tương đương IELTS 5.0 trở lên (còn thời
244
+ hạn trong vòng 2 năm tính đến ngày 01/10/2021); Thí sinh không có chứng chỉ tiếng
245
+ Anh quốc tế tương đương IELTS 5.0 trở lên còn thời hạn theo quy định của TDTU
246
+ phải đăng ký dự thi Năng lực tiếng Anh do TDTU tổ chức (trừ ngành Ngôn ngữ Anh
247
+ chỉ nhận chứng chỉ tiếng Anh quốc tế theo quy định) tại website: https://thinangkhieu.tdtu.edu.vn.'
248
+ - source_sentence: Những đối tượng nào có thể đăng ký xét tuyển vào Đại học Sư phạm
249
+ Kỹ thuật TP.HCM và cần đáp ứng các điều kiện gì?
250
+ sentences:
251
+ - 'Hồ Chí Minh được thành lập theo Quyết định số 1485/GD-ĐT. Cơ sở vật chất
252
+
253
+
254
+ Địa chỉ: Số 15, Đường D5, Phường 25, Quận Bình Thạnh, TP. Hồ Chí Minh. Ban đầu,
255
+ do chưa có cơ sở vật chất riêng, Cơ sở II phải thuê cơ sở của Trường Cao đẳng
256
+ Kinh tế Đối ngoại. Qua thời gian, trường đã xây dựng được cơ sở mới đáp ứng nhu
257
+ cầu giảng dạy và học tập. Diện tích khuôn viên: Gần 5.000 m². Khu vực giảng dạy
258
+ chính: Sảnh A và sảnh B, đồng thời là nơi đặt trụ sở Ban Giám hiệu và các khoa,
259
+ phòng ban quản lý. Trang thiết bị: Nhiều phòng học và phòng chức năng được trang
260
+ bị hiện đại. Ngoài ra, trong khuôn viên còn có phân viện VJCC cơ sở TP. Hồ Chí
261
+ Minh, được hỗ trợ xây dựng bởi nguồn vốn từ Chính phủ Nhật Bản, tương tự như phân
262
+ viện tại Hà Nội. Cơ cấu tổ chức và đội ngũ cán bộ, giáo viên
263
+
264
+
265
+ Trong thời gian đầu mới th��nh lập, Cơ sở II chỉ có 02 cán bộ, và hầu hết các hoạt
266
+ động được chỉ đạo trực tiếp từ Cơ sở I tại Hà Nội. Tuy nhiên, với quy mô đào tạo
267
+ ngày càng tăng, Cơ sở II đã nhanh chóng củng cố cơ cấu tổ chức và đội ngũ cán
268
+ bộ, giáo viên. Hiện tại, Cơ sở II có hơn 100 cán bộ, giáo viên cơ hữu, công tác
269
+ tại 11 Ban và 05 Bộ môn. Các Ban
270
+
271
+
272
+ Ban Tổ chức - Hành chính
273
+
274
+
275
+ Ban Kế hoạch - Tài chính
276
+
277
+
278
+ Ban Quản lý đào tạo
279
+
280
+
281
+ Ban Công tác chính trị & Sinh viên
282
+
283
+
284
+ Ban Đào tạo quốc tế
285
+
286
+
287
+ Ban Quản trị thiết bị
288
+
289
+
290
+ Ban Quản lý Khoa học & Hợp tác quốc tế
291
+
292
+
293
+ Ban Khảo thí & Đảm bảo chất lượng
294
+
295
+
296
+ Ban Truyền thông & Quan hệ đối ngoại
297
+
298
+
299
+ Ban Thư viện
300
+
301
+
302
+ Ban Công tác Đảng & Đoàn thể
303
+
304
+
305
+ Các Bộ môn
306
+
307
+
308
+ Bộ môn Khoa học cơ bản
309
+
310
+
311
+ Bộ môn Kinh doanh & Thương mại quốc tế
312
+
313
+
314
+ Bộ môn Ngoại ngữ
315
+
316
+
317
+ Bộ môn Kinh tế - Luật
318
+
319
+
320
+ Bộ môn Quản trị kinh doanh & Tài chính - Kế toán'
321
+ - 'THÔNG TIN TUYỂN SINH Đại học Sư phạm Kỹ thuật TP.HCM
322
+
323
+
324
+ . Thông tin chung
325
+
326
+
327
+ 1. Thời gian xét tuyển
328
+
329
+
330
+ Theo lịch tuyển sinh chung của Bộ GD&ĐT và kế hoạch tuyển sinh của trường công
331
+ bố cụ thể trên website. 2. Đối tượng tuyển sinh
332
+
333
+
334
+ Thí sinh đã tốt nghiệp THPT. 3. Phạm vi tuyển sinh
335
+
336
+
337
+ Tuyển sinh trong cả nước. 4. Phương thức tuyển sinh
338
+
339
+
340
+ 4.1. Phương thức xét tuyển
341
+
342
+
343
+ Phương thức 1: Xét tuyển học bạ THPT. Phương thức 2: Xét tuyển thí sinh theo kết
344
+ quả điểm thi tốt nghiệp THPT năm 2024 theo các tổ hợp môn xét tuyển từng ngành
345
+ học. Phương thức 3: Xét tuyển thẳng, ưu tiên xét tuyển thẳng. 4.2. Ngưỡng đảm
346
+ bảo chất lượng đầu vào, điều kiện nhận ĐKXT
347
+
348
+
349
+ Phương thức xét tuyển bằng điểm thi THPT 2024: thí sinh phải tốt nghiệp THPT và
350
+ thỏa điều kiện ngưỡng đảm bảo chất lượng đầu vào của Trường. Thông báo ngưỡng
351
+ đảm bảo sau khi thí sinh có kết quả thi THPT. Phương thức xét tuyển bằng học bạ
352
+ THPT tốt nghiệp (tốt nghiệp THPT 2024): thí sinh tốt nghiệp THPT và điểm trung
353
+ bình học bạ mỗi môn học theo tổ hợp đăng ký xét tuyển từ 5,0 trở lên. Hồi đồng
354
+ thi tuyển uy quyền cho những thành viên thường trực Hội đồng tuyển sinh quyết
355
+ định điểm trúng tuyển các phương thức xét. Điềm chuẩn ngành Sư phạm tiếng Anh
356
+ theo các phương thức xét tuyển sớm sẽ được điều chỉnh khi có chỉ tiêu được giao
357
+ của Bộ GD&ĐT. 4.3.'
358
+ - '4. CÁC NGÀNH ĐÀO TẠO
359
+
360
+
361
+ a. ĐẠI HỌC
362
+
363
+
364
+ Cử nhân Sư phạm Tin học
365
+
366
+
367
+ Cử nhân Công nghệ Thông tin
368
+
369
+
370
+ b. SAU ĐẠI HỌC
371
+
372
+
373
+ Thạc sĩ Khoa học máy tính
374
+
375
+
376
+ vii. Khoa Vật lý
377
+
378
+
379
+ 1. CHẤT LƯỢNG ĐÀO TẠO
380
+
381
+
382
+ ĐÀO TẠO CỬ NHÂN (4 NĂM)
383
+
384
+
385
+ CN Sư phạm Vật lý, CN Vật lý học
386
+
387
+
388
+ CN Sư phạm Công nghệ
389
+
390
+
391
+ TUYỂN SINH: 100 - 150 SV
392
+
393
+
394
+ ĐÀO TẠO CAO HỌC (2 NĂM)
395
+
396
+
397
+ Bắt đầu đào tạo Thạc sĩ từ 1999
398
+
399
+
400
+ ThS Lý luận và phương pháp dạy học bộ môn Vật lý
401
+
402
+
403
+ ThS Vật Lý Nguyên tử và hạt nhân
404
+
405
+
406
+ TUYỂN SINH: 15 - 25 HV/năm
407
+
408
+
409
+ 2. CHẤT LƯỢNG GIẢNG VIÊN
410
+
411
+
412
+ ĐỘI NGŨ GIẢNG VIÊN: 35
413
+
414
+
415
+ Giảng viên: 35
416
+
417
+
418
+ Giáo sư : 1
419
+
420
+
421
+ Phó Giáo sư Tiến sĩ: 4
422
+
423
+
424
+ Tiến sĩ: 17
425
+
426
+
427
+ Thạc sĩ: 10
428
+
429
+
430
+ Cử nhân: 3
431
+
432
+
433
+ 3. MỤC TIÊU ĐÀO TẠO
434
+
435
+
436
+ Đào tạo cử nhân Vật lý học, có phẩm chất chính trị, đạo đức và sức khỏe tốt, hiểu
437
+ và vận dụng các tri thức cơ bản của Vật lý học theo định hướng chuyên ngành. Sau
438
+ khi tốt nghiệp, người học có đủ năng lực để làm việc trong môi trường nghiên cứu,
439
+ sản xuất kinh doanh có sử dụng kiến thức Vật lý học cũng như có thể tiếp tục theo
440
+ các bậc học cao hơn. Đào tạo giáo viên có trình độ cử nhân Sư phạm Vật lý (hệ
441
+ chính quy, chính quy địa phương, hệ chuyên tu, tại chức). Sau khi tốt nghiệp,
442
+ người học có phẩm chất chính trị, đạo đức và sức khỏe tốt, hiểu và vận dụng các
443
+ tri thức cơ bản của Vật lý học, lý luận và phương pháp giảng dạy Vật lý ở trường
444
+ trung học. Đào tạo giáo viên dạy Công nghệ bậc Trung học cơ sở và Trung học phổ
445
+ thông. Sau khi tốt nghiệp, người học có phẩm chất chính trị, đạo đ��c và sức khỏe
446
+ tốt, hiểu và vận dụng các tri thức khoa học, công nghệ nền tảng vào trong dạy
447
+ học môn Công nghệ ở trường phổ thông. Sau khi tốt nghiệp, người học có đủ năng
448
+ lực để làm việc trong môi trường nghiên cứu, sản xuất kinh doanh có sử dụng kiến
449
+ thức khoa học, công nghệ cũng như có thể tiếp tục theo các bậc học cao hơn.'
450
+ - source_sentence: Quá trình hình thành và phát triển của Đại học Kinh tế Thành phố
451
+ Hồ Chí Minh diễn ra như thế nào?
452
+ sentences:
453
+ - '1. Điểm trúng tuyển
454
+
455
+
456
+ Phương thức xét tuyển theo kết quả học tập THPT – Đợt 2 (PT1-Đ2), ưu tiên xét
457
+ tuyển theo quy định của TDTU dành cho học sinh trường chuyên trên cả nước và một
458
+ số trường trọng điểm ở TP.HCM – Đợt 2 (PT3-ĐT1-Đ2); ưu tiên xét tuyển theo quy
459
+ định của TDTU dành cho học sinh có chứng chỉ tiếng Anh quốc tế tương đương IELTS
460
+ 5.0 trở lên – Đợt 2 (PT3-ĐT2-Đ2): Điểm xét tuyển được thực hiện theo đúng đề án
461
+ tuyển sinh đại học năm 2022, thang điểm 40 và được làm tròn đến 02 chữ số thập
462
+ phân (đã bao gồm điểm ưu tiên khu vực, đối tượng, hệ số trường THPT, điểm ưu tiên
463
+ thành tích học sinh giỏi). Phương thức xét tuyển theo điểm thi THPT năm 2022 (PT2):
464
+ Điểm xét tuyển được thực hiện theo đúng đề án tuyển sinh đại học năm 2022, là
465
+ tổng điểm của 3 môn theo tổ hợp (có nhân hệ số môn theo tổ hợp, ngành xét
466
+ tuyển theo thang điểm 40), cộng với điểm ưu tiên khu vực, đối tượng theo thang
467
+ điểm 40 (nếu có), được làm tròn đến 2 chữ số thập phân theo quy định của Bộ GD&ĐT.
468
+ Phương thức xét tuyển theo điểm thi đánh giá năng lực của Đại học Quốc gia TP.HCM
469
+ năm 2022 (PT5): Điểm xét tuyển được thực hiện theo đúng đề án tuyển sinh đại học
470
+ năm 2022 theo thang điểm 1200 (đã bao gồm điểm ưu tiên khu vực, đối tượng theo
471
+ thang điểm 1200)
472
+
473
+
474
+ Phương thức xét tuyển theo kết quả học tập THPT -Đợt 1 (PT1-Đ1) và ưu tiên xét
475
+ tuyển theo quy định của TDTU đợt 1 (PT3-Đ1), điểm trúng tuyển theo thông báo Kết
476
+ quả sơ tuyển PT1, PT3-ĐT1 các ngành trình độ đại học chính quy 2022-Đợt 1 ngày
477
+ 30/6/2022 của HĐTS Trường. Bảng điểm trúng tuyển theo các phương thức như sau:
478
+ Here''s the updated table based on your additional data. I''ve kept the structure
479
+ consistent, with the text "HHMT≥6.0" moved to the "Điểm TT PT5" column where relevant:
480
+
481
+
482
+ STT Mã ngành Tên ngành Điểm TT PT1-Đ2 Điểm TT PT2 Điểm TT PT3-ĐT1-Đ2 Điểm TT PT3-ĐT2-Đ2
483
+ Điểm TT PT5 Chương trình tiêu chuẩn 1 7210402 Thiết kế công nghiệp 26.5 23 30
484
+ 650 HHMT≥6.0 2 7210403 Thiết kế đồ họa 29.5 27 32 700 HHMT≥6.0 3 7210404 Thiết
485
+ kế thời trang 26.5 24 30 650 HHMT≥6.0 4 7220201 Ngôn ngữ Anh 37 34 36 800 5 7220204
486
+ Ngôn ngữ Trung Quốc 37 33 35 800 6 7310301 Xã hội học 31.5 28.5 31 650 7 7310630
487
+ Việt Nam học (Chuyên ngành: Du lịch và lữ hành) 34 31.8 33 700 8 7310630Q Việt
488
+ Nam học (Chuyên ngành: Du lịch và quản lý du lịch) 34 31.8 33 700 9 7340101 Quản
489
+ trị kinh doanh (Chuyên ngành: Quản trị nguồn nhân lực) 37 33.6 36 800 10 7340101N
490
+ Quản trị kinh doanh (Chuyên ngành: Quản trị nhà hàng - khách sạn) 35.75 30.5 35
491
+ 800 11 7340115 Marketing 37.75 34.8 37 870 12 7340120 Kinh doanh quốc tế 37.5
492
+ 34.5 37 870 13 7340201 Tài chính - Ngân hàng 36.75 33.6 35.25 750 14 7340301 Kế
493
+ toán 36 33.3 34.25 720 15 7340408 Quan hệ lao động (Chuyên ngành Quản lý Quan
494
+ hệ lao động, Chuyên ngành Hành vi tổ chức) 28 27 31 700 16 7380101 Luật 36.5 33.5
495
+ 35.5 720 17 7420201 Công nghệ sinh học 33.5 26.5 32 680 18 7440301 Khoa học môi
496
+ trường 26 22 31 650 19 7460112 Toán ứng dụng 31.5 31.1 31 680 20 7460201 Thống
497
+ kê 28 29.1 31 680 21 7480101 Khoa học máy tính 38 35 35 850 22 7480102 Mạng máy
498
+ tính và truyền thông dữ liệu 36.25 34.5 32.5 800 23 7480103 Kỹ thuật phần mềm
499
+ 38 35.4 35.5 850 24 7510406 Công nghệ kỹ thuật môi trường (Chuyên ngành Cấp thoát
500
+ nước và môi trường nước) 26 22 30 650 25 7520114 Kỹ thuật cơ điện tử 33 28.5 32
501
+ 680 26 7520201 Kỹ thuật điện 31 27.5 32 650 27 7520207 Kỹ thuật điện tử - viễn
502
+ thông 31 29.5 32 650 28 7520216 Kỹ thuật điều khiển và tự động hóa 33 31.7 32
503
+ 680 29 7520301 Kỹ thuật hóa học 34 28.5 32 680 30 7580101 Kiến trúc 28 26 32 680
504
+ HHMT≥6.0 31 7580105 Quy hoạch vùng và đô thị 27 23 30 650 32 7580108 Thiết kế
505
+ nội thất 27 24 32 650 HHMT≥6.0 33 7580201 Kỹ thuật xây dựng 29 25 32 650 34 7580205
506
+ Kỹ thuật xây dựng công trình giao thông 27 23 30 650 35 7720201 Dược học 36 HSG
507
+ lớp 12 33.2 HSG lớp 12 800 HSG lớp 12 36 7760101 Công tác xã hội 27 25.3 30 650
508
+ 37 7810301 Quản lý thể dục thể thao (Chuyên ngành kinh doanh thể thao và tổ chức
509
+ sự kiện) 31.5 27 30 650 38 7810302 Golf 27 23 30 650 39 7850201 Bảo hộ lao động
510
+ 27 23 30 650 CHƯƠNG TRÌNH CHẤT LƯỢNG CAO 1 F7210403 Thiết kế đồ họa - Chương
511
+ trình Chất lượng cao 26.5 23 30 650 HHMT≥6.0 2 F7220201 Ngôn ngữ Anh – Chương
512
+ trình Chất lượng cao 34 29.9 32 700 3 F7310630Q Việt Nam học (Chuyên ngành Du
513
+ lịch và Quản lý du lịch) - Chương trình Chất lượng cao 27 27 32 650 4 F7340101
514
+ Quản trị kinh doanh (Chuyên ngành: Quản trị nguồn nhân lực) - Chương trình Chất
515
+ lượng cao 35.5 32.7 33 700 5 F7340101N Quản trị kinh doanh (Chuyên ngành: Quản
516
+ trị nhà hàng - khách sạn) - Chương trình Chất lượng cao 33 29.1 32 700 6 F7340115
517
+ Marketing - Chương trình Chất lượng cao 36 33.5 35 750 7 F7340120 Kinh doanh quốc
518
+ tế - Chương trình Chất lượng cao 36.5 32.8 36 750 8 F7340201 Tài chính - Ngân
519
+ hàng - Chương trình Chất lượng cao 33 30.1 32 700 9 F7340301 Kế toán - Chương
520
+ trình Chất lượng cao 31 29.2 32 650 10 F7380101 Luật - Chương trình Chất lượng
521
+ cao 32 32.1 32 650 11 F7420201 Công nghệ sinh học - Chương trình Chất lượng cao
522
+ 27 22 30 650 12 F7480101 Khoa học máy tính - Chương trình Chất lượng cao 36.25
523
+ 34.5 32 800 13 F7480103 Kỹ thuật phần mềm - Chương trình Chất lượng cao 36.25
524
+ 34.5 32 800 14 F7520201 Kỹ thuật điện - Chương trình Chất lượng cao 27 22 30 650
525
+ 15 F7520207 Kỹ thuật điện tử - viễn thông - Chương trình Chất lượng cao 27 22
526
+ 30 650 16 F7520216 Kỹ thuật điều khiển và tự động hóa - Chương trình Chất lượng
527
+ cao 27 25 30 650 17 F7580201 Kỹ thuật xây dựng - Chương trình Chất lượng cao 27
528
+ 22 30 650 CHƯƠNG TRÌNH ĐẠI HỌC BẰNG TIẾNG ANH
529
+
530
+
531
+ Yêu cầu về tiếng Anh đầu vào:
532
+
533
+
534
+ Thí sinh nước ngoài ở các nước có ngôn ngữ chính là tiếng Anh không yêu cầu Chứng
535
+ chỉ tiếng Anh đầu vào quốc tế;
536
+
537
+
538
+ Thí sinh Việt Nam và thí sinh ở các nước không có ngôn ngữ chính là tiếng Anh:
539
+ phải có Chứng chỉ IELTS 5.0 trở lên hoặc tương đương (có giá trị từ ngày 01/10/2020
540
+ và còn giá trị đến ngày 01/10/2022); hoặc phải dự thi đánh giá năng lực tiếng
541
+ Anh bằng Hệ thống đánh giá năng lực tiếng Anh theo chuẩn quốc tế của TDTU để được
542
+ xác nhận đủ điều kiện tiếng Anh theo học chương trình (trừ Ngành ngôn ngữ Anh
543
+ phải có chứng chỉ tiếng Anh quốc tế tương đương IELTS 5.0 trở lên theo quy định).
544
+ Trường hợp số lượng học viên nhập học đủ điều kiện học chính thức ít hơn sĩ số
545
+ tối thiểu để mở lớp, người học được tư vấn để bảo lưu kết quả tuyển sinh, hoặc
546
+ chuyển qua các ngành/chương trình khác (nếu đáp ứng được tiêu chí tuyển đầu vào
547
+ của ngành/chương trình đó). Chương trình đại học bằng tiếng Anh:
548
+
549
+
550
+ STT Mã ngành Tên ngành Điểm TT PT1-Đ2 Điểm TT PT2 Điểm TT PT3-ĐT1-Đ2 Điểm TT PT3-ĐT2-Đ2
551
+ Điểm TT PT5 1 FA7220201 Ngôn ngữ Anh – Chương trình đại học bằng tiếng Anh 32
552
+ 25 30 34.5 700 2 FA7310630Q Việt Nam học (Chuyên ngành Du lịch và Quản lý du lịch)
553
+ - Chương trình đại học bằng tiếng Anh 28 24 28 28 650 3 FA7340101N Quản trị kinh
554
+ doanh (Chuyên ngành: Quản trị nhà hàng - khách sạn) - Chương trình đại học bằng
555
+ tiếng Anh 30 27 30 30 650 4 FA7340115 Marketing - Chương trình đại học bằng tiếng
556
+ Anh 34 27 32 36 700 5 FA7340120 Kinh doanh quốc tế - Chương trình đại học bằng
557
+ tiếng Anh 34 27 32 36 700 6 FA7340201 Tài chính ngân hàng - Chương trình đại học
558
+ bằng tiếng Anh 28 24 28 28 650 7 FA7340301 Kế toán (Chuyên ngành: Kế toán quốc
559
+ tế) - Chương trình đại học bằng tiếng Anh 28 24 28 28 650 8 FA7420201 Công nghệ
560
+ sinh học - Chương trình đại học bằng tiếng Anh 28 24 28 28 650 9 FA7480101 Khoa
561
+ học máy tính - Chương trình đại học bằng tiếng Anh 30 24 30 30 650 10 FA7480103
562
+ Kỹ thuật phần mềm - Chương trình đại học bằng tiếng Anh 30 24 30 30 650 11 FA7520216
563
+ Kỹ thuật điều khiển và tự động hóa - Chương trình đại học bằng tiếng Anh 28 24
564
+ 28 28 650 12 FA7580201 Kỹ thuật xây dựng - Chương trình đại học bằng tiếng Anh
565
+ 28 24 28 28 650
566
+
567
+
568
+ Chương trình học tại Phân hiệu Khánh Hòa:
569
+
570
+
571
+ STT Mã ngành Tên ngành Điểm TT PT1-Đ2 Điểm TT PT2 Điểm TT PT3-ĐT1-Đ2 Điểm TT PT3-ĐT2-Đ2
572
+ Điểm TT PT5 1 N7220201 Ngôn ngữ Anh - Chương trình học Phân hiệu Khánh Hòa 28
573
+ 24 31 650 2 N7310630 Việt Nam học (Chuyên ngành: Du lịch và lữ hành) - Chương
574
+ trình học Phân hiệu Khánh Hòa 27 22 30 650 3 N7340101N Quản trị kinh doanh, Chuyên
575
+ ngành: Quản trị nhà hàng - khách sạn - Chương trình học Phân hiệu Khánh Hòa 29
576
+ 24 31 650 4 N7340115 Marketing - Chương trình học Phân hiệu Khánh Hòa 29 24 31
577
+ 650 5 N7340301 Kế toán - Chương trình học Phân hiệu Khánh Hòa 27 22 30 650 6 N7380101
578
+ Luật - Chương trình học Phân hiệu Khánh Hòa 27 22 30 650 7 N7480103 Kỹ thuật phần
579
+ mềm - Chương trình học Phân hiệu Khánh Hòa 27 22 31 650 CHƯƠNG TRÌNH LIÊN KẾT
580
+ QUỐC TẾ
581
+
582
+
583
+ Yêu cầu về tiếng Anh đầu vào:
584
+
585
+
586
+ Thí sinh phải đạt trình độ tiếng Anh đầu vào từ B2 trở lên hoặc tương đương để
587
+ được công nhận trúng tuyển vào chương trình chính thức.Thí sinh có thể nộp chứng
588
+ chỉ IELTS 5.5 hoặc các chứng chỉ quốc tế tương đương để xét tiếng Anh đầu vào;
589
+ hoặc phải dự thi đánh giá năng lực tiếng Anh đầu khóa bằng Hệ thống đánh giá năng
590
+ lực tiếng Anh theo chuẩn quốc tế của TDTU để được xác nhận đủ điều kiện tiếng
591
+ Anh theo học chương trình. Ngoại lệ:
592
+
593
+
594
+ Nếu tiếng Anh chưa đạt chuẩn B2, nhưng người học vẫn muốn học chương trình liên
595
+ kết đào tạo quốc tế, thì được xét vào chương trình dự bị tiếng Anh (liên kết quốc
596
+ tế) và phải tham gia học bổ túc tiếng Anh tại TDTU cho đến khi đạt trình độ tương
597
+ đương chuẩn nói trên để được “quyết định nhập học và công nhận là sinh viên”.
598
+ Thời gian học tiếng Anh tối đa là 2 năm và tùy năng lực đầu vào qua kết quả đánh
599
+ giá đầu vào xếp lớp của TDTU. Sau thời gian học chương trình dự bị tiếng Anh,
600
+ nếu vẫn chưa đạt chuẩn tiếng Anh trình độ B2 hoặc tương đương; người học phải
601
+ thôi học hoặc có thể xin chuyển sang các chương trình khác (nếu vẫn bảo đảm được
602
+ các tiêu chí tuyển sinh đầu vào tương ứng của các ngành/chương trình này theo
603
+ đúng năm tuyển sinh ). Trường hợp số lượng học viên nhập học đủ điều kiện học
604
+ chính thức ít hơn sĩ số tối thiểu để mở lớp, người học được tư vấn để bảo lưu
605
+ kết quả tuyển sinh, hoặc chuyển qua các ngành/chương trình khác (nếu đáp ứng được
606
+ tiêu chí tuyển đầu vào của ngành/chương trình đó). STT Mã ngành Tên ngành Điểm
607
+ TT PT1-Đ2 Điểm TT PT2 Điểm TT PT3-ĐT1-Đ2 Điểm TT PT3-ĐT2-Đ2 Điểm TT PT5 1 K7340101
608
+ Quản trị kinh doanh (song bằng, 2+2) - Chương trình liên kết Đại học Kinh tế Praha
609
+ (Cộng hòa Séc) 28 24 28 28 650 2 K7340101N Quản trị nhà hàng khách sạn (song bằng,
610
+ 2.5+1.5) - Chương trình liên kết Đại học Taylor''s (Malaysia) 28 24 28 28 650
611
+ 3 K7340120 Quản trị kinh doanh quốc tế (đơn bằng, 3+1) - Chương trình liên kết
612
+ Đại học Khoa học và công nghệ Lunghwa (Đài Loan) 28 24 28 28 650 4 K7340201 Tài
613
+ chính (song bằng, 2+2) - Chương trình liên kết Đại học Feng Chia (Đài Loan) 28
614
+ 24 28 28 650 5 K7340201S Tài chính (đơn bằng, 3+1) - Chương trình liên kết Đại
615
+ học Khoa học và công nghệ Lunghwa (Đài Loan) 28 24 28 28 650 6 K7340201X Tài chính
616
+ và kiểm soát (song bằng, 3+1) - Chương trình liên kết Đại học Khoa học ứng dụng
617
+ Saxion (Hà Lan) 28 24 28 28 650 7 K7340301 Kế toán (song bằng, 3+1) - Chương trình
618
+ liên kết Đại học West of England, Bristol (Anh) 28 24 28 28 650 8 K7480101 Khoa
619
+ học máy tính & Công nghệ tin học (đơn bằng, 2+2) - Chương trình liên kết Đại học
620
+ Khoa học và công nghệ Lunghwa (Đài Loan) 28 24 28 28 650 9 K7480101L Công nghệ
621
+ thông tin (song bằng, 2+2) - Chương trình liên kết Đại học La Trobe (Úc) 28 24
622
+ 28 28 650 10 K7520201 Kỹ thuật điện – điện tử (song bằng, 2.5+1.5) - Chương trình
623
+ liên kết Đại học Khoa học ứng dụng Saxion (Hà Lan) 28 24 28 28 650 11 K7580201
624
+ Kỹ thuật xây dựng (song b���ng, 2+2) - Chương trình liên kết Đại học La Trobe (Úc)
625
+ 28 24 28 28 650 Đính kèm phụ lục điểm trúng tuyển chi tiết theo từng phương thức
626
+
627
+
628
+ Phụ lục điểm trúng tuyển chi tiết phương thức 1-đợt 2 (tại đây)
629
+
630
+
631
+ Phụ lục điểm trúng tuyển chi tiết phương thức 2 (tại đây)
632
+
633
+
634
+ Phụ lục điểm trúng tuyển chi tiết phương thức 3-đợt 2 (tại đây)
635
+
636
+
637
+ Thí sinh tra cứu kết quả trúng tuyển từ 17h ngày 17/9/2022 tại website https://tracuuxettuyen.tdtu.edu.vn
638
+
639
+
640
+ Lưu ý: Thí sinh đủ điểm trúng tuyển của TDTU công bố nhưng không có trong danh
641
+ sách trúng tuyển chính thức có thể do thí sinh đã đăng ký không chính xác nguyện
642
+ vọng trên hệ thống Bộ GD&ĐT hoặc đã trúng tuyển ở nguyện vọng khác có thứ tự ưu
643
+ tiên cao hơn.'
644
+ - 'Đại học Kinh tế Thành phố Hồ Chí Minh (UEH)
645
+
646
+
647
+ Đại học Kinh tế Thành phố Hồ Chí Minh (tiếng Anh: University of Economics Ho Chi
648
+ Minh City – UEH), còn được gọi là Đại học UEH, là một đại học công lập đa ngành
649
+ trực thuộc Bộ Giáo dục và Đào tạo. UEH nằm trong nhóm các trường đại học trọng
650
+ điểm quốc gia, dẫn đầu trong đào tạo khối ngành kinh tế tại Việt Nam. UEH không
651
+ chỉ là một trụ cột quan trọng trong hệ thống giáo dục bậc cao mà còn là trung
652
+ tâm nghiên cứu các chính sách kinh tế và quản lý cho chính phủ cùng các doanh
653
+ nghiệp lớn. UEH đã đào tạo nhiều lãnh đạo cấp cao cho các tập đoàn đa quốc gia
654
+ nổi tiếng trong và ngoài nước. Lịch sử hình thành và phát triển
655
+
656
+
657
+ 1976: Thành lập với tên gọi Trường Đại học Kinh tế trực thuộc Bộ Đại học và Trung
658
+ học chuyên nghiệp. 1996: Sáp nhập với hai đơn vị khác, trở thành Trường Đại học
659
+ Kinh tế trực thuộc Đại học Quốc gia Thành phố Hồ Chí Minh. 2000: Tách ra khỏi
660
+ Đại học Quốc gia Thành phố Hồ Chí Minh, trở thành Trường Đại học Kinh tế Thành
661
+ phố Hồ Chí Minh trực thuộc Bộ Giáo dục và Đào tạo. 2021: Tái cấu trúc, thành lập
662
+ các trường thành viên và định hướng phát triển thành đại học đa ngành, đa lĩnh
663
+ vực. 2023: Chính thức chuyển đổi thành Đại học Kinh tế Thành phố Hồ Chí Minh.
664
+ Cơ sở vật chất và hoạt động
665
+
666
+
667
+ Hiện nay, UEH sở hữu: - 10 cơ sở giảng dạy tại Thành phố Hồ Chí Minh.'
668
+ - '4. CÁC NGÀNH ĐÀO TẠO
669
+
670
+
671
+ a. ĐẠI HỌC
672
+
673
+
674
+ Cử nhân Sư phạm Toán học (Hệ Chính quy, Hệ Vừa làm vừa học)
675
+
676
+
677
+ b.SAU ĐẠI HỌC
678
+
679
+
680
+ Thạc sĩ Toán giải tích
681
+
682
+
683
+ Thạc sĩ Đại số và Lý thuyết số
684
+
685
+
686
+ Thạc sĩ Hình học và Tôpô
687
+
688
+
689
+ Thạc sĩ Lý luận và Phương pháp dạy học bộ môn Toán
690
+
691
+
692
+ Tiến sĩ Toán Giải tích
693
+
694
+
695
+ Tiến sĩ Hình học và Tôpô
696
+
697
+
698
+ Tiến sĩ Lý luận và Phương pháp dạy học bộ môn Toán
699
+
700
+
701
+ c. BỒI DƯỠNG
702
+
703
+
704
+ Chuyên đề bồi dưỡng cho giáo viên tiểu học, trung học cơ sở và trung học phổ thông
705
+ về phương pháp, kĩ thuật dạy học, nội dung dạy học, kiểm tra, đánh giá, ứng dụng
706
+ công nghệ thông tin trong dạy học,…
707
+
708
+
709
+ vi. Khoa Công nghệ Thông tin
710
+
711
+
712
+ 1. CHẤT LƯỢNG ĐÀO TẠO
713
+
714
+
715
+ ĐÀO TẠO CỬ NHÂN (4 NĂM)
716
+
717
+
718
+ Sư phạm Tin học: 90 – 100 SV/năm
719
+
720
+
721
+ Công nghệ Thông tin: 180 – 200 SV/năm
722
+
723
+
724
+ ĐÀO TẠO CAO HỌC (2 NĂM)
725
+
726
+
727
+ Thạc sĩ Khoa học máy tính: 15-35 HV/ năm
728
+
729
+
730
+ 2. CHẤT LƯỢNG GIẢNG VIÊN
731
+
732
+
733
+ ĐỘI NGŨ GIẢNG VIÊN: 24
734
+
735
+
736
+ Tiến sĩ: 9
737
+
738
+
739
+ Thạc sĩ: 15
740
+
741
+
742
+ 3. MỤC TIÊU ĐÀO TẠO
743
+
744
+
745
+ Đào tạo giáo viên dạy Tin học bậc phổ thông có trình độ cử nhân Sư phạm Tin học,
746
+ có phẩm chất chính trị, đạo đức và sức khỏe tốt, hiểu và vận dụng các tri thức
747
+ cơ bản của Tin học; Lý luận và phương pháp giảng dạy Tin học ở trường trung học,
748
+ tiểu học. Sau khi tốt nghiệp, người học có đủ năng lực để giảng dạy Tin học tại
749
+ các trường trung học, tiểu học và một số cơ sở giáo dục tương đương. Đào tạo cử
750
+ nhân Công nghệ thông tin, có phẩm chất chính trị, đạo đức và sức khỏe tốt, hiểu
751
+ và vận dụng các tri thức cơ bản về khoa học máy tính. Sau khi tốt nghiệp, người
752
+ học có đủ năng lực để làm việc trong môi trường các cơ sở sản xuất, các viện hoặc
753
+ trung tâm nghiên cứu trong lĩnh vực Công nghệ thông tin cũng như có thể tiếp tục
754
+ theo các bậc học cao hơn.'
755
+ - source_sentence: Xin hãy liệt kê các trung tâm của Trường Đại học Sư phạm Kỹ thuật
756
+ TP. Hồ Chí Minh.
757
+ sentences:
758
+ - 'Nếu có thắc mắc thí sinh vui lòng liên hệ số điện thoại hỗ trợ tuyển sinh: 19002024'
759
+ - 'Thực hiện hướng dẫn của Bộ Giáo dục và Đào tạo tại Công văn số 1919/BGDĐT-GDĐH
760
+ ngày 28 tháng 4 năm 2023, phương thức xét tuyển kết quả điểm thi tốt nghiệp Trung
761
+ học phổ thông vẫn được giữ nguyên như năm 2022. Tổ hợp môn xét tuyển: B00 (Toán
762
+ – Hóa – Sinh) chung cho tất cả các ngành. năm 2022, Trường Đại học Y khoa Phạm
763
+ Ngọc Thạch tuyển được 1.367 chỉ tiêu (đạt 104,4% so với chỉ tiêu đề ra). chỉ tiêu
764
+ tuyển sinh đại học chính quy của Trường Đại học Y khoa Phạm Ngọc Thạch năm 2023.
765
+ 1. Y khoa: 660 2. Dược học: 90 3. Điều dưỡng: 250 4. Dinh dưỡng: 60 5. Răng Hàm
766
+ Mặt: 90 6. Kỹ thuật xét nghiệm y học: 50 7. Kỹ thuật hình ảnh y học: 40 8. Kỹ
767
+ thuật phục hồi chức năng: 30 9. Khúc xạ nhãn khoa: 40 10. Y tế công cộng: 56
768
+
769
+
770
+ Ghi chú: chỉ tiêu được chia cho các thí sinh có hộ khẩu ở TP HCM và ngoài TP HCM
771
+ với tỉ lệ 50%
772
+
773
+
774
+ Điểm chuẩn của trường Đại học Y khoa Phạm Ngọc Thạch 2023: Y khoa, Điểm chuẩn
775
+ thí sinh có hộ khẩu tại TP HCM(TP): 25,90, Điểm chuẩn thí sinh có hộ khẩu ngoài
776
+ TP HCM(TQ): 26.31 Dược học, Điểm chuẩn thí sinh có hộ khẩu tại TP HCM(TP): 25,28,
777
+ Điểm chuẩn thí sinh có hộ khẩu ngoài TP HCM(TQ): 25,25 Điều dưỡng, Điểm chuẩn
778
+ thí sinh có hộ khẩu tại TP HCM(TP): 22,40, Điểm chuẩn thí sinh có hộ khẩu ngoài
779
+ TP HCM(TQ): 22,40 Dinh dưỡng, Điểm chuẩn thí sinh có hộ khẩu tại TP HCM(TP): 22,25,
780
+ Điểm chuẩn thí sinh có hộ khẩu ngoài TP HCM(TQ): 22,80 Răng - Hàm - Mặt, Điểm
781
+ chuẩn thí sinh có hộ khẩu tại TP HCM(TP): 26,00, Điểm chuẩn thí sinh có hộ khẩu
782
+ ngoài TP HCM(TQ): 26,28 Kỹ thuật Xét nghiệm Y học, Điểm chuẩn thí sinh có hộ khẩu
783
+ tại TP HCM(TP): 24,54, Điểm chuẩn thí sinh có hộ khẩu ngoài TP HCM(TQ): 24,47
784
+ Kỹ thuật Hình ảnh Y học, Điểm chuẩn thí sinh có hộ khẩu tại TP HCM(TP): 23,45,
785
+ Điểm chuẩn thí sinh có hộ khẩu ngoài TP HCM(TQ): 23,61 Khúc xạ nhãn khoa, Điểm
786
+ chuẩn thí sinh có hộ khẩu tại TP HCM(TP): 23,75, Điểm chuẩn thí sinh có hộ khẩu
787
+ ngoài TP HCM(TQ): 23,75 Y tế công cộng, Điểm chuẩn thí sinh có hộ khẩu tại TP
788
+ HCM(TP): 18,85, Điểm chuẩn thí sinh có hộ khẩu ngoài TP HCM(TQ): 18,35 Kỹ thuật
789
+ Phục hồi chức năng, Điểm chuẩn thí sinh có hộ khẩu tại TP HCM(TP): 23,15, Điểm
790
+ chuẩn thí sinh có hộ khẩu ngoài TP HCM(TQ): 23,09'
791
+ - 'Phòng Đào tạo
792
+
793
+
794
+ 2. Phòng Đào tạo không chính quy
795
+
796
+
797
+ 3. Phòng Tuyển sinh và Công tác Sinh viên
798
+
799
+
800
+ 4. Phòng Truyền thông
801
+
802
+
803
+ 5. Phòng Khoa học Công nghệ - Quan hệ Quốc tế
804
+
805
+
806
+ 6. Phòng Quan hệ Doanh nghiệp
807
+
808
+
809
+ 7. Phòng Thanh tra - Giáo dục
810
+
811
+
812
+ 8. Phòng Đảm bảo Chất lượng
813
+
814
+
815
+ 9. Phòng Tổ chức - Hành chính
816
+
817
+
818
+ 10. Phòng Kế hoạch - Tài chính
819
+
820
+
821
+ 11. Phòng Quản trị Cơ sở Vật chất
822
+
823
+
824
+ 12. Phòng Thiết bị - Vật tư
825
+
826
+
827
+ 13. Ban quản lý KTX
828
+
829
+
830
+ 14. Trạm Y tế
831
+
832
+
833
+ 15. Bộ phận Quản lý Hồ sơ Dự án
834
+
835
+
836
+ C. Danh sách các trung tâm của Trường Đại học Sư phạm Kỹ thuật Thành phố Hồ Chí
837
+ Minh:
838
+
839
+
840
+ 1. Ngoại ngữ
841
+
842
+
843
+ 2. Tin học
844
+
845
+
846
+ 3. Thư viện
847
+
848
+
849
+ 4. Hợp tác Đào tạo Quốc tế
850
+
851
+
852
+ 5. Việt – Đức
853
+
854
+
855
+ 6. Dịch vụ Sinh viên
856
+
857
+
858
+ 7. Thông tin – Máy tính
859
+
860
+
861
+ 8. Dạy học số
862
+
863
+
864
+ 9. Kỹ thuật Tổng hợp
865
+
866
+
867
+ 10. Chế tạo và Thiết kế Thiết bị Công nghiệp
868
+
869
+
870
+ 11. Đào tạo và hướng nghiệp quốc tế Việt Nhật
871
+
872
+
873
+ 12. Đào tạo ngắn hạn
874
+
875
+
876
+ 13. Giáo dục Thể chất - Quốc phòng
877
+
878
+
879
+ 14. Đào tạo Bồi dưỡng giáo viên phổ thông, giáo dục nghề nghiệp miền Trung - Tây
880
+ Nguyên
881
+
882
+
883
+ 15. Nghiên cứu và Ứng dụng Kỹ thuật Xây dựng
884
+
885
+
886
+ 16. Bồi dưỡng và Đánh giá kỹ năng nghề Quốc gia
887
+
888
+
889
+ 17. Phát triển ngôn ngữ
890
+
891
+
892
+ 18. Nghiên cứu và Chuyển giao Công nghệ
893
+
894
+
895
+ 19. Công nghệ phần mềm
896
+
897
+
898
+ 20. Hàn ngữ học Dong A
899
+
900
+
901
+ 21. Sáng tạo và Khởi nghiệp
902
+
903
+
904
+ 22. Trung tâm hướng nghiệp và đào tạo Việt Nhật
905
+
906
+
907
+ D. Các ngành đào tạo trình độ đại học
908
+
909
+
910
+ Đi cùng với sự vận động và phát triển của nền kinh tế đất nước theo hướng công
911
+ nghiệp hóa, hiện đại hóa, Trường Đại học Sư phạm Kỹ thuật Tp. Hồ Chí Minh đã tiếp
912
+ cận thực tế để mở rộng đào tạo gần 30 ngành đào tạo trình độ đại học
913
+
914
+
915
+ i.'
916
+ pipeline_tag: sentence-similarity
917
+ library_name: sentence-transformers
918
+ metrics:
919
+ - cosine_accuracy@1
920
+ - cosine_accuracy@3
921
+ - cosine_accuracy@5
922
+ - cosine_accuracy@10
923
+ - cosine_precision@1
924
+ - cosine_precision@3
925
+ - cosine_precision@5
926
+ - cosine_precision@10
927
+ - cosine_recall@1
928
+ - cosine_recall@3
929
+ - cosine_recall@5
930
+ - cosine_recall@10
931
+ - cosine_ndcg@10
932
+ - cosine_mrr@10
933
+ - cosine_map@100
934
+ model-index:
935
+ - name: SentenceTransformer based on dangvantuan/vietnamese-document-embedding
936
+ results:
937
+ - task:
938
+ type: information-retrieval
939
+ name: Information Retrieval
940
+ dataset:
941
+ name: dim 768
942
+ type: dim_768
943
+ metrics:
944
+ - type: cosine_accuracy@1
945
+ value: 0.6759510869565217
946
+ name: Cosine Accuracy@1
947
+ - type: cosine_accuracy@3
948
+ value: 0.9001358695652174
949
+ name: Cosine Accuracy@3
950
+ - type: cosine_accuracy@5
951
+ value: 0.9483695652173914
952
+ name: Cosine Accuracy@5
953
+ - type: cosine_accuracy@10
954
+ value: 0.985733695652174
955
+ name: Cosine Accuracy@10
956
+ - type: cosine_precision@1
957
+ value: 0.6759510869565217
958
+ name: Cosine Precision@1
959
+ - type: cosine_precision@3
960
+ value: 0.30004528985507245
961
+ name: Cosine Precision@3
962
+ - type: cosine_precision@5
963
+ value: 0.18967391304347825
964
+ name: Cosine Precision@5
965
+ - type: cosine_precision@10
966
+ value: 0.09857336956521738
967
+ name: Cosine Precision@10
968
+ - type: cosine_recall@1
969
+ value: 0.6759510869565217
970
+ name: Cosine Recall@1
971
+ - type: cosine_recall@3
972
+ value: 0.9001358695652174
973
+ name: Cosine Recall@3
974
+ - type: cosine_recall@5
975
+ value: 0.9483695652173914
976
+ name: Cosine Recall@5
977
+ - type: cosine_recall@10
978
+ value: 0.985733695652174
979
+ name: Cosine Recall@10
980
+ - type: cosine_ndcg@10
981
+ value: 0.8420877438453158
982
+ name: Cosine Ndcg@10
983
+ - type: cosine_mrr@10
984
+ value: 0.794684912008282
985
+ name: Cosine Mrr@10
986
+ - type: cosine_map@100
987
+ value: 0.7957360881986503
988
+ name: Cosine Map@100
989
+ - task:
990
+ type: information-retrieval
991
+ name: Information Retrieval
992
+ dataset:
993
+ name: dim 512
994
+ type: dim_512
995
+ metrics:
996
+ - type: cosine_accuracy@1
997
+ value: 0.6827445652173914
998
+ name: Cosine Accuracy@1
999
+ - type: cosine_accuracy@3
1000
+ value: 0.9137228260869565
1001
+ name: Cosine Accuracy@3
1002
+ - type: cosine_accuracy@5
1003
+ value: 0.9565217391304348
1004
+ name: Cosine Accuracy@5
1005
+ - type: cosine_accuracy@10
1006
+ value: 0.9898097826086957
1007
+ name: Cosine Accuracy@10
1008
+ - type: cosine_precision@1
1009
+ value: 0.6827445652173914
1010
+ name: Cosine Precision@1
1011
+ - type: cosine_precision@3
1012
+ value: 0.30457427536231885
1013
+ name: Cosine Precision@3
1014
+ - type: cosine_precision@5
1015
+ value: 0.19130434782608693
1016
+ name: Cosine Precision@5
1017
+ - type: cosine_precision@10
1018
+ value: 0.09898097826086956
1019
+ name: Cosine Precision@10
1020
+ - type: cosine_recall@1
1021
+ value: 0.6827445652173914
1022
+ name: Cosine Recall@1
1023
+ - type: cosine_recall@3
1024
+ value: 0.9137228260869565
1025
+ name: Cosine Recall@3
1026
+ - type: cosine_recall@5
1027
+ value: 0.9565217391304348
1028
+ name: Cosine Recall@5
1029
+ - type: cosine_recall@10
1030
+ value: 0.9898097826086957
1031
+ name: Cosine Recall@10
1032
+ - type: cosine_ndcg@10
1033
+ value: 0.848423953670157
1034
+ name: Cosine Ndcg@10
1035
+ - type: cosine_mrr@10
1036
+ value: 0.8016792292098005
1037
+ name: Cosine Mrr@10
1038
+ - type: cosine_map@100
1039
+ value: 0.8024031231126366
1040
+ name: Cosine Map@100
1041
+ - task:
1042
+ type: information-retrieval
1043
+ name: Information Retrieval
1044
+ dataset:
1045
+ name: dim 256
1046
+ type: dim_256
1047
+ metrics:
1048
+ - type: cosine_accuracy@1
1049
+ value: 0.6813858695652174
1050
+ name: Cosine Accuracy@1
1051
+ - type: cosine_accuracy@3
1052
+ value: 0.9157608695652174
1053
+ name: Cosine Accuracy@3
1054
+ - type: cosine_accuracy@5
1055
+ value: 0.9599184782608695
1056
+ name: Cosine Accuracy@5
1057
+ - type: cosine_accuracy@10
1058
+ value: 0.9891304347826086
1059
+ name: Cosine Accuracy@10
1060
+ - type: cosine_precision@1
1061
+ value: 0.6813858695652174
1062
+ name: Cosine Precision@1
1063
+ - type: cosine_precision@3
1064
+ value: 0.3052536231884058
1065
+ name: Cosine Precision@3
1066
+ - type: cosine_precision@5
1067
+ value: 0.19198369565217388
1068
+ name: Cosine Precision@5
1069
+ - type: cosine_precision@10
1070
+ value: 0.09891304347826084
1071
+ name: Cosine Precision@10
1072
+ - type: cosine_recall@1
1073
+ value: 0.6813858695652174
1074
+ name: Cosine Recall@1
1075
+ - type: cosine_recall@3
1076
+ value: 0.9157608695652174
1077
+ name: Cosine Recall@3
1078
+ - type: cosine_recall@5
1079
+ value: 0.9599184782608695
1080
+ name: Cosine Recall@5
1081
+ - type: cosine_recall@10
1082
+ value: 0.9891304347826086
1083
+ name: Cosine Recall@10
1084
+ - type: cosine_ndcg@10
1085
+ value: 0.848428744710359
1086
+ name: Cosine Ndcg@10
1087
+ - type: cosine_mrr@10
1088
+ value: 0.8016997174775718
1089
+ name: Cosine Mrr@10
1090
+ - type: cosine_map@100
1091
+ value: 0.8024753262882551
1092
+ name: Cosine Map@100
1093
+ ---
1094
+
1095
+ # SentenceTransformer based on dangvantuan/vietnamese-document-embedding
1096
+
1097
+ This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [dangvantuan/vietnamese-document-embedding](https://huggingface.co/dangvantuan/vietnamese-document-embedding). It maps sentences & paragraphs to a 768-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
1098
+
1099
+ ## Model Details
1100
+
1101
+ ### Model Description
1102
+ - **Model Type:** Sentence Transformer
1103
+ - **Base model:** [dangvantuan/vietnamese-document-embedding](https://huggingface.co/dangvantuan/vietnamese-document-embedding) <!-- at revision 6fa4e2f8ed2d33120b0f4442cc81f8f973c3f56b -->
1104
+ - **Maximum Sequence Length:** 8192 tokens
1105
+ - **Output Dimensionality:** 768 dimensions
1106
+ - **Similarity Function:** Cosine Similarity
1107
+ <!-- - **Training Dataset:** Unknown -->
1108
+ <!-- - **Language:** Unknown -->
1109
+ <!-- - **License:** Unknown -->
1110
+
1111
+ ### Model Sources
1112
+
1113
+ - **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
1114
+ - **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
1115
+ - **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
1116
+
1117
+ ### Full Model Architecture
1118
+
1119
+ ```
1120
+ SentenceTransformer(
1121
+ (0): Transformer({'max_seq_length': 8192, 'do_lower_case': False, 'architecture': 'VietnameseModel'})
1122
+ (1): Pooling({'word_embedding_dimension': 768, 'pooling_mode_cls_token': True, 'pooling_mode_mean_tokens': False, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
1123
+ (2): Normalize()
1124
+ )
1125
+ ```
1126
+
1127
+ ## Usage
1128
+
1129
+ ### Direct Usage (Sentence Transformers)
1130
+
1131
+ First install the Sentence Transformers library:
1132
+
1133
+ ```bash
1134
+ pip install -U sentence-transformers
1135
+ ```
1136
+
1137
+ Then you can load this model and run inference.
1138
+ ```python
1139
+ from sentence_transformers import SentenceTransformer
1140
+
1141
+ # Download from the 🤗 Hub
1142
+ model = SentenceTransformer("HoangVuSnape/vietnamese-document-embedding_pr_v2_ep30_new")
1143
+ # Run inference
1144
+ sentences = [
1145
+ 'Xin hãy liệt kê các trung tâm của Trường Đại học Sư phạm Kỹ thuật TP. Hồ Chí Minh.',
1146
+ 'Phòng Đào tạo\n\n2. Phòng Đào tạo không chính quy\n\n3. Phòng Tuyển sinh và Công tác Sinh viên\n\n4. Phòng Truyền thông\n\n5. Phòng Khoa học Công nghệ - Quan hệ Quốc tế\n\n6. Phòng Quan hệ Doanh nghiệp\n\n7. Phòng Thanh tra - Giáo dục\n\n8. Phòng Đảm bảo Chất lượng\n\n9. Phòng Tổ chức - Hành chính\n\n10. Phòng Kế hoạch - Tài chính\n\n11. Phòng Quản trị Cơ sở Vật chất\n\n12. Phòng Thiết bị - Vật tư\n\n13. Ban quản lý KTX\n\n14. Trạm Y tế\n\n15. Bộ phận Quản lý Hồ sơ Dự án\n\nC. Danh sách các trung tâm của Trường Đại học Sư phạm Kỹ thuật Thành phố Hồ Chí Minh:\n\n1. Ngoại ngữ\n\n2. Tin học\n\n3. Thư viện\n\n4. Hợp tác Đào tạo Quốc tế\n\n5. Việt – Đức\n\n6. Dịch vụ Sinh viên\n\n7. Thông tin – Máy tính\n\n8. Dạy học số\n\n9. Kỹ thuật Tổng hợp\n\n10. Chế tạo và Thiết kế Thiết bị Công nghiệp\n\n11. Đào tạo và hướng nghiệp quốc tế Việt Nhật\n\n12. Đào tạo ngắn hạn\n\n13. Giáo dục Thể chất - Quốc phòng\n\n14. Đào tạo Bồi dưỡng giáo viên phổ thông, giáo dục nghề nghiệp miền Trung - Tây Nguyên\n\n15. Nghiên cứu và Ứng dụng Kỹ thuật Xây dựng\n\n16. Bồi dưỡng và Đánh giá kỹ năng nghề Quốc gia\n\n17. Phát triển ngôn ngữ\n\n18. Nghiên cứu và Chuyển giao Công nghệ\n\n19. Công nghệ phần mềm\n\n20. Hàn ngữ học Dong A\n\n21. Sáng tạo và Khởi nghiệp\n\n22. Trung tâm hướng nghiệp và đào tạo Việt Nhật\n\nD. Các ngành đào tạo trình độ đại học\n\nĐi cùng với sự vận động và phát triển của nền kinh tế đất nước theo hướng công nghiệp hóa, hiện đại hóa, Trường Đại học Sư phạm Kỹ thuật Tp. Hồ Chí Minh đã tiếp cận thực tế để mở rộng đào tạo gần 30 ngành đào tạo trình độ đại học\n\ni.',
1147
+ 'Thực hiện hướng dẫn của Bộ Giáo dục và Đào tạo tại Công văn số 1919/BGDĐT-GDĐH ngày 28 tháng 4 năm 2023, phương thức xét tuyển kết quả điểm thi tốt nghiệp Trung học phổ thông vẫn được giữ nguyên như năm 2022. Tổ hợp môn xét tuyển: B00 (Toán – Hóa – Sinh) chung cho tất cả các ngành. năm 2022, Trường Đại học Y khoa Phạm Ngọc Thạch tuyển được 1.367 chỉ tiêu (đạt 104,4% so với chỉ tiêu đề ra). chỉ tiêu tuyển sinh đại học chính quy của Trường Đại học Y khoa Phạm Ngọc Thạch năm 2023. 1. Y khoa: 660 2. Dược học: 90 3. Điều dưỡng: 250 4. Dinh dưỡng: 60 5. Răng Hàm Mặt: 90 6. Kỹ thuật xét nghiệm y học: 50 7. Kỹ thuật hình ảnh y học: 40 8. Kỹ thuật phục hồi chức năng: 30 9. Khúc xạ nhãn khoa: 40 10. Y tế công cộng: 56\n\nGhi chú: chỉ tiêu được chia cho các thí sinh có hộ khẩu ở TP HCM và ngoài TP HCM với tỉ lệ 50%\n\nĐiểm chuẩn của trường Đại học Y khoa Phạm Ngọc Thạch 2023: Y khoa, Điểm chuẩn thí sinh có hộ khẩu tại TP HCM(TP): 25,90, Điểm chuẩn thí sinh có hộ khẩu ngoài TP HCM(TQ): 26.31 Dược học, Điểm chuẩn thí sinh có hộ khẩu tại TP HCM(TP): 25,28, Điểm chuẩn thí sinh có hộ khẩu ngoài TP HCM(TQ): 25,25 Điều dưỡng, Điểm chuẩn thí sinh có hộ khẩu tại TP HCM(TP): 22,40, Điểm chuẩn thí sinh có hộ khẩu ngoài TP HCM(TQ): 22,40 Dinh dưỡng, Điểm chuẩn thí sinh có hộ khẩu tại TP HCM(TP): 22,25, Điểm chuẩn thí sinh có hộ khẩu ngoài TP HCM(TQ): 22,80 Răng - Hàm - Mặt, Điểm chuẩn thí sinh có hộ khẩu tại TP HCM(TP): 26,00, Điểm chuẩn thí sinh có hộ khẩu ngoài TP HCM(TQ): 26,28 Kỹ thuật Xét nghiệm Y học, Điểm chuẩn thí sinh có hộ khẩu tại TP HCM(TP): 24,54, Điểm chuẩn thí sinh có hộ khẩu ngoài TP HCM(TQ): 24,47 Kỹ thuật Hình ảnh Y học, Điểm chuẩn thí sinh có hộ khẩu tại TP HCM(TP): 23,45, Điểm chuẩn thí sinh có hộ khẩu ngoài TP HCM(TQ): 23,61 Khúc xạ nhãn khoa, Điểm chuẩn thí sinh có hộ khẩu tại TP HCM(TP): 23,75, Điểm chuẩn thí sinh có hộ khẩu ngoài TP HCM(TQ): 23,75 Y tế công cộng, Điểm chuẩn thí sinh có hộ khẩu tại TP HCM(TP): 18,85, Điểm chuẩn thí sinh có hộ khẩu ngoài TP HCM(TQ): 18,35 Kỹ thuật Phục hồi chức năng, Điểm chuẩn thí sinh có hộ khẩu tại TP HCM(TP): 23,15, Điểm chuẩn thí sinh có hộ khẩu ngoài TP HCM(TQ): 23,09',
1148
+ ]
1149
+ embeddings = model.encode(sentences)
1150
+ print(embeddings.shape)
1151
+ # [3, 768]
1152
+
1153
+ # Get the similarity scores for the embeddings
1154
+ similarities = model.similarity(embeddings, embeddings)
1155
+ print(similarities)
1156
+ # tensor([[1.0000, 0.8413, 0.0106],
1157
+ # [0.8413, 1.0000, 0.0259],
1158
+ # [0.0106, 0.0259, 1.0000]])
1159
+ ```
1160
+
1161
+ <!--
1162
+ ### Direct Usage (Transformers)
1163
+
1164
+ <details><summary>Click to see the direct usage in Transformers</summary>
1165
+
1166
+ </details>
1167
+ -->
1168
+
1169
+ <!--
1170
+ ### Downstream Usage (Sentence Transformers)
1171
+
1172
+ You can finetune this model on your own dataset.
1173
+
1174
+ <details><summary>Click to expand</summary>
1175
+
1176
+ </details>
1177
+ -->
1178
+
1179
+ <!--
1180
+ ### Out-of-Scope Use
1181
+
1182
+ *List how the model may foreseeably be misused and address what users ought not to do with the model.*
1183
+ -->
1184
+
1185
+ ## Evaluation
1186
+
1187
+ ### Metrics
1188
+
1189
+ #### Information Retrieval
1190
+
1191
+ * Dataset: `dim_768`
1192
+ * Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator) with these parameters:
1193
+ ```json
1194
+ {
1195
+ "truncate_dim": 768
1196
+ }
1197
+ ```
1198
+
1199
+ | Metric | Value |
1200
+ |:--------------------|:-----------|
1201
+ | cosine_accuracy@1 | 0.676 |
1202
+ | cosine_accuracy@3 | 0.9001 |
1203
+ | cosine_accuracy@5 | 0.9484 |
1204
+ | cosine_accuracy@10 | 0.9857 |
1205
+ | cosine_precision@1 | 0.676 |
1206
+ | cosine_precision@3 | 0.3 |
1207
+ | cosine_precision@5 | 0.1897 |
1208
+ | cosine_precision@10 | 0.0986 |
1209
+ | cosine_recall@1 | 0.676 |
1210
+ | cosine_recall@3 | 0.9001 |
1211
+ | cosine_recall@5 | 0.9484 |
1212
+ | cosine_recall@10 | 0.9857 |
1213
+ | **cosine_ndcg@10** | **0.8421** |
1214
+ | cosine_mrr@10 | 0.7947 |
1215
+ | cosine_map@100 | 0.7957 |
1216
+
1217
+ #### Information Retrieval
1218
+
1219
+ * Dataset: `dim_512`
1220
+ * Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator) with these parameters:
1221
+ ```json
1222
+ {
1223
+ "truncate_dim": 512
1224
+ }
1225
+ ```
1226
+
1227
+ | Metric | Value |
1228
+ |:--------------------|:-----------|
1229
+ | cosine_accuracy@1 | 0.6827 |
1230
+ | cosine_accuracy@3 | 0.9137 |
1231
+ | cosine_accuracy@5 | 0.9565 |
1232
+ | cosine_accuracy@10 | 0.9898 |
1233
+ | cosine_precision@1 | 0.6827 |
1234
+ | cosine_precision@3 | 0.3046 |
1235
+ | cosine_precision@5 | 0.1913 |
1236
+ | cosine_precision@10 | 0.099 |
1237
+ | cosine_recall@1 | 0.6827 |
1238
+ | cosine_recall@3 | 0.9137 |
1239
+ | cosine_recall@5 | 0.9565 |
1240
+ | cosine_recall@10 | 0.9898 |
1241
+ | **cosine_ndcg@10** | **0.8484** |
1242
+ | cosine_mrr@10 | 0.8017 |
1243
+ | cosine_map@100 | 0.8024 |
1244
+
1245
+ #### Information Retrieval
1246
+
1247
+ * Dataset: `dim_256`
1248
+ * Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator) with these parameters:
1249
+ ```json
1250
+ {
1251
+ "truncate_dim": 256
1252
+ }
1253
+ ```
1254
+
1255
+ | Metric | Value |
1256
+ |:--------------------|:-----------|
1257
+ | cosine_accuracy@1 | 0.6814 |
1258
+ | cosine_accuracy@3 | 0.9158 |
1259
+ | cosine_accuracy@5 | 0.9599 |
1260
+ | cosine_accuracy@10 | 0.9891 |
1261
+ | cosine_precision@1 | 0.6814 |
1262
+ | cosine_precision@3 | 0.3053 |
1263
+ | cosine_precision@5 | 0.192 |
1264
+ | cosine_precision@10 | 0.0989 |
1265
+ | cosine_recall@1 | 0.6814 |
1266
+ | cosine_recall@3 | 0.9158 |
1267
+ | cosine_recall@5 | 0.9599 |
1268
+ | cosine_recall@10 | 0.9891 |
1269
+ | **cosine_ndcg@10** | **0.8484** |
1270
+ | cosine_mrr@10 | 0.8017 |
1271
+ | cosine_map@100 | 0.8025 |
1272
+
1273
+ <!--
1274
+ ## Bias, Risks and Limitations
1275
+
1276
+ *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
1277
+ -->
1278
+
1279
+ <!--
1280
+ ### Recommendations
1281
+
1282
+ *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
1283
+ -->
1284
+
1285
+ ## Training Details
1286
+
1287
+ ### Training Dataset
1288
+
1289
+ #### Unnamed Dataset
1290
+
1291
+ * Size: 1,472 training samples
1292
+ * Columns: <code>anchor</code> and <code>positive</code>
1293
+ * Approximate statistics based on the first 1000 samples:
1294
+ | | anchor | positive |
1295
+ |:--------|:----------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------|
1296
+ | type | string | string |
1297
+ | details | <ul><li>min: 9 tokens</li><li>mean: 25.49 tokens</li><li>max: 62 tokens</li></ul> | <ul><li>min: 14 tokens</li><li>mean: 559.43 tokens</li><li>max: 6602 tokens</li></ul> |
1298
+ * Samples:
1299
+ | anchor | positive |
1300
+ |:-----------------------------------------------------------------------------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
1301
+ | <code>Ngành Quản lý Tài nguyên và Môi trường trang bị cho sinh viên những kiến thức và kỹ năng gì?</code> | <code>Sau khi tốt nghiệp, người học sẽ:<br><br>Có kiến thức cơ bản về toán học, khoa học tự nhiên, đáp ứng cho việc tiếp thu các kiến thức giáo dục chuyên nghiệp và khả năng học tập ở trình độ cao hơn<br><br>Có các kiến thức kỹ thuật cơ sở ngành và chuyên ngành giúp đủ năng lực phát hiện, giải quyết các vấn đề liên quan đến công nghệ sản xuất, chế tạo và ứng dụng vật liệu vào trong xây dựng, kiểm soát chất lượng nguyên vật liệu và cấu kiện sản phẩm xây dựng, nghiên cứu sản xuất chế tạo và phát triển các loại vật liệu mới, hiện đại, tiên tiến, độc đáo, hiệu quả, xanh, bền vững… nhằm hướng tới sự phát triển bền vững trong công nghiệp xây dựng và kiến trúc, thiết kế và thi công trong các công trình xây dựng; có tính sáng tạo trong hoạt động nghề nghiệp, có khả năng tự học và tự nghiên cứu;<br><br>Có kỹ năng cá nhân, nghề nghiệp, giao tiếp, làm việc nhóm đủ để làm việc trong môi trường làm việc liên ngành, đa văn hóa;<br><br>Có hiểu biết về kinh tế, chính trị, có các kiến thức cơ bản trong lĩnh vực khoa học xã hội và n...</code> |
1302
+ | <code>Chương trình Kỹ thuật Môi trường đào tạo sinh viên về những năng lực nào và có điểm gì nổi bật đối với chương trình giảng dạy bằng tiếng Anh?</code> | <code>Sau khi tốt nghiệp, người học sẽ:<br><br>Có kiến thức cơ bản về toán học, khoa học tự nhiên, đáp ứng cho việc tiếp thu các kiến thức giáo dục chuyên nghiệp và khả năng học tập ở trình độ cao hơn<br><br>Có các kiến thức kỹ thuật cơ sở ngành và chuyên ngành giúp đủ năng lực phát hiện, giải quyết các vấn đề liên quan đến công nghệ sản xuất, chế tạo và ứng dụng vật liệu vào trong xây dựng, kiểm soát chất lượng nguyên vật liệu và cấu kiện sản phẩm xây dựng, nghiên cứu sản xuất chế tạo và phát triển các loại vật liệu mới, hiện đại, tiên tiến, độc đáo, hiệu quả, xanh, bền vững… nhằm hướng tới sự phát triển bền vững trong công nghiệp xây dựng và kiến trúc, thiết kế và thi công trong các công trình xây dựng; có tính sáng tạo trong hoạt động nghề nghiệp, có khả năng tự học và tự nghiên cứu;<br><br>Có kỹ năng cá nhân, nghề nghiệp, giao tiếp, làm việc nhóm đủ để làm việc trong môi trường làm việc liên ngành, đa văn hóa;<br><br>Có hiểu biết về kinh tế, chính trị, có các kiến thức cơ bản trong lĩnh vực khoa học xã hội và n...</code> |
1303
+ | <code>Ngành Kỹ thuật Dầu khí và Kỹ thuật Địa chất tập trung nghiên cứu và ứng dụng những lĩnh vực cốt lõi nào?</code> | <code>Các công ty nghiên cứu và khảo sát địa chất, tư vấn về nền móng công trình. Các tổ chức liên quan đến quy hoạch và phát triển đô thị. Kỹ thuật Dầu khí<br><br>Tổng quan<br><br>Kỹ thuật Dầu khí là ngành học chuyên nghiên cứu về các kỹ thuật khai thác, sản xuất và xử lý dầu khí. Sinh viên sẽ học các phương pháp khoan, khai thác dầu, khí tự nhiên, và xử lý các vấn đề kỹ thuật trong ngành dầu khí, từ việc tìm kiếm và khai thác tài nguyên cho đến việc tối ưu hóa quy trình sản xuất. CÁC ĐIỂM ĐẶC BIỆT<br><br>Khả năng ứng dụng cao: Sinh viên ngành Kỹ thuật Dầu khí sẽ được trang bị kiến thức thực tế về công nghệ khai thác dầu khí và các phương pháp tối ưu hóa sản xuất. Ngành công nghiệp chiến lược: Dầu khí vẫn là một trong những ngành công nghiệp mũi nhọn và cần nguồn nhân lực có trình độ cao trong việc khai thác và xử lý tài nguyên thiên nhiên. Triển vọng việc làm<br><br>Các công ty khai thác dầu khí trong nước và quốc tế. Các công ty tư vấn và kỹ thuật dầu khí, nghiên cứu các giải pháp tối ưu trong khai thác. Các côn...</code> |
1304
+ * Loss: [<code>MatryoshkaLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#matryoshkaloss) with these parameters:
1305
+ ```json
1306
+ {
1307
+ "loss": "MultipleNegativesRankingLoss",
1308
+ "matryoshka_dims": [
1309
+ 768,
1310
+ 512,
1311
+ 256,
1312
+ 12
1313
+ ],
1314
+ "matryoshka_weights": [
1315
+ 1,
1316
+ 1,
1317
+ 1,
1318
+ 1
1319
+ ],
1320
+ "n_dims_per_step": -1
1321
+ }
1322
+ ```
1323
+
1324
+ ### Training Hyperparameters
1325
+ #### Non-Default Hyperparameters
1326
+
1327
+ - `eval_strategy`: steps
1328
+ - `gradient_accumulation_steps`: 8
1329
+ - `learning_rate`: 2e-05
1330
+ - `num_train_epochs`: 30
1331
+ - `lr_scheduler_type`: cosine
1332
+ - `warmup_ratio`: 0.1
1333
+ - `bf16`: True
1334
+ - `tf32`: True
1335
+ - `dataloader_drop_last`: True
1336
+ - `dataloader_num_workers`: 8
1337
+ - `load_best_model_at_end`: True
1338
+ - `batch_sampler`: no_duplicates
1339
+
1340
+ #### All Hyperparameters
1341
+ <details><summary>Click to expand</summary>
1342
+
1343
+ - `overwrite_output_dir`: False
1344
+ - `do_predict`: False
1345
+ - `eval_strategy`: steps
1346
+ - `prediction_loss_only`: True
1347
+ - `per_device_train_batch_size`: 8
1348
+ - `per_device_eval_batch_size`: 8
1349
+ - `per_gpu_train_batch_size`: None
1350
+ - `per_gpu_eval_batch_size`: None
1351
+ - `gradient_accumulation_steps`: 8
1352
+ - `eval_accumulation_steps`: None
1353
+ - `torch_empty_cache_steps`: None
1354
+ - `learning_rate`: 2e-05
1355
+ - `weight_decay`: 0.0
1356
+ - `adam_beta1`: 0.9
1357
+ - `adam_beta2`: 0.999
1358
+ - `adam_epsilon`: 1e-08
1359
+ - `max_grad_norm`: 1.0
1360
+ - `num_train_epochs`: 30
1361
+ - `max_steps`: -1
1362
+ - `lr_scheduler_type`: cosine
1363
+ - `lr_scheduler_kwargs`: {}
1364
+ - `warmup_ratio`: 0.1
1365
+ - `warmup_steps`: 0
1366
+ - `log_level`: passive
1367
+ - `log_level_replica`: warning
1368
+ - `log_on_each_node`: True
1369
+ - `logging_nan_inf_filter`: True
1370
+ - `save_safetensors`: True
1371
+ - `save_on_each_node`: False
1372
+ - `save_only_model`: False
1373
+ - `restore_callback_states_from_checkpoint`: False
1374
+ - `no_cuda`: False
1375
+ - `use_cpu`: False
1376
+ - `use_mps_device`: False
1377
+ - `seed`: 42
1378
+ - `data_seed`: None
1379
+ - `jit_mode_eval`: False
1380
+ - `use_ipex`: False
1381
+ - `bf16`: True
1382
+ - `fp16`: False
1383
+ - `fp16_opt_level`: O1
1384
+ - `half_precision_backend`: auto
1385
+ - `bf16_full_eval`: False
1386
+ - `fp16_full_eval`: False
1387
+ - `tf32`: True
1388
+ - `local_rank`: 0
1389
+ - `ddp_backend`: None
1390
+ - `tpu_num_cores`: None
1391
+ - `tpu_metrics_debug`: False
1392
+ - `debug`: []
1393
+ - `dataloader_drop_last`: True
1394
+ - `dataloader_num_workers`: 8
1395
+ - `dataloader_prefetch_factor`: None
1396
+ - `past_index`: -1
1397
+ - `disable_tqdm`: False
1398
+ - `remove_unused_columns`: True
1399
+ - `label_names`: None
1400
+ - `load_best_model_at_end`: True
1401
+ - `ignore_data_skip`: False
1402
+ - `fsdp`: []
1403
+ - `fsdp_min_num_params`: 0
1404
+ - `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
1405
+ - `fsdp_transformer_layer_cls_to_wrap`: None
1406
+ - `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
1407
+ - `deepspeed`: None
1408
+ - `label_smoothing_factor`: 0.0
1409
+ - `optim`: adamw_torch_fused
1410
+ - `optim_args`: None
1411
+ - `adafactor`: False
1412
+ - `group_by_length`: False
1413
+ - `length_column_name`: length
1414
+ - `ddp_find_unused_parameters`: None
1415
+ - `ddp_bucket_cap_mb`: None
1416
+ - `ddp_broadcast_buffers`: False
1417
+ - `dataloader_pin_memory`: True
1418
+ - `dataloader_persistent_workers`: False
1419
+ - `skip_memory_metrics`: True
1420
+ - `use_legacy_prediction_loop`: False
1421
+ - `push_to_hub`: False
1422
+ - `resume_from_checkpoint`: None
1423
+ - `hub_model_id`: None
1424
+ - `hub_strategy`: every_save
1425
+ - `hub_private_repo`: None
1426
+ - `hub_always_push`: False
1427
+ - `hub_revision`: None
1428
+ - `gradient_checkpointing`: False
1429
+ - `gradient_checkpointing_kwargs`: None
1430
+ - `include_inputs_for_metrics`: False
1431
+ - `include_for_metrics`: []
1432
+ - `eval_do_concat_batches`: True
1433
+ - `fp16_backend`: auto
1434
+ - `push_to_hub_model_id`: None
1435
+ - `push_to_hub_organization`: None
1436
+ - `mp_parameters`:
1437
+ - `auto_find_batch_size`: False
1438
+ - `full_determinism`: False
1439
+ - `torchdynamo`: None
1440
+ - `ray_scope`: last
1441
+ - `ddp_timeout`: 1800
1442
+ - `torch_compile`: False
1443
+ - `torch_compile_backend`: None
1444
+ - `torch_compile_mode`: None
1445
+ - `include_tokens_per_second`: False
1446
+ - `include_num_input_tokens_seen`: False
1447
+ - `neftune_noise_alpha`: None
1448
+ - `optim_target_modules`: None
1449
+ - `batch_eval_metrics`: False
1450
+ - `eval_on_start`: False
1451
+ - `use_liger_kernel`: False
1452
+ - `liger_kernel_config`: None
1453
+ - `eval_use_gather_object`: False
1454
+ - `average_tokens_across_devices`: False
1455
+ - `prompts`: None
1456
+ - `batch_sampler`: no_duplicates
1457
+ - `multi_dataset_batch_sampler`: proportional
1458
+ - `router_mapping`: {}
1459
+ - `learning_rate_mapping`: {}
1460
+
1461
+ </details>
1462
+
1463
+ ### Training Logs
1464
+ | Epoch | Step | Training Loss | dim_768_cosine_ndcg@10 | dim_512_cosine_ndcg@10 | dim_256_cosine_ndcg@10 |
1465
+ |:-------:|:----:|:-------------:|:----------------------:|:----------------------:|:----------------------:|
1466
+ | -1 | -1 | - | 0.4980 | 0.4994 | 0.4823 |
1467
+ | 0.4348 | 10 | 3.6503 | 0.5158 | 0.5133 | 0.4978 |
1468
+ | 0.8696 | 20 | 2.7131 | 0.5417 | 0.5388 | 0.5257 |
1469
+ | 1.3043 | 30 | 2.2307 | 0.5621 | 0.5637 | 0.5534 |
1470
+ | 1.7391 | 40 | 2.1341 | 0.5831 | 0.5840 | 0.5757 |
1471
+ | 2.1739 | 50 | 1.8576 | 0.6081 | 0.6077 | 0.5999 |
1472
+ | 2.6087 | 60 | 1.4278 | 0.6271 | 0.6278 | 0.6192 |
1473
+ | 3.0435 | 70 | 1.3602 | 0.6396 | 0.6412 | 0.6335 |
1474
+ | 3.4783 | 80 | 1.1086 | 0.6528 | 0.6550 | 0.6490 |
1475
+ | 3.9130 | 90 | 0.9657 | 0.6675 | 0.6704 | 0.6658 |
1476
+ | 4.3478 | 100 | 0.7836 | 0.6811 | 0.6777 | 0.6750 |
1477
+ | 4.7826 | 110 | 0.6755 | 0.6892 | 0.6883 | 0.6881 |
1478
+ | 5.2174 | 120 | 0.6679 | 0.6935 | 0.6955 | 0.6968 |
1479
+ | 5.6522 | 130 | 0.7005 | 0.7054 | 0.7078 | 0.7084 |
1480
+ | 6.0870 | 140 | 0.5895 | 0.7161 | 0.7161 | 0.7154 |
1481
+ | 6.5217 | 150 | 0.4809 | 0.7233 | 0.7232 | 0.7205 |
1482
+ | 6.9565 | 160 | 0.5287 | 0.7240 | 0.7260 | 0.7249 |
1483
+ | 7.3913 | 170 | 0.4976 | 0.7375 | 0.7404 | 0.7372 |
1484
+ | 7.8261 | 180 | 0.3886 | 0.7390 | 0.7418 | 0.7404 |
1485
+ | 8.2609 | 190 | 0.5025 | 0.7481 | 0.7531 | 0.7516 |
1486
+ | 8.6957 | 200 | 0.4322 | 0.7531 | 0.7568 | 0.7604 |
1487
+ | 9.1304 | 210 | 0.3929 | 0.7563 | 0.7616 | 0.7607 |
1488
+ | 9.5652 | 220 | 0.3131 | 0.7561 | 0.7647 | 0.7648 |
1489
+ | 10.0 | 230 | 0.4091 | 0.7568 | 0.7592 | 0.7616 |
1490
+ | 10.4348 | 240 | 0.3219 | 0.7557 | 0.7604 | 0.7643 |
1491
+ | 10.8696 | 250 | 0.3227 | 0.7677 | 0.7728 | 0.7774 |
1492
+ | 11.3043 | 260 | 0.3406 | 0.7742 | 0.7800 | 0.7850 |
1493
+ | 11.7391 | 270 | 0.2998 | 0.7759 | 0.7816 | 0.7845 |
1494
+ | 12.1739 | 280 | 0.2681 | 0.7766 | 0.7824 | 0.7867 |
1495
+ | 12.6087 | 290 | 0.2621 | 0.7774 | 0.7840 | 0.7839 |
1496
+ | 13.0435 | 300 | 0.3037 | 0.7782 | 0.7817 | 0.7863 |
1497
+ | 13.4783 | 310 | 0.3236 | 0.7911 | 0.7949 | 0.7958 |
1498
+ | 13.9130 | 320 | 0.2847 | 0.7962 | 0.8013 | 0.8026 |
1499
+ | 14.3478 | 330 | 0.3139 | 0.7983 | 0.8007 | 0.8068 |
1500
+ | 14.7826 | 340 | 0.2783 | 0.7994 | 0.8025 | 0.8081 |
1501
+ | 15.2609 | 350 | 0.2623 | 0.8041 | 0.8087 | 0.8102 |
1502
+ | 15.6957 | 360 | 0.2617 | 0.8102 | 0.8105 | 0.8149 |
1503
+ | 16.1304 | 370 | 0.2566 | 0.8132 | 0.8177 | 0.8205 |
1504
+ | 16.5652 | 380 | 0.2296 | 0.8166 | 0.8206 | 0.8236 |
1505
+ | 17.0 | 390 | 0.2334 | 0.8179 | 0.8231 | 0.8236 |
1506
+ | 17.4348 | 400 | 0.2386 | 0.8205 | 0.8249 | 0.8274 |
1507
+ | 17.8696 | 410 | 0.1751 | 0.8241 | 0.8261 | 0.8300 |
1508
+ | 18.3043 | 420 | 0.2488 | 0.8229 | 0.8263 | 0.8323 |
1509
+ | 18.7391 | 430 | 0.239 | 0.8272 | 0.8294 | 0.8344 |
1510
+ | 19.1739 | 440 | 0.2231 | 0.8329 | 0.8335 | 0.8360 |
1511
+ | 19.6087 | 450 | 0.2516 | 0.8341 | 0.8352 | 0.8411 |
1512
+ | 20.0435 | 460 | 0.2544 | 0.8325 | 0.8385 | 0.8425 |
1513
+ | 20.4783 | 470 | 0.2082 | 0.8348 | 0.8407 | 0.8457 |
1514
+ | 20.9130 | 480 | 0.1868 | 0.8361 | 0.8414 | 0.8460 |
1515
+ | 21.3478 | 490 | 0.2454 | 0.8361 | 0.8437 | 0.8454 |
1516
+ | 21.7826 | 500 | 0.222 | 0.8343 | 0.8435 | 0.8462 |
1517
+ | 22.2174 | 510 | 0.1554 | 0.8348 | 0.8430 | 0.8461 |
1518
+ | 22.6522 | 520 | 0.14 | 0.8352 | 0.8416 | 0.8454 |
1519
+ | 23.0870 | 530 | 0.1867 | 0.8357 | 0.8422 | 0.8463 |
1520
+ | 23.5217 | 540 | 0.2078 | 0.8361 | 0.8441 | 0.8449 |
1521
+ | 23.9565 | 550 | 0.1929 | 0.8370 | 0.8437 | 0.8437 |
1522
+ | 24.3913 | 560 | 0.1776 | 0.8380 | 0.8435 | 0.8428 |
1523
+ | 24.8261 | 570 | 0.2524 | 0.8387 | 0.8448 | 0.8449 |
1524
+ | 25.2609 | 580 | 0.1914 | 0.8406 | 0.8465 | 0.8458 |
1525
+ | 25.6957 | 590 | 0.1841 | 0.8414 | 0.8468 | 0.8471 |
1526
+ | 26.1304 | 600 | 0.165 | 0.8423 | 0.8476 | 0.8468 |
1527
+ | 26.5652 | 610 | 0.1717 | 0.8417 | 0.8489 | 0.8492 |
1528
+ | 27.0 | 620 | 0.2091 | 0.8414 | 0.8488 | 0.8484 |
1529
+ | 27.4348 | 630 | 0.1889 | 0.8414 | 0.8487 | 0.8486 |
1530
+ | 27.8696 | 640 | 0.2025 | 0.8418 | 0.8486 | 0.8483 |
1531
+ | 28.3043 | 650 | 0.1722 | 0.8415 | 0.8490 | 0.8488 |
1532
+ | 28.7391 | 660 | 0.1621 | 0.8418 | 0.8483 | 0.8490 |
1533
+ | 29.1739 | 670 | 0.1651 | 0.8422 | 0.8481 | 0.8492 |
1534
+ | 29.6087 | 680 | 0.1837 | 0.8421 | 0.8484 | 0.8484 |
1535
+
1536
+
1537
+ ### Framework Versions
1538
+ - Python: 3.10.12
1539
+ - Sentence Transformers: 5.1.0
1540
+ - Transformers: 4.55.2
1541
+ - PyTorch: 2.8.0+cu128
1542
+ - Accelerate: 1.10.0
1543
+ - Datasets: 4.0.0
1544
+ - Tokenizers: 0.21.4
1545
+
1546
+ ## Citation
1547
+
1548
+ ### BibTeX
1549
+
1550
+ #### Sentence Transformers
1551
+ ```bibtex
1552
+ @inproceedings{reimers-2019-sentence-bert,
1553
+ title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
1554
+ author = "Reimers, Nils and Gurevych, Iryna",
1555
+ booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
1556
+ month = "11",
1557
+ year = "2019",
1558
+ publisher = "Association for Computational Linguistics",
1559
+ url = "https://arxiv.org/abs/1908.10084",
1560
+ }
1561
+ ```
1562
+
1563
+ #### MatryoshkaLoss
1564
+ ```bibtex
1565
+ @misc{kusupati2024matryoshka,
1566
+ title={Matryoshka Representation Learning},
1567
+ author={Aditya Kusupati and Gantavya Bhatt and Aniket Rege and Matthew Wallingford and Aditya Sinha and Vivek Ramanujan and William Howard-Snyder and Kaifeng Chen and Sham Kakade and Prateek Jain and Ali Farhadi},
1568
+ year={2024},
1569
+ eprint={2205.13147},
1570
+ archivePrefix={arXiv},
1571
+ primaryClass={cs.LG}
1572
+ }
1573
+ ```
1574
+
1575
+ #### MultipleNegativesRankingLoss
1576
+ ```bibtex
1577
+ @misc{henderson2017efficient,
1578
+ title={Efficient Natural Language Response Suggestion for Smart Reply},
1579
+ author={Matthew Henderson and Rami Al-Rfou and Brian Strope and Yun-hsuan Sung and Laszlo Lukacs and Ruiqi Guo and Sanjiv Kumar and Balint Miklos and Ray Kurzweil},
1580
+ year={2017},
1581
+ eprint={1705.00652},
1582
+ archivePrefix={arXiv},
1583
+ primaryClass={cs.CL}
1584
+ }
1585
+ ```
1586
+
1587
+ <!--
1588
+ ## Glossary
1589
+
1590
+ *Clearly define terms in order to be accessible across audiences.*
1591
+ -->
1592
+
1593
+ <!--
1594
+ ## Model Card Authors
1595
+
1596
+ *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
1597
+ -->
1598
+
1599
+ <!--
1600
+ ## Model Card Contact
1601
+
1602
+ *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
1603
+ -->
config.json ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "VietnameseModel"
4
+ ],
5
+ "attention_probs_dropout_prob": 0.0,
6
+ "auto_map": {
7
+ "AutoConfig": "configuration.VietnameseConfig",
8
+ "AutoModel": "modeling.VietnameseModel",
9
+ "AutoModelForMaskedLM": "dangvantuan/Vietnamese_impl--modeling.VietnameseForMaskedLM",
10
+ "AutoModelForMultipleChoice": "dangvantuan/Vietnamese_impl--modeling.VietnameseForMultipleChoice",
11
+ "AutoModelForQuestionAnswering": "dangvantuan/Vietnamese_impl--modeling.VietnameseForQuestionAnswering",
12
+ "AutoModelForSequenceClassification": "dangvantuan/Vietnamese_impl--modeling.VietnameseForSequenceClassification",
13
+ "AutoModelForTokenClassification": "dangvantuan/Vietnamese_impl--modeling.VietnameseForTokenClassification"
14
+ },
15
+ "classifier_dropout": 0.0,
16
+ "hidden_act": "gelu",
17
+ "hidden_dropout_prob": 0.1,
18
+ "hidden_size": 768,
19
+ "id2label": {
20
+ "0": "LABEL_0"
21
+ },
22
+ "initializer_range": 0.02,
23
+ "intermediate_size": 3072,
24
+ "label2id": {
25
+ "LABEL_0": 0
26
+ },
27
+ "layer_norm_eps": 1e-12,
28
+ "layer_norm_type": "layer_norm",
29
+ "logn_attention_clip1": false,
30
+ "logn_attention_scale": false,
31
+ "max_position_embeddings": 8192,
32
+ "model_type": "Vietnamese",
33
+ "num_attention_heads": 12,
34
+ "num_hidden_layers": 12,
35
+ "pack_qkv": true,
36
+ "pad_token_id": 1,
37
+ "position_embedding_type": "rope",
38
+ "rope_scaling": {
39
+ "factor": 8.0,
40
+ "type": "ntk"
41
+ },
42
+ "rope_theta": 20000,
43
+ "torch_dtype": "float32",
44
+ "transformers_version": "4.55.2",
45
+ "type_vocab_size": 1,
46
+ "unpad_inputs": false,
47
+ "use_memory_efficient_attention": false,
48
+ "vocab_size": 250048
49
+ }
config_sentence_transformers.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "__version__": {
3
+ "sentence_transformers": "5.1.0",
4
+ "transformers": "4.55.2",
5
+ "pytorch": "2.8.0+cu128"
6
+ },
7
+ "prompts": {
8
+ "query": "",
9
+ "document": ""
10
+ },
11
+ "default_prompt_name": null,
12
+ "model_type": "SentenceTransformer",
13
+ "similarity_fn_name": "cosine"
14
+ }
configuration.py ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # limitations under the License.
2
+ """ Vietnamese model configuration"""
3
+ from transformers.configuration_utils import PretrainedConfig
4
+ from transformers.utils import logging
5
+
6
+ logger = logging.get_logger(__name__)
7
+
8
+
9
+ class VietnameseConfig(PretrainedConfig):
10
+ r"""
11
+ This is the configuration class to store the configuration of a [`VietnameseModel`] or a [`TFVietnameseModel`]. It is used to
12
+ instantiate a Vietnamese model according to the specified arguments, defining the model architecture. Instantiating a
13
+ configuration with the defaults will yield a similar configuration to that of the Vietnamese
14
+ Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
15
+ documentation from [`PretrainedConfig`] for more information.
16
+ Args:
17
+ vocab_size (`int`, *optional*, defaults to 30522):
18
+ Vocabulary size of the Vietnamese model. Defines the number of different tokens that can be represented by the
19
+ `inputs_ids` passed when calling [`VietnameseModel`] or [`TFVietnameseModel`].
20
+ hidden_size (`int`, *optional*, defaults to 768):
21
+ Dimensionality of the encoder layers and the pooler layer.
22
+ num_hidden_layers (`int`, *optional*, defaults to 12):
23
+ Number of hidden layers in the Transformer encoder.
24
+ num_attention_heads (`int`, *optional*, defaults to 12):
25
+ Number of attention heads for each attention layer in the Transformer encoder.
26
+ intermediate_size (`int`, *optional*, defaults to 3072):
27
+ Dimensionality of the "intermediate" (often named feed-forward) layer in the Transformer encoder.
28
+ hidden_act (`str` or `Callable`, *optional*, defaults to `"gelu"`):
29
+ The non-linear activation function (function or string) in the encoder and pooler. If string, `"gelu"`,
30
+ `"relu"`, `"silu"` and `"gelu_Vietnamese"` are supported.
31
+ hidden_dropout_prob (`float`, *optional*, defaults to 0.1):
32
+ The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.
33
+ attention_probs_dropout_prob (`float`, *optional*, defaults to 0.1):
34
+ The dropout ratio for the attention probabilities.
35
+ max_position_embeddings (`int`, *optional*, defaults to 512):
36
+ The maximum sequence length that this model might ever be used with. Typically set this to something large
37
+ just in case (e.g., 512 or 1024 or 2048).
38
+ type_vocab_size (`int`, *optional*, defaults to 2):
39
+ The vocabulary size of the `token_type_ids` passed when calling [`VietnameseModel`] or [`TFVietnameseModel`].
40
+ initializer_range (`float`, *optional*, defaults to 0.02):
41
+ The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
42
+ layer_norm_eps (`float`, *optional*, defaults to 1e-12):
43
+ The epsilon used by the layer normalization layers.
44
+ position_embedding_type (`str`, *optional*, defaults to `"rope"`):
45
+ Type of position embedding. Choose one of `"absolute"`, `"rope"`.
46
+ rope_theta (`float`, *optional*, defaults to 10000.0):
47
+ The base period of the RoPE embeddings.
48
+ rope_scaling (`Dict`, *optional*):
49
+ Dictionary containing the scaling configuration for the RoPE embeddings. Currently supports two scaling
50
+ strategies: linear and dynamic. Their scaling factor must be a float greater than 1. The expected format is
51
+ `{"type": strategy name, "factor": scaling factor}`. When using this flag, don't update
52
+ `max_position_embeddings` to the expected new maximum. See the following thread for more information on how
53
+ these scaling strategies behave:
54
+ https://www.reddit.com/r/LocalLLaMA/comments/14mrgpr/dynamically_scaled_rope_further_increases/. This is an
55
+ experimental feature, subject to breaking API changes in future versions.
56
+ classifier_dropout (`float`, *optional*):
57
+ The dropout ratio for the classification head.
58
+ Examples:
59
+ """
60
+
61
+ model_type = "Vietnamese"
62
+
63
+ def __init__(
64
+ self,
65
+ vocab_size=30528,
66
+ hidden_size=768,
67
+ num_hidden_layers=12,
68
+ num_attention_heads=12,
69
+ intermediate_size=3072,
70
+ hidden_act="gelu",
71
+ hidden_dropout_prob=0.1,
72
+ attention_probs_dropout_prob=0.0,
73
+ max_position_embeddings=2048,
74
+ type_vocab_size=1,
75
+ initializer_range=0.02,
76
+ layer_norm_type='layer_norm',
77
+ layer_norm_eps=1e-12,
78
+ # pad_token_id=0,
79
+ position_embedding_type="rope",
80
+ rope_theta=10000.0,
81
+ rope_scaling=None,
82
+ classifier_dropout=None,
83
+ pack_qkv=True,
84
+ unpad_inputs=False,
85
+ use_memory_efficient_attention=False,
86
+ logn_attention_scale=False,
87
+ logn_attention_clip1=False,
88
+ **kwargs,
89
+ ):
90
+ super().__init__(**kwargs)
91
+
92
+ self.vocab_size = vocab_size
93
+ self.hidden_size = hidden_size
94
+ self.num_hidden_layers = num_hidden_layers
95
+ self.num_attention_heads = num_attention_heads
96
+ self.hidden_act = hidden_act
97
+ self.intermediate_size = intermediate_size
98
+ self.hidden_dropout_prob = hidden_dropout_prob
99
+ self.attention_probs_dropout_prob = attention_probs_dropout_prob
100
+ self.max_position_embeddings = max_position_embeddings
101
+ self.type_vocab_size = type_vocab_size
102
+ self.initializer_range = initializer_range
103
+ self.layer_norm_type = layer_norm_type
104
+ self.layer_norm_eps = layer_norm_eps
105
+ self.position_embedding_type = position_embedding_type
106
+ self.rope_theta = rope_theta
107
+ self.rope_scaling = rope_scaling
108
+ self.classifier_dropout = classifier_dropout
109
+
110
+ self.pack_qkv = pack_qkv
111
+ self.unpad_inputs = unpad_inputs
112
+ self.use_memory_efficient_attention = use_memory_efficient_attention
113
+ self.logn_attention_scale = logn_attention_scale
114
+ self.logn_attention_clip1 = logn_attention_clip1
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e79c50e3061acfed843b914359897a280664f5eb43410358687eaa4b1725dcd9
3
+ size 1221487872
modeling.py ADDED
@@ -0,0 +1,1319 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """PyTorch Vietnamese model."""
2
+ import math
3
+ from dataclasses import dataclass
4
+ from typing import List, Optional, Tuple, Union
5
+
6
+ import torch
7
+ import torch.utils.checkpoint
8
+ from torch import nn
9
+
10
+ from transformers.activations import ACT2FN
11
+ from transformers.modeling_outputs import (
12
+ BaseModelOutput,
13
+ BaseModelOutputWithPooling,
14
+ MaskedLMOutput,
15
+ MultipleChoiceModelOutput,
16
+ QuestionAnsweringModelOutput,
17
+ SequenceClassifierOutput,
18
+ ModelOutput,
19
+ )
20
+ from transformers.modeling_utils import PreTrainedModel
21
+ from transformers.utils import logging
22
+
23
+ try:
24
+ import xformers.ops as xops
25
+ except ImportError as e:
26
+ xops = None
27
+
28
+ from .configuration import VietnameseConfig
29
+
30
+
31
+ logger = logging.get_logger(__name__)
32
+
33
+
34
+ # Adapted from https://github.com/HazyResearch/flash-attention/blob/main/flash_attn/bert_padding.py
35
+ # Which was adapted from https://github.com/mlcommons/training_results_v1.1/blob/main/NVIDIA/benchmarks/bert/implementations/pytorch/padding.py
36
+ class IndexFirstAxis(torch.autograd.Function):
37
+ @staticmethod
38
+ def forward(ctx, input, indices):
39
+ ctx.save_for_backward(indices)
40
+ assert input.ndim >= 2
41
+ ctx.first_axis_dim, other_shape = input.shape[0], input.shape[1:]
42
+ second_dim = other_shape.numel()
43
+ return torch.gather(
44
+ input.view(ctx.first_axis_dim, second_dim),
45
+ 0,
46
+ indices.unsqueeze(-1).expand(indices.size(0), second_dim)
47
+ ).reshape(-1, *other_shape)
48
+
49
+ @staticmethod
50
+ def backward(ctx, grad_output):
51
+ (indices,) = ctx.saved_tensors
52
+ assert grad_output.ndim >= 2
53
+ other_shape = grad_output.shape[1:]
54
+ grad_output = grad_output.view(grad_output.size(0), other_shape.numel())
55
+ grad_input = torch.zeros(
56
+ [ctx.first_axis_dim, grad_output.shape[1]],
57
+ device=grad_output.device,
58
+ dtype=grad_output.dtype,
59
+ )
60
+ grad_input.scatter_(
61
+ 0, indices.unsqueeze(-1).expand(indices.size(0), grad_output.size(1)), grad_output
62
+ )
63
+ return grad_input.reshape(ctx.first_axis_dim, *other_shape), None
64
+
65
+
66
+ index_first_axis = IndexFirstAxis.apply
67
+
68
+
69
+ def unpad_input(hidden_states, attention_mask=None, indices=None):
70
+ """
71
+ Arguments:
72
+ hidden_states: (batch, seqlen, ...)
73
+ attention_mask: (batch, seqlen), bool / int, 1 means valid and 0 means not valid.
74
+ indices: (total_nnz), the indices of non-masked tokens from the flattened input sequence.
75
+ Return:
76
+ hidden_states: (total_nnz, ...), where total_nnz = number of tokens in selected in attention_mask.
77
+ """
78
+ if indices is None:
79
+ assert attention_mask is not None
80
+ indices = torch.nonzero(attention_mask.flatten(), as_tuple=False).flatten()
81
+
82
+ hidden_states = hidden_states.view(-1, *hidden_states.shape[2:])
83
+ return index_first_axis(hidden_states, indices)
84
+
85
+
86
+ class IndexPutFirstAxis(torch.autograd.Function):
87
+ @staticmethod
88
+ def forward(
89
+ ctx,
90
+ values: torch.Tensor,
91
+ indices: torch.Tensor,
92
+ first_axis_dim
93
+ ) -> torch.Tensor:
94
+ ctx.save_for_backward(indices)
95
+ assert indices.ndim == 1
96
+ assert values.ndim >= 2
97
+ output = torch.zeros(
98
+ first_axis_dim, *values.shape[1:], device=values.device, dtype=values.dtype
99
+ )
100
+ output[indices] = values
101
+ return output
102
+
103
+ @staticmethod
104
+ def backward(ctx, grad_output: torch.Tensor) -> Tuple[torch.Tensor, None, None]:
105
+ indices, = ctx.saved_tensors
106
+ grad_values = grad_output[indices]
107
+ return grad_values, None, None
108
+
109
+
110
+ index_put_first_axis = IndexPutFirstAxis.apply
111
+
112
+
113
+ def pad_input(inputs: torch.Tensor, indices: torch.Tensor, batch: int, seqlen: int) -> torch.Tensor:
114
+ """Add padding to sequences.
115
+ Arguments:
116
+ inputs: (total_nnz, ...), where total_nnz = number of tokens in selected in attention_mask.
117
+ indices: (total_nnz), `indices = torch.nonzero(attention_mask.flatten(), as_tuple=False).flatten()`
118
+ batch: int batch_size
119
+ seqlen: int max sequence length
120
+ Returns:
121
+ inputs: (batch, seqlen, ...)
122
+ """
123
+ output = index_put_first_axis(inputs, indices, batch * seqlen)
124
+ return output.view(batch, seqlen, *inputs.shape[1:])
125
+
126
+
127
+ def rotate_half(x):
128
+ """Rotates half the hidden dims of the input."""
129
+ x1 = x[..., : x.shape[-1] // 2]
130
+ x2 = x[..., x.shape[-1] // 2 :]
131
+ return torch.cat((-x2, x1), dim=-1)
132
+
133
+
134
+ def apply_rotary_pos_emb(q, k, cos, sin):
135
+ """Applies Rotary Position Embedding to the query and key tensors.
136
+ Args:
137
+ q (`torch.Tensor`): The query tensor.
138
+ k (`torch.Tensor`): The key tensor.
139
+ cos (`torch.Tensor`): The cosine part of the rotary embedding.
140
+ sin (`torch.Tensor`): The sine part of the rotary embedding.
141
+ Returns:
142
+ `tuple(torch.Tensor)` comprising of the query and key tensors rotated using the Rotary Position Embedding.
143
+ """
144
+ cos, sin = cos.to(q.dtype), sin.to(q.dtype)
145
+ q_embed = (q * cos) + (rotate_half(q) * sin)
146
+ k_embed = (k * cos) + (rotate_half(k) * sin)
147
+ return q_embed, k_embed
148
+
149
+
150
+ class RotaryEmbedding(torch.nn.Module):
151
+ def __init__(self, dim, max_position_embeddings=512, base=10000.0, device=None):
152
+ super().__init__()
153
+
154
+ self.dim = dim
155
+ self.max_position_embeddings = max_position_embeddings
156
+ self.base = base
157
+ inv_freq = 1.0 / (self.base ** (torch.arange(0, self.dim, 2).float().to(device) / self.dim))
158
+ self.register_buffer("inv_freq", inv_freq, persistent=False)
159
+
160
+ self._set_cos_sin_cache(
161
+ seq_len=max_position_embeddings, device=self.inv_freq.device, dtype=torch.get_default_dtype()
162
+ )
163
+
164
+ def _set_cos_sin_cache(self, seq_len, device, dtype):
165
+ self.max_seq_len_cached = seq_len
166
+ t = torch.arange(self.max_seq_len_cached, device=device, dtype=torch.float32)
167
+
168
+ freqs = torch.einsum("i,j->ij", t, self.inv_freq)
169
+ emb = torch.cat((freqs, freqs), dim=-1)
170
+ self.register_buffer("cos_cached", emb.cos().to(dtype), persistent=False)
171
+ self.register_buffer("sin_cached", emb.sin().to(dtype), persistent=False)
172
+
173
+ def forward(self, x, seq_len=None):
174
+ if seq_len > self.max_seq_len_cached:
175
+ self._set_cos_sin_cache(seq_len=seq_len, device=x.device, dtype=x.dtype)
176
+
177
+ return (
178
+ self.cos_cached[:seq_len, ...].to(dtype=x.dtype),
179
+ self.sin_cached[:seq_len, ...].to(dtype=x.dtype),
180
+ )
181
+
182
+
183
+ class NTKScalingRotaryEmbedding(RotaryEmbedding):
184
+ """RotaryEmbedding extended with fixed and mixed NTK scaling. https://kexue.fm/archives/9706 """
185
+
186
+ def __init__(self, dim, max_position_embeddings=512, base=10000, device=None, scaling_factor=1.0, mixed_b=None):
187
+ self.scaling_factor = scaling_factor
188
+ self.mixed_b = mixed_b
189
+ super().__init__(dim, max_position_embeddings, base, device)
190
+ max_position_embeddings = max_position_embeddings * self.scaling_factor
191
+ self._set_cos_sin_cache(max_position_embeddings, self.inv_freq.device, torch.get_default_dtype())
192
+
193
+ def _set_cos_sin_cache(self, seq_len, device, dtype):
194
+ self.max_seq_len_cached = seq_len
195
+
196
+ if seq_len > self.max_position_embeddings:
197
+ base = self.base * (self.scaling_factor if self.mixed_b is None else 1)
198
+ inv_freq = 1.0 / (base ** (torch.arange(0, self.dim, 2).float().to(device) / self.dim))
199
+
200
+ if self.mixed_b is None:
201
+ inv_freq = inv_freq / self.scaling_factor ** (2 / self.dim)
202
+ else:
203
+ a = torch.tensor(self.scaling_factor).log() / (self.dim / 2) ** self.mixed_b
204
+ lambda_1_m = (a * torch.arange(1, self.dim // 2 + 1).float().to(device) ** self.mixed_b).exp()
205
+ inv_freq = inv_freq / lambda_1_m
206
+
207
+ self.register_buffer("inv_freq", inv_freq, persistent=False)
208
+
209
+ t = torch.arange(self.max_seq_len_cached, device=device, dtype=torch.float32)
210
+
211
+ freqs = torch.einsum("i,j->ij", t, self.inv_freq)
212
+ emb = torch.cat((freqs, freqs), dim=-1)
213
+ self.register_buffer("cos_cached", emb.cos().to(dtype), persistent=False)
214
+ self.register_buffer("sin_cached", emb.sin().to(dtype), persistent=False)
215
+
216
+
217
+ class RMSNorm(nn.Module):
218
+ def __init__(self, hidden_size, eps=1e-6):
219
+ """
220
+ RMSNorm is equivalent to T5LayerNorm
221
+ """
222
+ super().__init__()
223
+ self.weight = nn.Parameter(torch.ones(hidden_size))
224
+ self.variance_epsilon = eps
225
+
226
+ def forward(self, hidden_states):
227
+ input_dtype = hidden_states.dtype
228
+ hidden_states = hidden_states.to(torch.float32)
229
+ variance = hidden_states.pow(2).mean(-1, keepdim=True)
230
+ hidden_states = hidden_states * torch.rsqrt(variance + self.variance_epsilon)
231
+ return self.weight * hidden_states.to(input_dtype)
232
+
233
+
234
+ LAYER_NORM = {
235
+ 'layer_norm': nn.LayerNorm,
236
+ 'rms_norm': RMSNorm
237
+ }
238
+
239
+
240
+ class VietnameseEmbeddings(nn.Module):
241
+ """
242
+ Embedding and Unpadding.
243
+ """
244
+
245
+ def __init__(self, config: VietnameseConfig):
246
+ super().__init__()
247
+ self.padding_idx = config.pad_token_id
248
+ self.word_embeddings = nn.Embedding(
249
+ config.vocab_size, config.hidden_size, padding_idx=self.padding_idx
250
+ )
251
+
252
+ self.position_embedding_type = config.position_embedding_type
253
+ if self.position_embedding_type == 'absolute':
254
+ self.position_embeddings = nn.Embedding(
255
+ config.max_position_embeddings, config.hidden_size, padding_idx=self.padding_idx
256
+ )
257
+ elif self.position_embedding_type == 'rope':
258
+ self._init_rope(config)
259
+ else:
260
+ raise ValueError
261
+
262
+ self.type_vocab_size = config.type_vocab_size
263
+ if self.type_vocab_size > 0:
264
+ self.token_type_embeddings = nn.Embedding(config.type_vocab_size, config.hidden_size)
265
+
266
+ self.LayerNorm = nn.LayerNorm(config.hidden_size, eps=config.layer_norm_eps)
267
+ self.dropout = nn.Dropout(config.hidden_dropout_prob)
268
+ self.register_buffer(
269
+ "position_ids", torch.arange(config.max_position_embeddings), persistent=False
270
+ )
271
+
272
+ def _init_rope(self, config):
273
+ kwargs = dict(
274
+ dim=int(config.hidden_size / config.num_attention_heads),
275
+ max_position_embeddings=config.max_position_embeddings,
276
+ base=config.rope_theta
277
+ )
278
+ if config.rope_scaling is None:
279
+ self.rotary_emb = RotaryEmbedding(**kwargs)
280
+ else:
281
+ kwargs.update(scaling_factor=config.rope_scaling["factor"])
282
+ scaling_type = config.rope_scaling["type"]
283
+ if scaling_type == 'ntk':
284
+ kwargs.update(mixed_b=config.rope_scaling.get('mixed_b', None))
285
+ self.rotary_emb = NTKScalingRotaryEmbedding(**kwargs)
286
+ else:
287
+ raise ValueError(f"Unknown RoPE scaling type {scaling_type}")
288
+
289
+ def forward(
290
+ self,
291
+ unpad_inputs: bool,
292
+ input_ids: Optional[torch.Tensor] = None,
293
+ attention_mask: Optional[torch.Tensor] = None,
294
+ length: Optional[List[int]] = None,
295
+ token_type_ids: Optional[torch.Tensor] = None,
296
+ position_ids: Optional[torch.Tensor] = None,
297
+ inputs_embeds: Optional[torch.Tensor] = None,
298
+ ) -> Tuple[torch.Tensor, torch.Tensor, Optional[Tuple], Optional[List[int]]]:
299
+ if inputs_embeds is None:
300
+ device, input_shape = input_ids.device, input_ids.shape
301
+ else:
302
+ device, input_shape = inputs_embeds.device, inputs_embeds.shape[:2]
303
+ batch_size, seq_length = input_shape
304
+
305
+ if attention_mask is None:
306
+ attention_mask = torch.ones(input_shape, device=device)
307
+ if length is not None:
308
+ for i, l in enumerate(length):
309
+ attention_mask[i, l:] = 0
310
+
311
+ if unpad_inputs:
312
+ attention_mask_bool = attention_mask.bool()
313
+ if length is None:
314
+ length = attention_mask.sum(-1).tolist()
315
+
316
+ if inputs_embeds is None:
317
+ if unpad_inputs:
318
+ input_ids = input_ids[attention_mask_bool].unsqueeze(0)
319
+ inputs_embeds = self.word_embeddings(input_ids)
320
+ else:
321
+ if unpad_inputs:
322
+ inputs_embeds = inputs_embeds[attention_mask_bool].unsqueeze(0)
323
+ embeddings = inputs_embeds
324
+
325
+ if position_ids is None:
326
+ if seq_length > self.position_ids.size(0):
327
+ self.register_buffer(
328
+ "position_ids", torch.arange(seq_length, device=embeddings.device), persistent=False
329
+ )
330
+ if unpad_inputs:
331
+ position_ids = torch.cat([self.position_ids[:l] for l in length]).unsqueeze(0)
332
+ else:
333
+ position_ids = self.position_ids[:seq_length].expand(batch_size, -1)
334
+ elif unpad_inputs:
335
+ position_ids = position_ids[attention_mask_bool].unsqueeze(0)
336
+
337
+ if self.position_embedding_type == 'rope':
338
+ rope_cos, rope_sin = self.rotary_emb(inputs_embeds, seq_len=seq_length)
339
+ rope_cos = rope_cos[position_ids].unsqueeze(2)
340
+ rope_sin = rope_sin[position_ids].unsqueeze(2)
341
+ rope_embeds = rope_cos, rope_sin
342
+ else:
343
+ rope_embeds = None
344
+
345
+ if self.type_vocab_size > 0:
346
+ if token_type_ids is None:
347
+ token_type_ids = position_ids.mul(0)
348
+ else:
349
+ if self.type_vocab_size < 2:
350
+ token_type_ids.mul_(0)
351
+ if unpad_inputs:
352
+ token_type_ids = token_type_ids[attention_mask_bool].unsqueeze(0)
353
+
354
+ token_type_embeddings = self.token_type_embeddings(token_type_ids)
355
+ embeddings = embeddings + token_type_embeddings
356
+
357
+ if self.position_embedding_type == "absolute":
358
+ position_embeddings = self.position_embeddings(position_ids)
359
+ embeddings = embeddings + position_embeddings
360
+
361
+ embeddings = self.LayerNorm(embeddings)
362
+ embeddings = self.dropout(embeddings)
363
+
364
+ return embeddings, attention_mask, rope_embeds, length
365
+
366
+
367
+ class VietnameseAttention(nn.Module):
368
+ def __init__(self, config: VietnameseConfig, pack_qkv=None, use_memory_efficient_attention=None):
369
+ super().__init__()
370
+ self.config = config
371
+ if config.hidden_size % config.num_attention_heads != 0 and not hasattr(config, "embedding_size"):
372
+ raise ValueError(
373
+ f"The hidden size ({config.hidden_size}) is not a multiple of the number of attention "
374
+ f"heads ({config.num_attention_heads})"
375
+ )
376
+
377
+ self.hidden_size = config.hidden_size
378
+ self.num_attention_heads = config.num_attention_heads
379
+ self.attention_head_size = int(config.hidden_size / config.num_attention_heads)
380
+ self.all_head_size = self.num_attention_heads * self.attention_head_size
381
+
382
+ if pack_qkv is None:
383
+ pack_qkv = config.pack_qkv
384
+ self.pack_qkv = pack_qkv
385
+
386
+ if self.pack_qkv:
387
+ self.qkv_proj = nn.Linear(config.hidden_size, self.all_head_size * 3, bias=True)
388
+ else:
389
+ self.q_proj = nn.Linear(config.hidden_size, self.all_head_size, bias=True)
390
+ self.k_proj = nn.Linear(config.hidden_size, self.all_head_size, bias=True)
391
+ self.v_proj = nn.Linear(config.hidden_size, self.all_head_size, bias=True)
392
+
393
+ self.dropout = nn.Dropout(config.attention_probs_dropout_prob)
394
+ self.o_proj = nn.Linear(config.hidden_size, config.hidden_size, bias=True)
395
+
396
+ if use_memory_efficient_attention is None:
397
+ use_memory_efficient_attention = self.config.use_memory_efficient_attention
398
+ self.use_memory_efficient_attention = use_memory_efficient_attention
399
+ self.memory_efficient_attention = None if xops is None else xops.memory_efficient_attention
400
+ if self.use_memory_efficient_attention:
401
+ assert self.memory_efficient_attention is not None, 'please install xformers'
402
+
403
+ def forward(
404
+ self,
405
+ hidden_states: torch.Tensor,
406
+ attention_bias: torch.FloatTensor,
407
+ rope_embeds: Optional[Tuple[torch.FloatTensor, torch.FloatTensor]] = None,
408
+ padding_inputs: Optional[Tuple] = None,
409
+ attention_scale: Optional[torch.FloatTensor] = None,
410
+ head_mask: Optional[torch.FloatTensor] = None,
411
+ output_attentions: Optional[bool] = False,
412
+ qkv_inputs: Optional[Tuple] = None,
413
+ ) -> Tuple[torch.Tensor, ...]:
414
+ shape_hd = (self.num_attention_heads, self.attention_head_size)
415
+ if self.pack_qkv and qkv_inputs is None:
416
+ qkv_pack = self.qkv_proj(hidden_states).split(self.all_head_size, dim=-1)
417
+ else:
418
+ if qkv_inputs is None:
419
+ qkv_inputs = (hidden_states, hidden_states, hidden_states)
420
+ qkv_pack = [
421
+ getattr(self, n + '_proj')(s) for s, n in zip(qkv_inputs, 'qkv')
422
+ ]
423
+ query_states, key_states, value_states = [t.view(t.shape[:-1] + shape_hd) for t in qkv_pack]
424
+
425
+ if self.config.position_embedding_type == 'rope':
426
+ query_states, key_states = apply_rotary_pos_emb(query_states, key_states, *rope_embeds)
427
+
428
+ dtype = query_states.dtype
429
+
430
+ if self.config.logn_attention_scale and attention_scale is not None:
431
+ query_states = query_states * attention_scale.to(dtype)
432
+
433
+ if padding_inputs is not None:
434
+ query_states = pad_input(query_states.squeeze(), *padding_inputs)
435
+ key_states = pad_input(key_states.squeeze(), *padding_inputs)
436
+ value_states = pad_input(value_states.squeeze(), *padding_inputs)
437
+
438
+ if self.use_memory_efficient_attention:
439
+ assert self.memory_efficient_attention is not None, "xformers is not loaded"
440
+ assert output_attentions is False, "memory_efficient_attention do not output attentions"
441
+ assert head_mask is None, "Not support yet"
442
+ attention_probs = None
443
+ if torch.is_tensor(attention_bias):
444
+ attention_bias = attention_bias.to(dtype)
445
+ context_layer = self.memory_efficient_attention(
446
+ query_states,
447
+ key_states,
448
+ value_states,
449
+ attn_bias=attention_bias,
450
+ p=self.dropout.p
451
+ )
452
+ else:
453
+ if output_attentions and isinstance(self, VietnameseSdpaAttention):
454
+ raise RuntimeError("SDPA do not output attentions")
455
+ context_layer, attention_probs = self._attention(
456
+ query_states, key_states, value_states, attention_bias, head_mask
457
+ )
458
+
459
+ if padding_inputs is not None:
460
+ context_layer = unpad_input(context_layer, indices=padding_inputs[0])
461
+
462
+ new_context_layer_shape = context_layer.size()[:-2] + (self.all_head_size,)
463
+ context_layer = context_layer.view(new_context_layer_shape)
464
+
465
+ attn_output = self.o_proj(context_layer)
466
+
467
+ outputs = (attn_output, attention_probs) if output_attentions else (attn_output,)
468
+ return outputs
469
+
470
+ def _attention(self, query_states, key_states, value_states, attention_bias, head_mask):
471
+ query_states = query_states.transpose(1, 2)
472
+ key_states = key_states.transpose(1, 2)
473
+ value_states = value_states.transpose(1, 2)
474
+ attention_scores = torch.matmul(query_states, key_states.transpose(-1, -2))
475
+
476
+ attention_scores = attention_scores / math.sqrt(self.attention_head_size)
477
+ if attention_bias is not None:
478
+ attention_scores = attention_scores + attention_bias
479
+
480
+ attention_probs = nn.functional.softmax(attention_scores, dim=-1)
481
+
482
+ if self.dropout.p > 0:
483
+ attention_probs = self.dropout(attention_probs)
484
+
485
+ if head_mask is not None:
486
+ attention_probs = attention_probs * head_mask
487
+
488
+ context_layer = torch.matmul(attention_probs, value_states)
489
+
490
+ context_layer = context_layer.permute(0, 2, 1, 3).contiguous()
491
+ return context_layer, attention_probs
492
+
493
+
494
+ class VietnameseSdpaAttention(VietnameseAttention):
495
+ """
496
+ Vietnamese attention module using torch.nn.functional.scaled_dot_product_attention. This module inherits from
497
+ `VietnameseAttention` as the weights of the module stays untouched. The only changes are on the forward pass to adapt to
498
+ SDPA API.
499
+ """
500
+ def __init__(self, config: VietnameseConfig, **kwargs):
501
+ super().__init__(config, **kwargs)
502
+
503
+ def _attention(self, query_states, key_states, value_states, attention_bias, head_mask):
504
+ attn_output = torch.nn.functional.scaled_dot_product_attention(
505
+ query_states.transpose(1, 2),
506
+ key_states.transpose(1, 2),
507
+ value_states.transpose(1, 2),
508
+ attn_mask=attention_bias,
509
+ dropout_p=self.dropout.p if self.training else 0.0,
510
+ )
511
+ attn_output = attn_output.permute(0, 2, 1, 3).contiguous()
512
+ return attn_output, None
513
+
514
+
515
+ Vietnamese_ATTENTION_CLASSES = {
516
+ "eager": VietnameseAttention,
517
+ "sdpa": VietnameseSdpaAttention,
518
+ }
519
+
520
+
521
+ class VietnameseGatedMLP(nn.Module):
522
+ """
523
+ GLU Variants Improve Transformer.
524
+ """
525
+
526
+ def __init__(self, config: VietnameseConfig):
527
+ super().__init__()
528
+ self.intermediate_size = config.intermediate_size
529
+ self.up_gate_proj = nn.Linear(config.hidden_size, self.intermediate_size * 2, bias=False)
530
+ self.down_proj = nn.Linear(self.intermediate_size, config.hidden_size, bias=True)
531
+ self.act_fn = ACT2FN[config.hidden_act]
532
+ if config.hidden_dropout_prob > 0:
533
+ self.hidden_dropout = nn.Dropout(config.hidden_dropout_prob)
534
+ else:
535
+ self.hidden_dropout = None
536
+
537
+ def forward(self, hidden_states):
538
+ up_gate = self.up_gate_proj(hidden_states)
539
+ up_states, gate = torch.split(up_gate, self.intermediate_size, dim=-1)
540
+ gate = self.act_fn(gate)
541
+ gated_states = gate * up_states
542
+ if self.hidden_dropout is not None:
543
+ gated_states = self.hidden_dropout(gated_states)
544
+ down_states = self.down_proj(gated_states)
545
+ return down_states
546
+
547
+
548
+ class VietnameseLayer(nn.Module):
549
+ def __init__(
550
+ self,
551
+ config: VietnameseConfig,
552
+ pack_qkv=None,
553
+ use_memory_efficient_attention=None,
554
+ attn_implementation=None
555
+ ):
556
+ super().__init__()
557
+ if attn_implementation is None:
558
+ attn_implementation = config._attn_implementation
559
+ if use_memory_efficient_attention is None:
560
+ use_memory_efficient_attention = config.use_memory_efficient_attention
561
+ if use_memory_efficient_attention:
562
+ if attn_implementation != 'eager':
563
+ logger.warning_once(f"Override {attn_implementation=} to 'eager' as {use_memory_efficient_attention=}")
564
+ attn_implementation = 'eager'
565
+ self.attention = Vietnamese_ATTENTION_CLASSES[attn_implementation](
566
+ config, pack_qkv=pack_qkv, use_memory_efficient_attention=use_memory_efficient_attention
567
+ )
568
+ self.mlp = VietnameseGatedMLP(config)
569
+
570
+ ln_class = LAYER_NORM[config.layer_norm_type]
571
+ self.attn_ln = ln_class(config.hidden_size, eps=config.layer_norm_eps)
572
+ self.mlp_ln = ln_class(config.hidden_size, eps=config.layer_norm_eps)
573
+
574
+ if config.hidden_dropout_prob > 0:
575
+ self.hidden_dropout = nn.Dropout(config.hidden_dropout_prob)
576
+ else:
577
+ self.hidden_dropout = None
578
+
579
+ def forward(
580
+ self,
581
+ hidden_states: torch.Tensor,
582
+ attention_bias: torch.FloatTensor,
583
+ rope_embeds: Optional[Tuple[torch.FloatTensor, torch.FloatTensor]] = None,
584
+ padding_inputs: Optional[Tuple] = None,
585
+ attention_scale: Optional[torch.FloatTensor] = None,
586
+ subset_indices: Optional[torch.LongTensor] = None,
587
+ head_mask: Optional[torch.FloatTensor] = None,
588
+ output_attentions: Optional[bool] = False,
589
+ qkv_inputs: Optional[Tuple] = None,
590
+ ) -> Tuple[torch.Tensor, ...]:
591
+ residual = hidden_states if qkv_inputs is None else qkv_inputs[0]
592
+ attention_outputs = self.attention(
593
+ hidden_states,
594
+ attention_bias,
595
+ rope_embeds,
596
+ padding_inputs,
597
+ attention_scale,
598
+ head_mask,
599
+ output_attentions=output_attentions,
600
+ qkv_inputs=qkv_inputs,
601
+ )
602
+ hidden_states = attention_outputs[0]
603
+ if self.hidden_dropout is not None:
604
+ hidden_states = self.hidden_dropout(hidden_states)
605
+ hidden_states = residual + hidden_states
606
+
607
+ if subset_indices is not None:
608
+ hidden_states = hidden_states[subset_indices]
609
+
610
+ hidden_states = self.attn_ln(hidden_states)
611
+
612
+ residual = hidden_states
613
+ hidden_states = self.mlp(hidden_states)
614
+ if self.hidden_dropout is not None:
615
+ hidden_states = self.hidden_dropout(hidden_states)
616
+ hidden_states = residual + hidden_states
617
+ hidden_states = self.mlp_ln(hidden_states)
618
+
619
+ outputs = (hidden_states,) + attention_outputs[1:]
620
+ return outputs
621
+
622
+
623
+ class VietnameseEncoder(nn.Module):
624
+ def __init__(self, config):
625
+ super().__init__()
626
+ self.config = config
627
+ self.layer = nn.ModuleList([VietnameseLayer(config) for _ in range(config.num_hidden_layers)])
628
+ self.gradient_checkpointing = False
629
+
630
+ def forward(
631
+ self,
632
+ hidden_states: torch.Tensor,
633
+ attention_bias: Optional[torch.FloatTensor] = None,
634
+ rope_embeds: Optional[Tuple[torch.FloatTensor, torch.FloatTensor]] = None,
635
+ padding_inputs: Optional[Tuple] = None,
636
+ attention_scale: Optional[torch.FloatTensor] = None,
637
+ subset_indices: Optional[torch.LongTensor] = None,
638
+ head_mask: Optional[torch.FloatTensor] = None,
639
+ output_attentions: Optional[bool] = False,
640
+ output_hidden_states: Optional[bool] = False,
641
+ return_dict: Optional[bool] = True,
642
+ ) -> Union[Tuple[torch.Tensor], BaseModelOutput]:
643
+ all_hidden_states = () if output_hidden_states else None
644
+ all_self_attentions = () if output_attentions else None
645
+
646
+ for i, layer_module in enumerate(self.layer):
647
+ if output_hidden_states:
648
+ all_hidden_states = all_hidden_states + (hidden_states,)
649
+
650
+ if i >= len(self.layer) - 1:
651
+ layer_subset_indices = subset_indices
652
+ else:
653
+ layer_subset_indices = None
654
+
655
+ layer_head_mask = head_mask[i] if head_mask is not None else None
656
+
657
+ if self.gradient_checkpointing and self.training:
658
+ layer_outputs = self._gradient_checkpointing_func(
659
+ layer_module.__call__,
660
+ hidden_states,
661
+ attention_bias,
662
+ rope_embeds,
663
+ padding_inputs,
664
+ attention_scale,
665
+ layer_subset_indices,
666
+ layer_head_mask,
667
+ )
668
+ else:
669
+ layer_outputs = layer_module(
670
+ hidden_states,
671
+ attention_bias,
672
+ rope_embeds,
673
+ padding_inputs,
674
+ attention_scale,
675
+ layer_subset_indices,
676
+ layer_head_mask,
677
+ output_attentions,
678
+ )
679
+
680
+ hidden_states = layer_outputs[0]
681
+ if output_attentions:
682
+ all_self_attentions = all_self_attentions + (layer_outputs[1],)
683
+
684
+ if output_hidden_states:
685
+ all_hidden_states = all_hidden_states + (hidden_states,)
686
+
687
+ if not return_dict:
688
+ return tuple(
689
+ v
690
+ for v in [
691
+ hidden_states,
692
+ all_hidden_states,
693
+ all_self_attentions,
694
+ ]
695
+ if v is not None
696
+ )
697
+ return BaseModelOutput(
698
+ last_hidden_state=hidden_states,
699
+ hidden_states=all_hidden_states,
700
+ attentions=all_self_attentions,
701
+ )
702
+
703
+
704
+ class VietnamesePooler(nn.Module):
705
+ def __init__(self, config):
706
+ super().__init__()
707
+ self.dense = nn.Linear(config.hidden_size, config.hidden_size)
708
+ self.activation = nn.Tanh()
709
+
710
+ def forward(self, hidden_states: torch.Tensor) -> torch.Tensor:
711
+ first_token_tensor = hidden_states[:, 0]
712
+ pooled_output = self.dense(first_token_tensor)
713
+ pooled_output = self.activation(pooled_output)
714
+ return pooled_output
715
+
716
+
717
+ class VietnamesePreTrainedModel(PreTrainedModel):
718
+ """
719
+ An abstract class to handle weights initialization and a simple interface for downloading and loading pretrained
720
+ models.
721
+ """
722
+
723
+ config_class = VietnameseConfig
724
+ base_model_prefix = "Vietnamese"
725
+ supports_gradient_checkpointing = True
726
+ _supports_sdpa = True
727
+
728
+ def _init_weights(self, module):
729
+ """Initialize the weights"""
730
+ if isinstance(module, nn.Linear):
731
+ module.weight.data.normal_(mean=0.0, std=self.config.initializer_range)
732
+ if module.bias is not None:
733
+ module.bias.data.zero_()
734
+ elif isinstance(module, nn.Embedding):
735
+ module.weight.data.normal_(mean=0.0, std=self.config.initializer_range)
736
+ if module.padding_idx is not None:
737
+ module.weight.data[module.padding_idx].zero_()
738
+ elif isinstance(module, nn.LayerNorm):
739
+ module.bias.data.zero_()
740
+ module.weight.data.fill_(1.0)
741
+
742
+
743
+ class VietnameseModel(VietnamesePreTrainedModel):
744
+ """
745
+ The bare Vietnamese Model transformer outputting raw hidden-states without any specific head on top.
746
+ """
747
+
748
+ def __init__(self, config: VietnameseConfig, add_pooling_layer=False):
749
+ super().__init__(config)
750
+ self.config = config
751
+
752
+ self.embeddings = VietnameseEmbeddings(config)
753
+ self.encoder = VietnameseEncoder(config)
754
+
755
+ self.pooler = VietnamesePooler(config) if add_pooling_layer else None
756
+
757
+ self.post_init()
758
+
759
+ def get_input_embeddings(self):
760
+ return self.embeddings.word_embeddings
761
+
762
+ def set_input_embeddings(self, value):
763
+ self.embeddings.word_embeddings = value
764
+
765
+ def forward(
766
+ self,
767
+ input_ids: Optional[torch.Tensor] = None,
768
+ attention_mask: Optional[torch.Tensor] = None,
769
+ length: Optional[List[int]] = None,
770
+ subset_indices: Optional[torch.LongTensor] = None,
771
+ token_type_ids: Optional[torch.Tensor] = None,
772
+ position_ids: Optional[torch.Tensor] = None,
773
+ head_mask: Optional[torch.Tensor] = None,
774
+ inputs_embeds: Optional[torch.Tensor] = None,
775
+ output_attentions: Optional[bool] = None,
776
+ output_hidden_states: Optional[bool] = None,
777
+ return_dict: Optional[bool] = None,
778
+ unpad_inputs: Optional[bool] = None,
779
+ ) -> Union[Tuple[torch.Tensor], BaseModelOutputWithPooling]:
780
+ r"""
781
+ length (`list` of length `batch_size`, *optional*):
782
+ If is `None`, return padded `last_hidden_state`.
783
+ subset_indices ():
784
+ pass
785
+ unpad_inputs (`bool`, *optional*):
786
+ pass
787
+ """
788
+ output_attentions = output_attentions if output_attentions is not None else self.config.output_attentions
789
+ output_hidden_states = (
790
+ output_hidden_states if output_hidden_states is not None else self.config.output_hidden_states
791
+ )
792
+ return_dict = return_dict if return_dict is not None else self.config.use_return_dict
793
+ unpad_inputs = unpad_inputs if unpad_inputs is not None else self.config.unpad_inputs
794
+ output_padded = length is None
795
+
796
+ if input_ids is not None and inputs_embeds is not None:
797
+ raise ValueError("You cannot specify both input_ids and inputs_embeds at the same time")
798
+ elif input_ids is not None:
799
+ self.warn_if_padding_and_no_attention_mask(input_ids, attention_mask)
800
+ input_shape = input_ids.size()
801
+ elif inputs_embeds is not None:
802
+ input_shape = inputs_embeds.size()[:-1]
803
+ else:
804
+ raise ValueError("You have to specify either input_ids or inputs_embeds")
805
+
806
+ (embedding_output, attention_mask, rope_embeds, length) = self.embeddings(
807
+ unpad_inputs,
808
+ input_ids=input_ids,
809
+ attention_mask=attention_mask,
810
+ length=length,
811
+ token_type_ids=token_type_ids,
812
+ position_ids=position_ids,
813
+ inputs_embeds=inputs_embeds
814
+ )
815
+
816
+ batch_size, seq_length = input_shape
817
+ if unpad_inputs and self.config.use_memory_efficient_attention:
818
+ attention_bias = xops.fmha.attn_bias.BlockDiagonalMask.from_seqlens(length)
819
+ else:
820
+ attention_bias = self.get_extended_attention_mask(attention_mask, input_shape)
821
+ if self.config.use_memory_efficient_attention:
822
+ attention_bias = attention_bias.expand(-1, self.config.num_attention_heads, seq_length, -1)
823
+
824
+ padding_inputs = None
825
+ if unpad_inputs and (output_padded or not self.config.use_memory_efficient_attention):
826
+ indices = torch.nonzero(attention_mask.flatten(), as_tuple=False).flatten()
827
+ if not self.config.use_memory_efficient_attention:
828
+ padding_inputs = (indices, *input_shape)
829
+
830
+ attention_scale = None
831
+ if self.config.logn_attention_scale:
832
+ logger.warning_once("TODO: logn_attention_scale")
833
+
834
+ encoder_outputs = self.encoder(
835
+ embedding_output,
836
+ attention_bias=attention_bias,
837
+ rope_embeds=rope_embeds,
838
+ padding_inputs=padding_inputs,
839
+ attention_scale=attention_scale,
840
+ subset_indices=subset_indices,
841
+ head_mask=head_mask,
842
+ output_attentions=output_attentions,
843
+ output_hidden_states=output_hidden_states,
844
+ return_dict=return_dict,
845
+ )
846
+ sequence_output = encoder_outputs[0]
847
+ if unpad_inputs and output_padded:
848
+ sequence_output = pad_input(
849
+ sequence_output.squeeze(), indices, batch_size, seq_length
850
+ )
851
+
852
+ pooled_output = self.pooler(sequence_output) if self.pooler is not None else None
853
+
854
+ if not return_dict:
855
+ return (sequence_output, pooled_output) + encoder_outputs[1:]
856
+
857
+ return BaseModelOutputWithPooling(
858
+ last_hidden_state=sequence_output,
859
+ pooler_output=pooled_output,
860
+ hidden_states=encoder_outputs.hidden_states,
861
+ attentions=encoder_outputs.attentions,
862
+ )
863
+
864
+
865
+ class VietnameseLMPredictionHead(nn.Module):
866
+ def __init__(self, config):
867
+ super().__init__()
868
+ self.dense = nn.Linear(config.hidden_size, config.hidden_size)
869
+ self.transform_act_fn = ACT2FN[config.hidden_act]
870
+ self.norm = nn.LayerNorm(config.hidden_size, eps=config.layer_norm_eps)
871
+
872
+ self.decoder = nn.Linear(config.hidden_size, config.vocab_size)
873
+
874
+ def forward(self, hidden_states):
875
+ hidden_states = self.dense(hidden_states)
876
+ hidden_states = self.transform_act_fn(hidden_states)
877
+ hidden_states = self.norm(hidden_states)
878
+ hidden_states = self.decoder(hidden_states)
879
+ return hidden_states
880
+
881
+
882
+ class VietnameseForMaskedLM(VietnamesePreTrainedModel):
883
+ _tied_weights_keys = ["lm_head.decoder.bias", "lm_head.decoder.weight"]
884
+
885
+ def __init__(self, config: VietnameseConfig):
886
+ super().__init__(config)
887
+ self.Vietnamese = VietnameseModel(config, add_pooling_layer=False)
888
+ self.lm_head = VietnameseLMPredictionHead(config)
889
+ self.loss_fct = nn.CrossEntropyLoss()
890
+
891
+ self.post_init()
892
+
893
+ def get_output_embeddings(self):
894
+ return self.lm_head.decoder
895
+
896
+ def set_output_embeddings(self, new_embeddings):
897
+ self.lm_head.decoder = new_embeddings
898
+
899
+ def forward(
900
+ self,
901
+ input_ids: Optional[torch.Tensor] = None,
902
+ attention_mask: Optional[torch.Tensor] = None,
903
+ token_type_ids: Optional[torch.Tensor] = None,
904
+ position_ids: Optional[torch.Tensor] = None,
905
+ head_mask: Optional[torch.Tensor] = None,
906
+ inputs_embeds: Optional[torch.Tensor] = None,
907
+ labels: Optional[torch.Tensor] = None,
908
+ output_attentions: Optional[bool] = None,
909
+ output_hidden_states: Optional[bool] = None,
910
+ return_dict: Optional[bool] = None,
911
+ unpad_inputs: Optional[bool] = None,
912
+ ) -> Union[Tuple[torch.Tensor], MaskedLMOutput]:
913
+ r"""
914
+ labels (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*):
915
+ Labels for computing the masked language modeling loss. Indices should be in `[-100, 0, ...,
916
+ config.vocab_size]` (see `input_ids` docstring) Tokens with indices set to `-100` are ignored (masked), the
917
+ loss is only computed for the tokens with labels in `[0, ..., config.vocab_size]`
918
+ """
919
+
920
+ return_dict = return_dict if return_dict is not None else self.config.use_return_dict
921
+
922
+ if labels is None or not self.Vietnamese.config.unpad_inputs:
923
+ length = None
924
+ subset_indices = None
925
+ else:
926
+ length = attention_mask.sum(-1).tolist()
927
+ labels = labels[attention_mask.bool()].unsqueeze(0)
928
+ subset_indices = labels > -100
929
+
930
+ outputs = self.Vietnamese(
931
+ input_ids,
932
+ attention_mask=attention_mask,
933
+ length=length,
934
+ subset_indices=subset_indices,
935
+ token_type_ids=token_type_ids,
936
+ position_ids=position_ids,
937
+ head_mask=head_mask,
938
+ inputs_embeds=inputs_embeds,
939
+ output_attentions=output_attentions,
940
+ output_hidden_states=output_hidden_states,
941
+ return_dict=return_dict,
942
+ unpad_inputs=unpad_inputs,
943
+ )
944
+
945
+ sequence_output = outputs[0]
946
+ prediction_scores = self.lm_head(sequence_output)
947
+
948
+ masked_lm_loss = None
949
+ if labels is not None:
950
+ if subset_indices is None:
951
+ mask = attention_mask.bool()
952
+ prediction_scores = prediction_scores[mask]
953
+ labels = labels[mask]
954
+ else:
955
+ labels = labels[subset_indices]
956
+ masked_lm_loss = self.loss_fct(prediction_scores, labels)
957
+
958
+ if not return_dict:
959
+ output = (prediction_scores,) + outputs[2:]
960
+ return ((masked_lm_loss,) + output) if masked_lm_loss is not None else output
961
+
962
+ return MaskedLMOutput(
963
+ loss=masked_lm_loss,
964
+ logits=prediction_scores,
965
+ hidden_states=outputs.hidden_states,
966
+ attentions=outputs.attentions,
967
+ )
968
+
969
+
970
+ class VietnameseForSequenceClassification(VietnamesePreTrainedModel):
971
+ def __init__(self, config):
972
+ super().__init__(config)
973
+ self.num_labels = config.num_labels
974
+ self.config = config
975
+
976
+ self.Vietnamese = VietnameseModel(config, add_pooling_layer=True)
977
+ classifier_dropout = (
978
+ config.classifier_dropout if config.classifier_dropout is not None else config.hidden_dropout_prob
979
+ )
980
+ self.dropout = nn.Dropout(classifier_dropout)
981
+ self.classifier = nn.Linear(config.hidden_size, config.num_labels)
982
+
983
+ self.post_init()
984
+
985
+ def forward(
986
+ self,
987
+ input_ids: Optional[torch.Tensor] = None,
988
+ attention_mask: Optional[torch.Tensor] = None,
989
+ token_type_ids: Optional[torch.Tensor] = None,
990
+ position_ids: Optional[torch.Tensor] = None,
991
+ head_mask: Optional[torch.Tensor] = None,
992
+ inputs_embeds: Optional[torch.Tensor] = None,
993
+ labels: Optional[torch.Tensor] = None,
994
+ output_attentions: Optional[bool] = None,
995
+ output_hidden_states: Optional[bool] = None,
996
+ return_dict: Optional[bool] = None,
997
+ unpad_inputs: Optional[bool] = None,
998
+ ) -> Union[Tuple[torch.Tensor], SequenceClassifierOutput]:
999
+ r"""
1000
+ labels (`torch.LongTensor` of shape `(batch_size,)`, *optional*):
1001
+ Labels for computing the sequence classification/regression loss. Indices should be in `[0, ...,
1002
+ config.num_labels - 1]`. If `config.num_labels == 1` a regression loss is computed (Mean-Square loss), If
1003
+ `config.num_labels > 1` a classification loss is computed (Cross-Entropy).
1004
+ """
1005
+ return_dict = return_dict if return_dict is not None else self.config.use_return_dict
1006
+
1007
+ outputs = self.Vietnamese(
1008
+ input_ids,
1009
+ attention_mask=attention_mask,
1010
+ token_type_ids=token_type_ids,
1011
+ position_ids=position_ids,
1012
+ head_mask=head_mask,
1013
+ inputs_embeds=inputs_embeds,
1014
+ output_attentions=output_attentions,
1015
+ output_hidden_states=output_hidden_states,
1016
+ return_dict=return_dict,
1017
+ unpad_inputs=unpad_inputs,
1018
+ )
1019
+
1020
+ pooled_output = outputs[1]
1021
+
1022
+ pooled_output = self.dropout(pooled_output)
1023
+ logits = self.classifier(pooled_output)
1024
+
1025
+ loss = None
1026
+ if labels is not None:
1027
+ if self.config.problem_type is None:
1028
+ if self.num_labels == 1:
1029
+ self.config.problem_type = "regression"
1030
+ elif self.num_labels > 1 and (labels.dtype == torch.long or labels.dtype == torch.int):
1031
+ self.config.problem_type = "single_label_classification"
1032
+ else:
1033
+ self.config.problem_type = "multi_label_classification"
1034
+
1035
+ if self.config.problem_type == "regression":
1036
+ loss_fct = nn.MSELoss()
1037
+ if self.num_labels == 1:
1038
+ loss = loss_fct(logits.squeeze(), labels.squeeze())
1039
+ else:
1040
+ loss = loss_fct(logits, labels)
1041
+ elif self.config.problem_type == "single_label_classification":
1042
+ loss_fct = nn.CrossEntropyLoss()
1043
+ loss = loss_fct(logits.view(-1, self.num_labels), labels.view(-1))
1044
+ elif self.config.problem_type == "multi_label_classification":
1045
+ loss_fct = nn.BCEWithLogitsLoss()
1046
+ loss = loss_fct(logits, labels)
1047
+
1048
+ if not return_dict:
1049
+ output = (logits,) + outputs[2:]
1050
+ return ((loss,) + output) if loss is not None else output
1051
+
1052
+ return SequenceClassifierOutput(
1053
+ loss=loss,
1054
+ logits=logits,
1055
+ hidden_states=outputs.hidden_states,
1056
+ attentions=outputs.attentions,
1057
+ )
1058
+
1059
+
1060
+ class VietnameseForMultipleChoice(VietnamesePreTrainedModel):
1061
+ def __init__(self, config):
1062
+ super().__init__(config)
1063
+
1064
+ self.Vietnamese = VietnameseModel(config, add_pooling_layer=True)
1065
+ classifier_dropout = (
1066
+ config.classifier_dropout if config.classifier_dropout is not None else config.hidden_dropout_prob
1067
+ )
1068
+ self.dropout = nn.Dropout(classifier_dropout)
1069
+ self.classifier = nn.Linear(config.hidden_size, 1)
1070
+
1071
+ self.post_init()
1072
+
1073
+ def forward(
1074
+ self,
1075
+ input_ids: Optional[torch.Tensor] = None,
1076
+ attention_mask: Optional[torch.Tensor] = None,
1077
+ token_type_ids: Optional[torch.Tensor] = None,
1078
+ position_ids: Optional[torch.Tensor] = None,
1079
+ head_mask: Optional[torch.Tensor] = None,
1080
+ inputs_embeds: Optional[torch.Tensor] = None,
1081
+ labels: Optional[torch.Tensor] = None,
1082
+ output_attentions: Optional[bool] = None,
1083
+ output_hidden_states: Optional[bool] = None,
1084
+ return_dict: Optional[bool] = None,
1085
+ unpad_inputs: Optional[bool] = None,
1086
+ ) -> Union[Tuple[torch.Tensor], MultipleChoiceModelOutput]:
1087
+ r"""
1088
+ labels (`torch.LongTensor` of shape `(batch_size,)`, *optional*):
1089
+ Labels for computing the multiple choice classification loss. Indices should be in `[0, ...,
1090
+ num_choices-1]` where `num_choices` is the size of the second dimension of the input tensors. (See
1091
+ `input_ids` above)
1092
+ """
1093
+ return_dict = return_dict if return_dict is not None else self.config.use_return_dict
1094
+ num_choices = input_ids.shape[1] if input_ids is not None else inputs_embeds.shape[1]
1095
+
1096
+ input_ids = input_ids.view(-1, input_ids.size(-1)) if input_ids is not None else None
1097
+ attention_mask = attention_mask.view(-1, attention_mask.size(-1)) if attention_mask is not None else None
1098
+ token_type_ids = token_type_ids.view(-1, token_type_ids.size(-1)) if token_type_ids is not None else None
1099
+ position_ids = position_ids.view(-1, position_ids.size(-1)) if position_ids is not None else None
1100
+ inputs_embeds = (
1101
+ inputs_embeds.view(-1, inputs_embeds.size(-2), inputs_embeds.size(-1))
1102
+ if inputs_embeds is not None
1103
+ else None
1104
+ )
1105
+
1106
+ outputs = self.Vietnamese(
1107
+ input_ids,
1108
+ attention_mask=attention_mask,
1109
+ token_type_ids=token_type_ids,
1110
+ position_ids=position_ids,
1111
+ head_mask=head_mask,
1112
+ inputs_embeds=inputs_embeds,
1113
+ output_attentions=output_attentions,
1114
+ output_hidden_states=output_hidden_states,
1115
+ return_dict=return_dict,
1116
+ unpad_inputs=unpad_inputs,
1117
+ )
1118
+
1119
+ pooled_output = outputs[1]
1120
+
1121
+ pooled_output = self.dropout(pooled_output)
1122
+ logits = self.classifier(pooled_output)
1123
+ reshaped_logits = logits.view(-1, num_choices)
1124
+
1125
+ loss = None
1126
+ if labels is not None:
1127
+ loss_fct = nn.CrossEntropyLoss()
1128
+ loss = loss_fct(reshaped_logits, labels)
1129
+
1130
+ if not return_dict:
1131
+ output = (reshaped_logits,) + outputs[2:]
1132
+ return ((loss,) + output) if loss is not None else output
1133
+
1134
+ return MultipleChoiceModelOutput(
1135
+ loss=loss,
1136
+ logits=reshaped_logits,
1137
+ hidden_states=outputs.hidden_states,
1138
+ attentions=outputs.attentions,
1139
+ )
1140
+
1141
+
1142
+ @dataclass
1143
+ class VietnameseTokenClassifierOutput(ModelOutput):
1144
+ loss: Optional[torch.FloatTensor] = None
1145
+ logits: torch.FloatTensor = None
1146
+ last_hidden_state: torch.FloatTensor = None
1147
+ hidden_states: Optional[Tuple[torch.FloatTensor, ...]] = None
1148
+ attentions: Optional[Tuple[torch.FloatTensor, ...]] = None
1149
+
1150
+
1151
+ class VietnameseForTokenClassification(VietnamesePreTrainedModel):
1152
+ def __init__(self, config):
1153
+ super().__init__(config)
1154
+ self.num_labels = config.num_labels
1155
+
1156
+ self.Vietnamese = VietnameseModel(config, add_pooling_layer=False)
1157
+ classifier_dropout = (
1158
+ config.classifier_dropout if config.classifier_dropout is not None else config.hidden_dropout_prob
1159
+ )
1160
+ self.dropout = nn.Dropout(classifier_dropout)
1161
+ self.classifier = nn.Linear(config.hidden_size, config.num_labels)
1162
+
1163
+ self.post_init()
1164
+
1165
+ def forward(
1166
+ self,
1167
+ input_ids: Optional[torch.Tensor] = None,
1168
+ attention_mask: Optional[torch.Tensor] = None,
1169
+ token_type_ids: Optional[torch.Tensor] = None,
1170
+ position_ids: Optional[torch.Tensor] = None,
1171
+ head_mask: Optional[torch.Tensor] = None,
1172
+ inputs_embeds: Optional[torch.Tensor] = None,
1173
+ labels: Optional[torch.Tensor] = None,
1174
+ output_attentions: Optional[bool] = None,
1175
+ output_hidden_states: Optional[bool] = None,
1176
+ return_dict: Optional[bool] = None,
1177
+ unpad_inputs: Optional[bool] = None,
1178
+ ) -> Union[Tuple[torch.Tensor], VietnameseTokenClassifierOutput]:
1179
+ r"""
1180
+ labels (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*):
1181
+ Labels for computing the token classification loss. Indices should be in `[0, ..., config.num_labels - 1]`.
1182
+ """
1183
+ return_dict = return_dict if return_dict is not None else self.config.use_return_dict
1184
+
1185
+ outputs = self.Vietnamese(
1186
+ input_ids,
1187
+ attention_mask=attention_mask,
1188
+ token_type_ids=token_type_ids,
1189
+ position_ids=position_ids,
1190
+ head_mask=head_mask,
1191
+ inputs_embeds=inputs_embeds,
1192
+ output_attentions=output_attentions,
1193
+ output_hidden_states=output_hidden_states,
1194
+ return_dict=return_dict,
1195
+ unpad_inputs=unpad_inputs,
1196
+ )
1197
+
1198
+ sequence_output = outputs[0]
1199
+
1200
+ sequence_output = self.dropout(sequence_output)
1201
+ logits = self.classifier(sequence_output)
1202
+
1203
+ loss = None
1204
+ if labels is not None:
1205
+ loss_fct = nn.CrossEntropyLoss()
1206
+ loss = loss_fct(logits.view(-1, self.num_labels), labels.view(-1))
1207
+
1208
+ if not return_dict:
1209
+ output = (logits,) + outputs[2:]
1210
+ return ((loss,) + output) if loss is not None else output
1211
+
1212
+ return VietnameseTokenClassifierOutput(
1213
+ loss=loss,
1214
+ logits=logits,
1215
+ last_hidden_state=sequence_output,
1216
+ hidden_states=outputs.hidden_states,
1217
+ attentions=outputs.attentions,
1218
+ )
1219
+
1220
+
1221
+ class VietnameseForQuestionAnswering(VietnamesePreTrainedModel):
1222
+ def __init__(self, config):
1223
+ super().__init__(config)
1224
+ self.num_labels = config.num_labels
1225
+
1226
+ self.Vietnamese = VietnameseModel(config, add_pooling_layer=False)
1227
+ self.qa_outputs = nn.Linear(config.hidden_size, config.num_labels)
1228
+
1229
+ self.post_init()
1230
+
1231
+ def forward(
1232
+ self,
1233
+ input_ids: Optional[torch.Tensor] = None,
1234
+ attention_mask: Optional[torch.Tensor] = None,
1235
+ token_type_ids: Optional[torch.Tensor] = None,
1236
+ position_ids: Optional[torch.Tensor] = None,
1237
+ head_mask: Optional[torch.Tensor] = None,
1238
+ inputs_embeds: Optional[torch.Tensor] = None,
1239
+ start_positions: Optional[torch.Tensor] = None,
1240
+ end_positions: Optional[torch.Tensor] = None,
1241
+ output_attentions: Optional[bool] = None,
1242
+ output_hidden_states: Optional[bool] = None,
1243
+ return_dict: Optional[bool] = None,
1244
+ unpad_inputs: Optional[bool] = None,
1245
+ ) -> Union[Tuple[torch.Tensor], QuestionAnsweringModelOutput]:
1246
+ r"""
1247
+ start_positions (`torch.LongTensor` of shape `(batch_size,)`, *optional*):
1248
+ Labels for position (index) of the start of the labelled span for computing the token classification loss.
1249
+ Positions are clamped to the length of the sequence (`sequence_length`). Position outside of the sequence
1250
+ are not taken into account for computing the loss.
1251
+ end_positions (`torch.LongTensor` of shape `(batch_size,)`, *optional*):
1252
+ Labels for position (index) of the end of the labelled span for computing the token classification loss.
1253
+ Positions are clamped to the length of the sequence (`sequence_length`). Position outside of the sequence
1254
+ are not taken into account for computing the loss.
1255
+ """
1256
+ return_dict = return_dict if return_dict is not None else self.config.use_return_dict
1257
+
1258
+ outputs = self.Vietnamese(
1259
+ input_ids,
1260
+ attention_mask=attention_mask,
1261
+ token_type_ids=token_type_ids,
1262
+ position_ids=position_ids,
1263
+ head_mask=head_mask,
1264
+ inputs_embeds=inputs_embeds,
1265
+ output_attentions=output_attentions,
1266
+ output_hidden_states=output_hidden_states,
1267
+ return_dict=return_dict,
1268
+ unpad_inputs=unpad_inputs,
1269
+ )
1270
+
1271
+ sequence_output = outputs[0]
1272
+
1273
+ logits = self.qa_outputs(sequence_output)
1274
+ start_logits, end_logits = logits.split(1, dim=-1)
1275
+ start_logits = start_logits.squeeze(-1).contiguous()
1276
+ end_logits = end_logits.squeeze(-1).contiguous()
1277
+
1278
+ total_loss = None
1279
+ if start_positions is not None and end_positions is not None:
1280
+ if len(start_positions.size()) > 1:
1281
+ start_positions = start_positions.squeeze(-1)
1282
+ if len(end_positions.size()) > 1:
1283
+ end_positions = end_positions.squeeze(-1)
1284
+ ignored_index = start_logits.size(1)
1285
+ start_positions = start_positions.clamp(0, ignored_index)
1286
+ end_positions = end_positions.clamp(0, ignored_index)
1287
+
1288
+ loss_fct = nn.CrossEntropyLoss(ignore_index=ignored_index)
1289
+ start_loss = loss_fct(start_logits, start_positions)
1290
+ end_loss = loss_fct(end_logits, end_positions)
1291
+ total_loss = (start_loss + end_loss) / 2
1292
+
1293
+ if not return_dict:
1294
+ output = (start_logits, end_logits) + outputs[2:]
1295
+ return ((total_loss,) + output) if total_loss is not None else output
1296
+
1297
+ return QuestionAnsweringModelOutput(
1298
+ loss=total_loss,
1299
+ start_logits=start_logits,
1300
+ end_logits=end_logits,
1301
+ hidden_states=outputs.hidden_states,
1302
+ attentions=outputs.attentions,
1303
+ )
1304
+
1305
+
1306
+
1307
+
1308
+ def create_position_ids_from_input_ids(input_ids, padding_idx, past_key_values_length=0):
1309
+ """
1310
+ Replace non-padding symbols with their position numbers. Position numbers begin at padding_idx+1. Padding symbols
1311
+ are ignored. This is modified from fairseq's `utils.make_positions`.
1312
+ Args:
1313
+ x: torch.Tensor x:
1314
+ Returns: torch.Tensor
1315
+ """
1316
+ # The series of casts and type-conversions here are carefully balanced to both work with ONNX export and XLA.
1317
+ mask = input_ids.ne(padding_idx).int()
1318
+ incremental_indices = (torch.cumsum(mask, dim=1).type_as(mask) + past_key_values_length) * mask
1319
+ return incremental_indices.long() + padding_idx
modules.json ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "idx": 0,
4
+ "name": "0",
5
+ "path": "",
6
+ "type": "sentence_transformers.models.Transformer"
7
+ },
8
+ {
9
+ "idx": 1,
10
+ "name": "1",
11
+ "path": "1_Pooling",
12
+ "type": "sentence_transformers.models.Pooling"
13
+ },
14
+ {
15
+ "idx": 2,
16
+ "name": "2",
17
+ "path": "2_Normalize",
18
+ "type": "sentence_transformers.models.Normalize"
19
+ }
20
+ ]
sentence_bert_config.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "max_seq_length": 8192,
3
+ "do_lower_case": false
4
+ }
special_tokens_map.json ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "<s>",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "cls_token": {
10
+ "content": "<s>",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "eos_token": {
17
+ "content": "</s>",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ },
23
+ "mask_token": {
24
+ "content": "<mask>",
25
+ "lstrip": true,
26
+ "normalized": false,
27
+ "rstrip": false,
28
+ "single_word": false
29
+ },
30
+ "pad_token": {
31
+ "content": "<pad>",
32
+ "lstrip": false,
33
+ "normalized": false,
34
+ "rstrip": false,
35
+ "single_word": false
36
+ },
37
+ "sep_token": {
38
+ "content": "</s>",
39
+ "lstrip": false,
40
+ "normalized": false,
41
+ "rstrip": false,
42
+ "single_word": false
43
+ },
44
+ "unk_token": {
45
+ "content": "<unk>",
46
+ "lstrip": false,
47
+ "normalized": false,
48
+ "rstrip": false,
49
+ "single_word": false
50
+ }
51
+ }
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:aa7a6ad87a7ce8fe196787355f6af7d03aee94d19c54a5eb1392ed18c8ef451a
3
+ size 17082988
tokenizer_config.json ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "0": {
4
+ "content": "<s>",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ },
11
+ "1": {
12
+ "content": "<pad>",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "2": {
20
+ "content": "</s>",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "3": {
28
+ "content": "<unk>",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "250001": {
36
+ "content": "<mask>",
37
+ "lstrip": true,
38
+ "normalized": false,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ }
43
+ },
44
+ "bos_token": "<s>",
45
+ "clean_up_tokenization_spaces": true,
46
+ "cls_token": "<s>",
47
+ "eos_token": "</s>",
48
+ "extra_special_tokens": {},
49
+ "mask_token": "<mask>",
50
+ "max_length": 8192,
51
+ "model_max_length": 8192,
52
+ "pad_to_multiple_of": null,
53
+ "pad_token": "<pad>",
54
+ "pad_token_type_id": 0,
55
+ "padding_side": "right",
56
+ "sep_token": "</s>",
57
+ "stride": 0,
58
+ "tokenizer_class": "XLMRobertaTokenizerFast",
59
+ "truncation_side": "right",
60
+ "truncation_strategy": "longest_first",
61
+ "unk_token": "<unk>"
62
+ }