Add new SentenceTransformer model
Browse files- .gitattributes +1 -0
- 1_Pooling/config.json +10 -0
- README.md +1688 -0
- config.json +49 -0
- config_sentence_transformers.json +14 -0
- configuration.py +114 -0
- model.safetensors +3 -0
- modeling.py +1319 -0
- modules.json +20 -0
- sentence_bert_config.json +4 -0
- special_tokens_map.json +51 -0
- tokenizer.json +3 -0
- tokenizer_config.json +62 -0
.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,1688 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
tags:
|
3 |
+
- sentence-transformers
|
4 |
+
- sentence-similarity
|
5 |
+
- feature-extraction
|
6 |
+
- dense
|
7 |
+
- generated_from_trainer
|
8 |
+
- dataset_size:500
|
9 |
+
- loss:MatryoshkaLoss
|
10 |
+
- loss:MultipleNegativesRankingLoss
|
11 |
+
base_model: dangvantuan/vietnamese-document-embedding
|
12 |
+
widget:
|
13 |
+
- source_sentence: Thí sinh cần đáp ứng điều kiện tiếng Anh tối thiểu nào cho các
|
14 |
+
chương trình giảng dạy bằng tiếng Anh và các phương thức xét tuyển cụ thể mà Đại
|
15 |
+
học Bách khoa TP HCM áp dụng trong năm 2022 là gì?
|
16 |
+
sentences:
|
17 |
+
- 'Trong đề án tuyển sinh năm 2022, ĐH Bách khoa (ĐH Quốc gia TP HCM) thống nhất
|
18 |
+
tuyển sinh bằng 05 phương thức xét tuyển và mở thêm ngành mới đó là ngành Kỹ thuật
|
19 |
+
vật liệu (chương trình chất lượng cao giảng dạy bằng tiếng Anh) nhằm ngành Phục
|
20 |
+
vụ chiến lược phát triển ngành vật liệu hiện đại, tiên tiến theo đúng chuẩn mực
|
21 |
+
quốc tế. Năm 2022, trường đào tạo 35 ngành chương trình đại trà, 15 ngành tài
|
22 |
+
năng, PFIEV – 8 ngành Việt – Pháp, 19 ngành chương trình chất lượng cao- tiên
|
23 |
+
tiến, 9 ngành chương trình chuyển tiếp quốc tế, chương trình chất lượng cao tăng
|
24 |
+
cường tiếng Nhật,…
|
25 |
+
|
26 |
+
|
27 |
+
Dự kiến phương thức chủ đạo trong kỳ tuyển sinh năm 2022 là tuyển sinh theo hình
|
28 |
+
thức kết hợp các các tiêu chí để đánh giá toàn diện năng lực thí sinh bao gồm:
|
29 |
+
Năng lực học tập, các hoạt động xã hội, các hoạt động văn thể mỹ, bài luận, thư
|
30 |
+
giới thiệu, phòng vấn. Cụ thể, năng lực học tập bao gồm kết quả THPT, kết quả
|
31 |
+
kỳ thi tốt nghiệp THPT, kết quả kỳ thi đánh giá năng lực,…và các chứng chỉ tuyển
|
32 |
+
sinh quốc tế, chứng chỉ ngoại ngữ. Trường ĐH Bách khoa (ĐH Quốc gia TP HCM) cho
|
33 |
+
rằng kết quả kỳ thi đánh giá năng lực là một thành tố quan trọng để đánh giá toàn
|
34 |
+
diện năng lực học tập tại trường của thí sinh. Đối với chương trình giảng dạy
|
35 |
+
bằng tiếng Anh (chất lượng cao, tiên tiến, chuyển tiếp quốc tế) thí sinh cần đạt
|
36 |
+
điều kiện tiếng Anh sơ tuyển tối thiểu IELTS 4.5 hoặc đạt yêu cầu trong kỳ thi
|
37 |
+
sơ tuyển tiếng Anh của nhà trường. Các phương thức xét tuyển của ĐH Bách khoa
|
38 |
+
(ĐH Quốc gia TP HCM):
|
39 |
+
|
40 |
+
|
41 |
+
– Phương thức 1: Xét tuyển thẳng theo quy chế tuyển sinh của Bộ GD&ĐT và : 1%
|
42 |
+
~ 5% tổng chỉ tiêu. – Phương thức 2: Ưu tiên xét tuyển thẳng (UTXTT) và Ưu tiên
|
43 |
+
xét tuyển (UTXT) theo quy định của ĐHQG-HCM: 15% ~ 20% tổng chỉ tiêu. – Phương
|
44 |
+
thức 3: Xét tuyển thí sinh có chứng chỉ tuyển sinh quốc tế hoặc thí sinh người
|
45 |
+
nước ngoài: 1% ~ 5% tổng chỉ tiêu
|
46 |
+
|
47 |
+
|
48 |
+
– Phương thức 4: Xét tuyển theo kết quả THPT kết hợp phỏng vấn đối với thí sinh
|
49 |
+
dự tính du học nước ngoài: 1% ~ 5% tổng chỉ tiêu. – Phương thức 5: Xét tuyển tổng
|
50 |
+
hợp bao gồm các tiêu chí về học lực (kết quả kỳ thi đánh giá năng lực của ĐHQG-HCM,
|
51 |
+
kết quả kỳ thi tốt nghiệp THPT 2022, kết quả quá trình học tập THPT, Năng lực
|
52 |
+
khác, Hoạt động xã hội): 25% ~ 90% tổng chỉ tiêu. Năm 2022, nhà trường chú trọng
|
53 |
+
xây dựng lộ trình cho chương trình kỹ sư và thạc sĩ với mô hình chuyên sâu đặc
|
54 |
+
thù nhằm cung ứng cho thị trường các chuyên gia trong lĩnh vực khoa học – kỹ thuật
|
55 |
+
có trình độ cao. Lộ trình đào tạo được rút gọn trong 5 – 5.5 năm với 180 tín chỉ.'
|
56 |
+
- 'Ngành: Sư phạm tiếng Anh
|
57 |
+
|
58 |
+
|
59 |
+
Mã ngành: 7140231D, Tổ hợp: (D01, D96), Điểm chuẩn: 26.08
|
60 |
+
|
61 |
+
|
62 |
+
2. Ngành: Thiết kế đồ họa
|
63 |
+
|
64 |
+
|
65 |
+
Mã ngành: 7210403D, Tổ hợp: (V01, V02, V07, V08), Điểm chuẩn: 24.50
|
66 |
+
|
67 |
+
|
68 |
+
3. Ngành: Thiết kế thời trang
|
69 |
+
|
70 |
+
|
71 |
+
Mã ngành: 7210404D, Tổ hợp: (V01, V02, V07, V09), Điểm chuẩn: 21.50
|
72 |
+
|
73 |
+
|
74 |
+
4. Ngành: Ngôn ngữ Anh
|
75 |
+
|
76 |
+
|
77 |
+
Mã ngành: 7220201D, Tổ hợp: (A00, A01, D01, D96), Điểm chuẩn: 22.75
|
78 |
+
|
79 |
+
|
80 |
+
5. Ngành: Kinh doanh Quốc tế
|
81 |
+
|
82 |
+
|
83 |
+
Mã ngành: 7340120D, Tổ hợp: (A00, A01, D01, D90), Điểm chuẩn: 25.25
|
84 |
+
|
85 |
+
|
86 |
+
6. Ngành: Thương mại điện tử
|
87 |
+
|
88 |
+
|
89 |
+
Mã ngành: 7340122D, Tổ hợp: (A00, A01, D01, D90), Điểm chuẩn: 25.25
|
90 |
+
|
91 |
+
|
92 |
+
7. Ngành: Kế toán
|
93 |
+
|
94 |
+
|
95 |
+
Mã ngành: 7340301D, Tổ hợp: (A00, A01, D01, D90), Điểm chuẩn: 23.25
|
96 |
+
|
97 |
+
|
98 |
+
8. Ngành: Công nghệ kỹ thuật máy tính
|
99 |
+
|
100 |
+
|
101 |
+
Mã ngành: 7480106D, Tổ hợp: (A00, A01, D01, D90), Điểm chuẩn: 25.00
|
102 |
+
|
103 |
+
|
104 |
+
9. Ngành: Hệ thống nhúng và IoT
|
105 |
+
|
106 |
+
|
107 |
+
Mã ngành: 7480109D, Tổ hợp: (A00, A01, D01, D90), Điểm chuẩn: 23.75
|
108 |
+
|
109 |
+
|
110 |
+
10. Ngành: Công nghệ thông tin
|
111 |
+
|
112 |
+
|
113 |
+
Mã ngành: 7480201D, Tổ hợp: (A00, A01, D01, D90), Điểm chuẩn: 25.25
|
114 |
+
|
115 |
+
|
116 |
+
11. Ngành: Công nghệ kỹ thuật công trình xây dựng
|
117 |
+
|
118 |
+
|
119 |
+
Mã ngành: 7510102D, Tổ hợp: (A00, A01, D01, D90), Điểm chuẩn: 19.00
|
120 |
+
|
121 |
+
|
122 |
+
12. Ngành: Hệ thống kỹ thuật công trình xây dựng
|
123 |
+
|
124 |
+
|
125 |
+
Mã ngành: 7510105D, Tổ hợp: (A00, A01, D01, D90), Điểm chuẩn: 19.00
|
126 |
+
|
127 |
+
|
128 |
+
13. Ngành: Công nghệ kỹ thuật cơ khí
|
129 |
+
|
130 |
+
|
131 |
+
Mã ngành: 7510201D, Tổ hợp: (A00, A01, D01, D90), Điểm chuẩn: 21.50
|
132 |
+
|
133 |
+
|
134 |
+
14. Ngành: Công nghệ chế tạo máy
|
135 |
+
|
136 |
+
|
137 |
+
Mã ngành: 7510202D, Tổ hợp: (A00, A01, D01, D90), Điểm chuẩn: 18.00
|
138 |
+
|
139 |
+
|
140 |
+
15. Ngành: Công nghệ kỹ thuật ô tô
|
141 |
+
|
142 |
+
|
143 |
+
Mã ngành: 7510205D, Tổ hợp: (A00, A01, D01, D90), Điểm chuẩn: 22.50
|
144 |
+
|
145 |
+
|
146 |
+
16. Ngành: Công nghệ kỹ thuật nhiệt
|
147 |
+
|
148 |
+
|
149 |
+
Mã ngành: 7510206D, Tổ hợp: (A00, A01, D01, D90), Điểm chuẩn: 16.50
|
150 |
+
|
151 |
+
|
152 |
+
17. Ngành: Công nghệ kỹ thuật điện, điện tử
|
153 |
+
|
154 |
+
|
155 |
+
Mã ngành: 7510301D, Tổ hợp: (A00, A01, D01, D90), Điểm chuẩn: 23.25
|
156 |
+
|
157 |
+
|
158 |
+
18. Ngành: Công nghệ kỹ thuật điện tử, viễn thông
|
159 |
+
|
160 |
+
|
161 |
+
Mã ngành: 7510302, Tổ hợp: (A00, A01, D01, D90), Điểm chuẩn: 23.75
|
162 |
+
|
163 |
+
|
164 |
+
19. Ngành: Công nghệ kỹ thuật điều khiển và tự động hóa
|
165 |
+
|
166 |
+
|
167 |
+
Mã ngành: 7510303, Tổ hợp: (A00, A01, D01, D90), Điểm chuẩn: 25.00
|
168 |
+
|
169 |
+
|
170 |
+
20. Ngành: Công nghệ kỹ thuật hóa học
|
171 |
+
|
172 |
+
|
173 |
+
Mã ngành: 7510401, Tổ hợp: (A00, B00, D07, D90), Điểm chuẩn: 17.00
|
174 |
+
|
175 |
+
|
176 |
+
21. Ngành: Công nghệ vật liệu
|
177 |
+
|
178 |
+
|
179 |
+
Mã ngành: 7510402D, Tổ hợp: (A00, B00, D07, D90), Điểm chuẩn: 17.00
|
180 |
+
|
181 |
+
|
182 |
+
22. Ngành: Công nghệ kỹ thuật môi trường
|
183 |
+
|
184 |
+
|
185 |
+
Mã ngành: 7510406, Tổ hợp: (A00, B00, D07, D90), Điểm chuẩn: 17.00
|
186 |
+
|
187 |
+
|
188 |
+
23. Ngành: Quản lý công nghiệp
|
189 |
+
|
190 |
+
|
191 |
+
Mã ngành: 7510601, Tổ hợp: (A00, A01, D01, D90), Điểm chuẩn: 23.75
|
192 |
+
|
193 |
+
|
194 |
+
24. Ngành: Logistics và quản lý chuỗi cung ứng
|
195 |
+
|
196 |
+
|
197 |
+
Mã ngành: 7510605D, Tổ hợp: (A00, A01, D01, D90), Điểm chuẩn: 24.25
|
198 |
+
|
199 |
+
|
200 |
+
25. Ngành: Công nghệ kỹ thuật in
|
201 |
+
|
202 |
+
|
203 |
+
Mã ngành: 7510802D, Tổ hợp: (A00, A01, D01, D90), Điểm chuẩn: 17.00
|
204 |
+
|
205 |
+
|
206 |
+
26. Ngành: Công nghệ may
|
207 |
+
|
208 |
+
|
209 |
+
Mã ngành: 7540204D, Tổ hợp: (A00, A01, D01, D90), Điểm chuẩn: 17.50
|
210 |
+
|
211 |
+
|
212 |
+
27. Ngành: Kiến trúc
|
213 |
+
|
214 |
+
|
215 |
+
Mã ngành: 7580101, Tổ hợp: (V00, V01, V02, V03), Điểm chuẩn: 22.25
|
216 |
+
|
217 |
+
|
218 |
+
28. Ngành: Kiến trúc nội thất
|
219 |
+
|
220 |
+
|
221 |
+
Mã ngành: 7580101D, Tổ hợp: (V03, V04, V05, V06), Điểm chuẩn: 22.00
|
222 |
+
|
223 |
+
|
224 |
+
29. Ngành: Kỹ thuật xây dựng công trình giao thông
|
225 |
+
|
226 |
+
|
227 |
+
Mã ngành: 7580205D, Tổ hợp: (A00, A01, D01, D90), Điểm chuẩn: 17.00
|
228 |
+
|
229 |
+
|
230 |
+
30. Ngành: Kỹ thuật xây dựng
|
231 |
+
|
232 |
+
|
233 |
+
Mã ngành: 7580201D, Tổ hợp: (A00, A01, D01, D90), Điểm chuẩn: 17.00
|
234 |
+
|
235 |
+
|
236 |
+
31. Ngành: Quản trị nhà hàng và dịch vụ ăn uống
|
237 |
+
|
238 |
+
|
239 |
+
Mã ngành: 7840110D, Tổ hợp: (A00, A01, D01, D90), Điểm chuẩn: 17.50
|
240 |
+
|
241 |
+
|
242 |
+
32. Ngành: Quản lý và vận hành hạ tầng
|
243 |
+
|
244 |
+
|
245 |
+
Mã ngành: 7840101D, Tổ hợp: (A00, A01, D01, D90), Điểm chuẩn: 17.70
|
246 |
+
|
247 |
+
|
248 |
+
33. Ngành: Công nghệ kỹ thuật điều khiển và tự động hóa
|
249 |
+
|
250 |
+
|
251 |
+
Mã ngành: 7510303D, Tổ hợp: (A00, A01, D01, D90), Điểm chuẩn: 22.75
|
252 |
+
|
253 |
+
|
254 |
+
34. Ngành: Công nghệ kỹ thuật điện tử - viễn thông
|
255 |
+
|
256 |
+
|
257 |
+
Mã ngành: 7510302D, Tổ hợp: (A00, A01, D01, D90), Điểm chuẩn: 21.50
|
258 |
+
|
259 |
+
|
260 |
+
CLC Tiếng Việt
|
261 |
+
|
262 |
+
|
263 |
+
1. Ngành: Thiết kế thời trang
|
264 |
+
|
265 |
+
|
266 |
+
Mã ngành: 7210404C, Tổ hợp: (V01, V02, V07, V09), Điểm chuẩn: 21.60
|
267 |
+
|
268 |
+
|
269 |
+
2. Ngành: Thương mại điện tử
|
270 |
+
|
271 |
+
|
272 |
+
Mã ngành: 7340122C, Tổ hợp: (A00, A01, D01, D90), Điểm chuẩn: 25.50
|
273 |
+
|
274 |
+
|
275 |
+
3. Ngành: Kế toán
|
276 |
+
|
277 |
+
|
278 |
+
Mã ngành: 7340301C, Tổ hợp: (A00, A01, D01, D90), Điểm chuẩn: 23.75
|
279 |
+
|
280 |
+
|
281 |
+
4. Ngành: Công nghệ kỹ thuật máy tính
|
282 |
+
|
283 |
+
|
284 |
+
Mã ngành: 7480106C, Tổ hợp: (A00, A01, D01, D90), Điểm chuẩn: 25.65
|
285 |
+
|
286 |
+
|
287 |
+
5. Ngành: Công nghệ thông tin
|
288 |
+
|
289 |
+
|
290 |
+
Mã ngành: 7480201C, Tổ hợp: (A00, A01, D01, D90), Điểm chuẩn: 26.00
|
291 |
+
|
292 |
+
|
293 |
+
6. Ngành: Công nghệ kỹ thuật công trình xây dựng
|
294 |
+
|
295 |
+
|
296 |
+
Mã ngành: 7510102C, Tổ hợp: (A00, A01, D01, D90), Điểm chuẩn: 20.00
|
297 |
+
|
298 |
+
|
299 |
+
7. Ngành: Công nghệ kỹ thuật cơ khí
|
300 |
+
|
301 |
+
|
302 |
+
Mã ngành: 7510201C, Tổ hợp: (A00, A01, D01, D90), Điểm chuẩn: 22.00
|
303 |
+
|
304 |
+
|
305 |
+
8. Ngành: Công nghệ chế tạo máy
|
306 |
+
|
307 |
+
|
308 |
+
Mã ngành: 7510202C, Tổ hợp: (A00, A01, D01, D90), Điểm chuẩn: 19.00
|
309 |
+
|
310 |
+
|
311 |
+
9. Ngành: Công nghệ kỹ thuật ô tô
|
312 |
+
|
313 |
+
|
314 |
+
Mã ngành: 7510205C, Tổ hợp: (A00, A01, D01, D90), Điểm chuẩn: 23.00
|
315 |
+
|
316 |
+
|
317 |
+
10. Ngành: Công nghệ kỹ thuật nhiệt
|
318 |
+
|
319 |
+
|
320 |
+
Mã ngành: 7510206C, Tổ hợp: (A00, A01, D01, D90), Điểm chuẩn: 17.00
|
321 |
+
|
322 |
+
|
323 |
+
11. Ngành: Công nghệ kỹ thuật điện, điện tử
|
324 |
+
|
325 |
+
|
326 |
+
Mã ngành: 7510301C, Tổ hợp: (A00, A01, D01, D90), Điểm chuẩn: 23.00
|
327 |
+
|
328 |
+
|
329 |
+
12. Ngành: Công nghệ kỹ thuật điều khiển và tự động hóa
|
330 |
+
|
331 |
+
|
332 |
+
Mã ngành: 7510303C, Tổ hợp: (A00, A01, D01, D90), Điểm chuẩn: 23.00
|
333 |
+
|
334 |
+
|
335 |
+
13. Ngành: Công nghệ kỹ thuật điện tử - viễn thông
|
336 |
+
|
337 |
+
|
338 |
+
Mã ngành: 7510302C, Tổ hợp: (A00, A01, D01, D90), Điểm chuẩn: 22.50
|
339 |
+
|
340 |
+
|
341 |
+
14. Ngành: Công nghệ kỹ thuật điện tử, viễn thông
|
342 |
+
|
343 |
+
|
344 |
+
Mã ngành: 7510302C, Tổ hợp: (A00, A01, D01, D90), Điểm chuẩn: 22.50
|
345 |
+
|
346 |
+
|
347 |
+
15. Ngành: Công nghệ kỹ thuật điều khiển và tự động hóa
|
348 |
+
|
349 |
+
|
350 |
+
Mã ngành: 7510303C, Tổ hợp: (A00, A01, D01, D90), Điểm chuẩn: 24.00
|
351 |
+
|
352 |
+
|
353 |
+
16. Ngành: Công nghệ kỹ thuật môi trường
|
354 |
+
|
355 |
+
|
356 |
+
Mã ngành: 7510406C, Tổ hợp: (A00, B00, D07, D90), Điểm chuẩn: 17.50
|
357 |
+
|
358 |
+
|
359 |
+
17. Ngành: Quản lý công nghiệp
|
360 |
+
|
361 |
+
|
362 |
+
Mã ngành: 7510601C, Tổ hợp: (A00, A01, D01, D90), Điểm chuẩn: 19.75
|
363 |
+
|
364 |
+
|
365 |
+
18. Ngành: Công nghệ kỹ thuật cơ điện tử
|
366 |
+
|
367 |
+
|
368 |
+
Mã ngành: 7510203C, Tổ hợp: (A00, A01, D01, D90), Điểm chuẩn: 21.50
|
369 |
+
|
370 |
+
|
371 |
+
19. Ngành: Công nghệ may
|
372 |
+
|
373 |
+
|
374 |
+
Mã ngành: 7540204C, Tổ hợp: (A00, A01, D01, D90), Điểm chuẩn: 23.25
|
375 |
+
|
376 |
+
|
377 |
+
CLC Tiếng Anh:
|
378 |
+
|
379 |
+
|
380 |
+
1. Ngành: Công nghệ kỹ thuật máy tính
|
381 |
+
|
382 |
+
|
383 |
+
Mã ngành: 7480106A, Tổ hợp: (A00, A01, D01, D90), Điểm chuẩn: 26.00
|
384 |
+
|
385 |
+
|
386 |
+
2. Ngành: Công nghệ thông tin
|
387 |
+
|
388 |
+
|
389 |
+
Mã ngành: 7480201A, Tổ hợp: (A00, A01, D01, D90), Điểm chuẩn: 26.50
|
390 |
+
|
391 |
+
|
392 |
+
3. Ngành: Công nghệ kỹ thuật công trình xây dựng
|
393 |
+
|
394 |
+
|
395 |
+
Mã ngành: 7510102A, Tổ hợp: (A00, A01, D01, D90), Điểm chuẩn: 19.75
|
396 |
+
|
397 |
+
|
398 |
+
4. Ngành: Công nghệ kỹ thuật cơ khí
|
399 |
+
|
400 |
+
|
401 |
+
Mã ngành: 7510201A, Tổ hợp: (A00, A01, D01, D90), Điểm chuẩn: 22.50
|
402 |
+
|
403 |
+
|
404 |
+
5. Ngành: Công nghệ chế tạo máy
|
405 |
+
|
406 |
+
|
407 |
+
Mã ngành: 7510202A, Tổ hợp: (A00, A01, D01, D90), Điểm chuẩn: 19.50
|
408 |
+
|
409 |
+
|
410 |
+
6. Ngành: Công nghệ kỹ thuật ô tô
|
411 |
+
|
412 |
+
|
413 |
+
Mã ngành: 7510205A, Tổ hợp: (A00, A01, D01, D90), Điểm chuẩn: 23.50
|
414 |
+
|
415 |
+
|
416 |
+
7. Ngành: Công nghệ kỹ thuật nhiệt
|
417 |
+
|
418 |
+
|
419 |
+
Mã ngành: 7510206A, Tổ hợp: (A00, A01, D01, D90), Điểm chuẩn: 17.00
|
420 |
+
|
421 |
+
|
422 |
+
8. Ngành: Công nghệ kỹ thuật điện, điện tử
|
423 |
+
|
424 |
+
|
425 |
+
Mã ngành: 7510301A, Tổ hợp: (A00, A01, D01, D90), Điểm chuẩn: 23.50
|
426 |
+
|
427 |
+
|
428 |
+
9. Ngành: Công nghệ kỹ thuật điều khiển và tự động hóa
|
429 |
+
|
430 |
+
|
431 |
+
Mã ngành: 7510303A, Tổ hợp: (A00, A01, D01, D90), Điểm chuẩn: 23.50
|
432 |
+
|
433 |
+
|
434 |
+
10. Ngành: Công nghệ kỹ thuật điện tử, viễn thông
|
435 |
+
|
436 |
+
|
437 |
+
Mã ngành: 7510302A, Tổ hợp: (A00, A01, D01, D90), Điểm chuẩn: 22.25
|
438 |
+
|
439 |
+
|
440 |
+
11. Ngành: Công nghệ kỹ thuật điều khiển và tự động hóa
|
441 |
+
|
442 |
+
|
443 |
+
Mã ngành: 7510303A, Tổ hợp: (A00, A01, D01, D90), Điểm chuẩn: 23.50
|
444 |
+
|
445 |
+
|
446 |
+
12. Ngành: Quản lý công nghiệp
|
447 |
+
|
448 |
+
|
449 |
+
Mã ngành: 7510601A, Tổ hợp: (A00, A01, D01, D90), Điểm chuẩn: 19.25
|
450 |
+
|
451 |
+
|
452 |
+
Nhân tài
|
453 |
+
|
454 |
+
|
455 |
+
Ngành: Robot và trí tuệ nhân tạo
|
456 |
+
|
457 |
+
|
458 |
+
Mã ngành: 7510209NT, Tổ hợp: (A00, A01, D01, D90), Điểm chuẩn: 25.00'
|
459 |
+
- '4. CÁC NGÀNH ĐÀO TẠO
|
460 |
+
|
461 |
+
|
462 |
+
a. ĐẠI HỌC
|
463 |
+
|
464 |
+
|
465 |
+
Cử nhân Sư phạm Địa lý (hệ Chính quy, hệ VHVL)
|
466 |
+
|
467 |
+
|
468 |
+
Cử nhân Sư phạm Lịch sử - Địa lý
|
469 |
+
|
470 |
+
|
471 |
+
Cử nhân Địa lý học
|
472 |
+
|
473 |
+
|
474 |
+
b. SAU ĐẠI HỌC
|
475 |
+
|
476 |
+
|
477 |
+
Thạc sĩ Địa lý học
|
478 |
+
|
479 |
+
|
480 |
+
Tiến sĩ Địa lý học
|
481 |
+
|
482 |
+
|
483 |
+
C. BỒI DƯỠNG
|
484 |
+
|
485 |
+
|
486 |
+
Bồi dưỡng các chuyên đề nâng cao trình độ cho đội ngũ giáo viên phổ thông như:
|
487 |
+
dạy học tích cực, kiểm tra đánh giá, hệ thống thông tin địa lí, dạy học tích hợp,
|
488 |
+
trải nghiệm sáng tạo, nghiên cứu khoa học, ứng dụng công nghệ thông tin trong
|
489 |
+
dạy học địa lí…
|
490 |
+
|
491 |
+
|
492 |
+
iv. Khoa Giáo dục Chính trị
|
493 |
+
|
494 |
+
|
495 |
+
1. CHẤT LƯỢNG ĐÀO TẠO
|
496 |
+
|
497 |
+
|
498 |
+
ĐÀO TẠO CỬ NHÂN (4 NĂM)
|
499 |
+
|
500 |
+
|
501 |
+
Cử nhân Sư phạm Giáo dục Chính trị
|
502 |
+
|
503 |
+
|
504 |
+
TUYỂN SINH: 80 - 100 SV/năm
|
505 |
+
|
506 |
+
|
507 |
+
2006 - 2017: 900 Sinh viên
|
508 |
+
|
509 |
+
|
510 |
+
ĐÀO TẠO VĂN BẰNG 2 (18 & 24 THÁNG)
|
511 |
+
|
512 |
+
|
513 |
+
Cử nhân Giáo dục Chính trị
|
514 |
+
|
515 |
+
|
516 |
+
TUYỂN SINH:
|
517 |
+
|
518 |
+
|
519 |
+
2006 - 2017: 1.000 Sinh viên
|
520 |
+
|
521 |
+
|
522 |
+
2. CHẤT LƯỢNG GIẢNG VIÊN
|
523 |
+
|
524 |
+
|
525 |
+
ĐỘI NGŨ GIẢNG VIÊN: 23
|
526 |
+
|
527 |
+
|
528 |
+
Phó Giáo sư Tiến sĩ: 1
|
529 |
+
|
530 |
+
|
531 |
+
Tiến sĩ: 7
|
532 |
+
|
533 |
+
|
534 |
+
Thạc sĩ: 15
|
535 |
+
|
536 |
+
|
537 |
+
3. MỤC TIÊU ĐÀO TẠO
|
538 |
+
|
539 |
+
|
540 |
+
Đào tạo giáo viên dạy Giáo dục công dân bậc trung học cơ sở có trình độ cử nhân
|
541 |
+
Sư phạm Giáo dục công dân;
|
542 |
+
|
543 |
+
|
544 |
+
Đào tạo giáo viên dạy giáo dục kinh tế và pháp luật bậc Trung học phổ thông có
|
545 |
+
trình độ cử nhân Sư phạm Giáo dục Chính trị.'
|
546 |
+
- source_sentence: Thông tin xét tuyển của các ngành Sư phạm được liệt kê trong đoạn
|
547 |
+
văn là gì?
|
548 |
+
sentences:
|
549 |
+
- 'Chính vì vậy các kỹ sư lập trình hiện nay đều thiếu kỹ năng ngoại ngữ và khả
|
550 |
+
năng tự học kiến thức mới Các vị trí công việc sau khi ra trường:
|
551 |
+
|
552 |
+
|
553 |
+
Lập trình viên phát triển ứng dụng
|
554 |
+
|
555 |
+
|
556 |
+
Kỹ sư cầu nối
|
557 |
+
|
558 |
+
|
559 |
+
Chuyên viên phân tích nghiệp vụ
|
560 |
+
|
561 |
+
|
562 |
+
Kỹ sư đảm bảo chất lượng phần mềm
|
563 |
+
|
564 |
+
|
565 |
+
Kỹ sư quy trình sản xuất phần mềm
|
566 |
+
|
567 |
+
|
568 |
+
Quản trị viên dự án phần mềm và CNTT
|
569 |
+
|
570 |
+
|
571 |
+
Giám đốc kỹ thuật
|
572 |
+
|
573 |
+
|
574 |
+
Chuyên viên phát triển ứng dụng AI về xử lý hình ảnh, âm thanh
|
575 |
+
|
576 |
+
|
577 |
+
**HỌC PHÍ TRƯỜNG ĐẠI HỌC FPT TẠI HÀ NỘI VÀ TP. HCM
|
578 |
+
|
579 |
+
|
580 |
+
**ÁP DỤNG CHO SINH VIÊN NHẬP HỌC MỚI NĂM 2024 HỆ ĐẠI HỌC CHÍNH QUY
|
581 |
+
|
582 |
+
|
583 |
+
Trường Đại học FPT trân trọng thông báo các mức học phí áp dụng cho sinh viên
|
584 |
+
nhập học mới năm 2024 hệ đại học chính quy tại Hà Nội và TP. Hồ Chí Minh như sau:
|
585 |
+
|
586 |
+
|
587 |
+
1. Học phí Chương trình chính khóa
|
588 |
+
|
589 |
+
|
590 |
+
Số kỳ học: 9 học kỳ (bao gồm cả giai đoạn thực tập tại doanh nghiệp). Thời lượng
|
591 |
+
học mỗi kỳ: 4 tháng. Học phí chuyên ngành:
|
592 |
+
|
593 |
+
|
594 |
+
Từ học kỳ 1 đến học kỳ 3: 28,700,000 VNĐ/Học kỳ
|
595 |
+
|
596 |
+
|
597 |
+
Từ học kỳ 4 đến học kỳ 6: 30,500,000 VNĐ/Học kỳ
|
598 |
+
|
599 |
+
|
600 |
+
Từ học kỳ 7 đến học kỳ 9: 32,500,000 VNĐ/Học kỳ
|
601 |
+
|
602 |
+
|
603 |
+
Mức học phí trên áp dụng cho sinh viên nhập học mới năm 2024 hệ đại học chính
|
604 |
+
quy của Trường ĐH FPT, theo QĐ 08/QĐ-CTGDFPT ngày 12/01/2024 Quy định tài chính
|
605 |
+
sinh viên năm học 2024-2025 các hệ đào tạo thuộc hệ thống giáo dục FPT.'
|
606 |
+
- 'Xét tuyển từ cao xuống thấp cho đến khi đủ chỉ tiêu. 6. Xét tuyển sử dụng kết
|
607 |
+
quả học tập THPT kết hợp thi tuyển môn năng khiếu
|
608 |
+
|
609 |
+
|
610 |
+
Phương thức tuyển sinh này chỉ áp dụng cho các ngành Giáo dục Thể chất, Giáo dục
|
611 |
+
Mầm non. Với mỗi ngành học, Trường sử dụng kết quả học tập môn Ngữ văn hoặc Toán
|
612 |
+
ở THPT (theo tổ hợp môn đăng ký xét tuyển) và 02 môn thi năng khiếu do Trường
|
613 |
+
Đại học Sư phạm Thành phố Hồ Chí Minh tổ chức để xét tuyển. Hình thức xét tuyển
|
614 |
+
|
615 |
+
|
616 |
+
Điểm xét tuyển là tổng điểm trung bình của môn Ngữ văn hoặc Toán trong 06 học
|
617 |
+
kỳ ở THPT (theo tổ hợp môn đăng ký xét tuyển) với điểm thi 02 môn thi năng khiếu
|
618 |
+
do Trường tổ chức cộng điểm ưu tiên đối tượng, khu vực theo quy định của Bộ Giáo
|
619 |
+
dục và Đào tạo và được làm tròn đến hai chữ số thập phân. ĐXT = ĐM + ĐNK1 + ĐNK2
|
620 |
+
+ ĐUT
|
621 |
+
|
622 |
+
|
623 |
+
Trong đó:
|
624 |
+
|
625 |
+
|
626 |
+
ĐXT: điểm xét tuyển, được làm tròn đến hai chữ số thập phân;
|
627 |
+
|
628 |
+
|
629 |
+
ĐM: điểm trung bình 06 học kỳ ở THPT của môn Ngữ văn hoặc Toán theo tổ hợp xét
|
630 |
+
tuyển;
|
631 |
+
|
632 |
+
|
633 |
+
ĐNK1, ĐNK2 : điểm môn thi năng khiếu do Trường Đại học Sư phạm Thành phố Hồ Chí
|
634 |
+
Minh tổ chức;
|
635 |
+
|
636 |
+
|
637 |
+
ĐUT: điểm ưu tiên đối tượng, khu vực theo quy định của Bộ Giáo dục và Đào tạo.'
|
638 |
+
- 'viii. Sư phạm Toán học (7140209): Xét tuyển tổ hợp A00, A01. Chỉ tiêu: 210 (84
|
639 |
+
từ KQ thi THPT, 126 từ phương thức khác). ix. Sư phạm Tin học (7140210): Xét tuyển
|
640 |
+
tổ hợp A00, A01. Chỉ tiêu: 85 (34 từ KQ thi THPT, 51 từ phương thức khác). x.
|
641 |
+
Sư phạm Vật lý (7140211): Xét tuyển tổ hợp A00, A01, C01. Chỉ tiêu: 85 (34 từ
|
642 |
+
KQ thi THPT, 51 từ phương thức khác). xi. Sư phạm Hóa học (7140212): Xét tuyển
|
643 |
+
tổ hợp A00, B00, D07. Chỉ tiêu: 50 (20 từ KQ thi THPT, 30 từ phương thức khác).
|
644 |
+
xii. Sư phạm Sinh học (7140213): Xét tuyển tổ hợp B00, D08. Chỉ tiêu: 65 (26 từ
|
645 |
+
KQ thi THPT, 39 từ phương thức khác). xiii. Sư phạm Ngữ văn (7140217): Xét tuyển
|
646 |
+
tổ hợp D01, C00, D78. Chỉ tiêu: 110 (44 từ KQ thi THPT, 66 từ phương thức khác).'
|
647 |
+
- source_sentence: Chương trình đào tạo của Đại học FPT có những điểm nổi bật nào?
|
648 |
+
sentences:
|
649 |
+
- 'Kỹ sư môi trường: Thực hiện các dự án bảo vệ tài nguyên và xử lý ô nhiễm môi
|
650 |
+
trường. Chuyên gia tư vấn môi trường: Tư vấn các chính sách bảo vệ môi trường
|
651 |
+
và phát triển bền vững tại các doanh nghiệp, tổ chức. Giảng viên, nghiên cứu viên:
|
652 |
+
Giảng dạy và nghiên cứu tại các trường đại học, viện nghiên cứu. Nhóm Ngành Toán
|
653 |
+
học, Toán tin, Toán ứng dụng
|
654 |
+
|
655 |
+
|
656 |
+
Mã tuyển sinh: 7460101_NN
|
657 |
+
|
658 |
+
|
659 |
+
Tổ hợp xét tuyển: A00; A01; B00; D01
|
660 |
+
|
661 |
+
|
662 |
+
Thông tin liên hệ:
|
663 |
+
|
664 |
+
|
665 |
+
Website: https://www.math.hcmus.edu.vn/
|
666 |
+
|
667 |
+
|
668 |
+
TỔNG QUAN CHƯƠNG TRÌNH
|
669 |
+
|
670 |
+
|
671 |
+
Ngành Toán học, Toán tin, Toán ứng dụng cung cấp cho sinh viên những kiến thức
|
672 |
+
nền tảng về toán học, giúp các em có khả năng áp dụng kiến thức toán học vào các
|
673 |
+
lĩnh vực khoa học và công nghệ khác nhau. Ngành Toán học
|
674 |
+
|
675 |
+
|
676 |
+
Chuyên ngành: Đại số, Giải tích, Giải tích số, Xác suất Thống kê
|
677 |
+
|
678 |
+
|
679 |
+
Tổng quan: Ngành Toán học nghiên cứu các lý thuyết cơ bản và quan trọng của toán
|
680 |
+
học, giúp sinh viên có khả năng áp dụng toán học vào bất kỳ lĩnh vực nào yêu cầu
|
681 |
+
năng lực toán học cao. Ngành Toán ứng dụng
|
682 |
+
|
683 |
+
|
684 |
+
Chuyên ngành: Cơ học, Lý luận và phương pháp giảng dạy môn Toán, Toán tài chính,
|
685 |
+
Tối ưu
|
686 |
+
|
687 |
+
|
688 |
+
Tổng quan: Ngành Toán ứng dụng sử dụng kiến thức toán học để giải quyết các vấn
|
689 |
+
đề trong các lĩnh vực ngoài toán học. Sinh viên sẽ được đào tạo để nghiên cứu
|
690 |
+
các vấn đề toán học có tiềm năng cao giúp ích cho các ngành khoa học và công nghiệp
|
691 |
+
khác. Ngành Toán tin
|
692 |
+
|
693 |
+
|
694 |
+
Chuyên ngành: Khoa học dữ liệu, Phương pháp toán trong tin học, Toán tin ứng dụng
|
695 |
+
|
696 |
+
|
697 |
+
Tổng quan: Ngành Toán tin kết hợp toán học với tin học, đặc biệt là trong các
|
698 |
+
lĩnh vực khoa học về thông tin. Sinh viên sẽ học cách ứng dụng toán học trong
|
699 |
+
các vấn đề liên quan đến tin học và khoa học dữ liệu. Ngành Khoa học dữ liệu
|
700 |
+
|
701 |
+
|
702 |
+
Mã tuyển sinh: 7460108
|
703 |
+
|
704 |
+
|
705 |
+
Tổ hợp xét tuyển:
|
706 |
+
|
707 |
+
|
708 |
+
A00: Toán - Lý - Hóa
|
709 |
+
|
710 |
+
|
711 |
+
A01: Toán - Lý - Tiếng Anh
|
712 |
+
|
713 |
+
|
714 |
+
B08: Toán – Tiếng Anh – Sinh
|
715 |
+
|
716 |
+
|
717 |
+
D07: Toán – Hóa – Tiếng Anh
|
718 |
+
|
719 |
+
|
720 |
+
Thông tin liên hệ:
|
721 |
+
|
722 |
+
|
723 |
+
Website: Khoa Toán - Trường Đại học Khoa học Tự nhiên TP.HCM
|
724 |
+
|
725 |
+
|
726 |
+
TỔNG QUAN CHƯƠNG TRÌNH
|
727 |
+
|
728 |
+
|
729 |
+
Ngành Khoa học dữ liệu cung cấp cho sinh viên những kiến thức vững chắc về các
|
730 |
+
phương pháp phân tích và xử lý dữ liệu trong các lĩnh vực khoa học, kinh doanh,
|
731 |
+
tài chính và công nghệ. Chương trình học giúp sinh viên hiểu rõ cách áp dụng toán
|
732 |
+
học, thống kê và kỹ thuật lập trình để khai thác và phân tích dữ liệu. CƠ SỞ VẬT
|
733 |
+
CHẤT CHẤT LƯỢNG CAO
|
734 |
+
|
735 |
+
|
736 |
+
Khoa Toán của Trường Đại học Khoa học Tự nhiên TP.HCM trang bị cơ sở vật chất
|
737 |
+
hiện đại với các phòng học, phòng thí nghiệm và thiết bị hỗ trợ học tập tối ưu
|
738 |
+
cho ngành Khoa học dữ liệu.'
|
739 |
+
- 'Học phí: 11,900,000 VNĐ/mức. 3. Các khoản phí cần nộp khi nhập học
|
740 |
+
|
741 |
+
|
742 |
+
Học phí kỳ định hướng: 11,900,000 VNĐ (có 01 học kỳ định hướng, chỉ áp dụng cho
|
743 |
+
SV mới nhập học năm 2024)
|
744 |
+
|
745 |
+
|
746 |
+
Học phí 01 mức tiếng Anh chuẩn bị: 11,900,000 VNĐ/mức
|
747 |
+
|
748 |
+
|
749 |
+
1. Giáo trình chuẩn quốc tế
|
750 |
+
|
751 |
+
|
752 |
+
Chương trình học của Đại học FPT được thiết kế theo chuẩn của Hiệp hội Máy tính
|
753 |
+
(Association for Computing Machinery-ACM), chuẩn đào tạo kỹ sư phần mềm của Accreditation
|
754 |
+
Board for Engineering and Technology (ABET – Mỹ), Hiệp hội Phần mềm Việt Nam (VINASA)
|
755 |
+
|
756 |
+
|
757 |
+
Tất cả các giáo trình của Đại học FPT đều được nhập khẩu từ nước ngoài về và cập
|
758 |
+
nhật liên tục theo từng kỳ học
|
759 |
+
|
760 |
+
|
761 |
+
2. Chú trọng vào thực hành
|
762 |
+
|
763 |
+
|
764 |
+
Với thời lượng số tiết thực hành lên đến 60%, sinh viên Đại học FPT đã được làm
|
765 |
+
quen với công việc ngay từ trên ghế nhà trường. 1 lớp học tối đa 30 sinh viên
|
766 |
+
nên trong các giờ thực hành sinh viên sẽ được các thầy cô giảng viên hướng dẫn
|
767 |
+
rất tỉ mỉ và chi tiết
|
768 |
+
|
769 |
+
|
770 |
+
3. Chú trọng vào ngoại ngữ và kỹ năng mềm
|
771 |
+
|
772 |
+
|
773 |
+
Năm đầu tiên các bạn sinh viên sẽ phải trải qua 6 kỳ học tiếng Anh để có thể đạt
|
774 |
+
được nền tảng ngoại ngữ nhất định trước khi sang năm thứ 2 bước vào kỳ học chuyên
|
775 |
+
ngành. Ngoài tiếng Anh là ngôn ngữ bắt buộc ra thì sinh viên Đại học FPT còn được
|
776 |
+
học thêm tiếng Nhật. Như vậy sau khi ra trường các bạn sinh viên có thêm rất nhiều
|
777 |
+
cơ hội để có thể làm việc tại nước ngoài
|
778 |
+
|
779 |
+
|
780 |
+
Ngay từ những ngày đầu thành lập, đại học FPT đã đề cao việc phát triển bản thân
|
781 |
+
đặc biệt là kỹ năng mềm cho sinh viên. Các bạn sinh viên sẽ được học rất nhiều
|
782 |
+
các khoá học như kỹ năng thuyết trình, tư duy phản biện, kỹ năng làm việc nhóm,
|
783 |
+
kỹ năng phỏng vấn, kỹ năng viết CV .'
|
784 |
+
- 'Ứng dụng hạt nhân: Tìm hiểu về ứng dụng năng lượng hạt nhân, y học hạt nhân,
|
785 |
+
và xử lý chất thải hạt nhân trong công nghiệp. Kỹ thuật đo lường: Các kỹ thuật
|
786 |
+
đo đạc, phân tích phóng xạ, và các ứng dụng trong nghiên cứu khoa học. Vật lý
|
787 |
+
Y khoa
|
788 |
+
|
789 |
+
|
790 |
+
Mã tuyển sinh: 7520403
|
791 |
+
|
792 |
+
|
793 |
+
Tổ hợp xét tuyển: A00; A01; A02; D90
|
794 |
+
|
795 |
+
|
796 |
+
Thông tin liên hệ:
|
797 |
+
|
798 |
+
|
799 |
+
Địa chỉ: Trường Đại học Khoa học Tự nhiên TP.HCM, 227 Nguyễn Văn Cừ, Quận 5, TP.HCM
|
800 |
+
|
801 |
+
|
802 |
+
Điện thoại: (028) 38 585 726
|
803 |
+
|
804 |
+
|
805 |
+
Email: [email protected]
|
806 |
+
|
807 |
+
|
808 |
+
Website: https://www.hcmus.edu.vn
|
809 |
+
|
810 |
+
|
811 |
+
TỔNG QUAN CHƯƠNG TRÌNH
|
812 |
+
|
813 |
+
|
814 |
+
Chương trình đào tạo ngành Vật lý Y khoa tại Trường Đại học Khoa học Tự nhiên
|
815 |
+
TP.HCM cung cấp cho sinh viên kiến thức nền tảng về vật lý, sinh học và y học,
|
816 |
+
đặc biệt là các ứng dụng vật lý trong y tế. Sinh viên sẽ được trang bị kiến thức
|
817 |
+
về các thiết bị y tế như máy chụp X-quang, máy cộng hưởng từ (MRI), máy cắt lớp
|
818 |
+
vi tính (CT), và các phương pháp điều trị bằng tia xạ. Chương trình học kết hợp
|
819 |
+
lý thuyết với thực hành để sinh viên có thể ứng dụng các kiến thức trong các môi
|
820 |
+
trường y tế thực tế. CƠ SỞ VẬT CHẤT CHẤT LƯỢNG CAO
|
821 |
+
|
822 |
+
|
823 |
+
Trường sở hữu các phòng thí nghiệm hiện đại chuyên về vật lý y khoa, với các thiết
|
824 |
+
bị y tế tiên tiến phục vụ cho việc học tập và nghiên cứu. Các phòng thí nghiệm
|
825 |
+
này cung cấp cơ hội cho sinh viên thực hành với các thiết bị như máy chụp X-quang,
|
826 |
+
CT, MRI và các thiết bị điều trị ung thư bằng tia xạ. CÁC ĐIỂM ĐẶC BIỆT
|
827 |
+
|
828 |
+
|
829 |
+
Chương trình học kết hợp lý thuyết và thực hành: Sinh viên không chỉ học lý thuyết
|
830 |
+
mà còn được thực hành trên các thiết bị y tế hiện đại trong các bệnh viện và cơ
|
831 |
+
sở y tế. Liên kết với các bệnh viện và cơ sở y tế: Trường có các mối quan hệ hợp
|
832 |
+
tác với các bệnh viện lớn, giúp sinh viên có cơ hội thực tập và nghiên cứu tại
|
833 |
+
các cơ sở y tế có ứng dụng vật lý y khoa. Cơ hội du học và học bổng: Sinh viên
|
834 |
+
có thể tham gia các chương trình trao đổi sinh viên và nhận học bổng du học thạc
|
835 |
+
sĩ, tiến sĩ tại các trường đại học nổi tiếng trên thế giới. TRIỂN VỌNG NGHỀ NGHIỆP
|
836 |
+
& CƠ HỘI VIỆC LÀM
|
837 |
+
|
838 |
+
|
839 |
+
Sinh viên tốt nghiệp ngành Vật lý Y khoa có thể làm việc trong các lĩnh vực như:
|
840 |
+
|
841 |
+
|
842 |
+
Các bệnh viện, phòng khám và cơ sở y tế: Vật lý gia trong các bệnh viện và phòng
|
843 |
+
khám sử dụng thiết bị y tế như X-quang, CT, MRI, và các phương pháp điều trị tia
|
844 |
+
xạ.'
|
845 |
+
- source_sentence: Điểm trúng tuyển năm 2021 của các ngành dựa trên điểm thi tốt nghiệp
|
846 |
+
THPT là bao nhiêu?
|
847 |
+
sentences:
|
848 |
+
- "b. SAU ĐẠI HỌC\n\nThạc sĩ chuyên ngành Sinh thái học\n\nc. BỒI DƯỠNG\n\nBồi dưỡng\
|
849 |
+
\ chuyên môn, nghiệp vụ cho các giáo viên phổ thông thực hiện Chương trình giáo\
|
850 |
+
\ dục phổ thông (GDPT) 2018 - Chương trình tổng thể, Chương trình môn Sinh học,\
|
851 |
+
\ Khoa học tự nhiên, Công nghệ; nghiên cứu khoa học và hợp tác quốc tế. III. Nhóm\
|
852 |
+
\ Ngoại ngữ\n\nx. Khoa tiếng Anh\n\n1. CHẤT LƯỢNG ĐÀO TẠO\n\nĐÀO TẠO CỬ NHÂN (4\
|
853 |
+
\ NĂM)\n\nTUYỂN SINH: 300-350 SV/năm\n\n2011-2013:\n\n898 CN Sư phạm tiếng Anh\n\
|
854 |
+
\n897 CN Ngôn Ngữ Anh\n\n2013-2017:\n\n430 CN Sư phạm tiếng Anh\n\n1050 CN Ngôn\
|
855 |
+
\ Ngữ Anh\n\nTổng số SV (tính đến 2/2023)\n\nSV Ngôn ngữ Anh: 1160 SV\n\nSV Sư\
|
856 |
+
\ phạm tiếng Anh: 712 SV\n\nĐÀO TẠO CAO HỌC (2 NĂM)\n\nTUYỂN SINH: 20-30 HV/năm\n\
|
857 |
+
\nĐào tạo Thạc sỹ Lý luận và Phương pháp Giảng dạy Tiếng Anh (Liên kết\n\nvới\
|
858 |
+
\ ĐH Canberra, Úc từ năm 1997 đến 2009)\n\nĐào tạo Thạc sĩ Lý luận và Phương pháp\
|
859 |
+
\ giảng dạy tiếng Anh (TESOL)\n\n(liên kết với Trường Đại học Victoria Wellington,\
|
860 |
+
\ New Zealand từ năm\n\n2015 đến nay)\n\nĐào tạo Thạc sĩ Lý luận và Phương pháp\
|
861 |
+
\ giảng dạy tiếng Anh (từ năm\n\n2018 đến nay)\n\n2.CHẤT LƯỢNG GIẢNG VIÊN\n\n\
|
862 |
+
ĐỘI NGŨ GIẢNG VIÊN: 36\n\nPhó giáo sư- Tiến sĩ: 1\n\nTiến sĩ: 3\n\nThạc sĩ: 32\n\
|
863 |
+
\n3.MỤC TIÊU ĐÀO TẠO\n\nĐào tạo giáo viên dạy tiếng Anh bậc trung học có trình\
|
864 |
+
\ độ cử nhân Sư phạm tiếng Anh, có phẩm chất chính trị, đạo đức và sức khỏe tốt,\
|
865 |
+
\ hiểu và vận dụng các tri thức cơ bản của ngôn ngữ Anh; Lý luận và phương pháp\
|
866 |
+
\ giảng dạy tiếng Anh ở trường trung học. Sau khi tốt nghiệp, người học có đủ\
|
867 |
+
\ năng lực để giảng dạy tiếng Anh tại các trường trung học, một số cơ sở giáo\
|
868 |
+
\ dục tương đương. Đào tạo cử nhân sư phạm tiếng Anh bậc tiểu học có đủ kiến thức,\
|
869 |
+
\ kỹ năng nghề nghiệp, phẩm chất chính trị, sức khỏe để giảng dạy hiệu quả bộ\
|
870 |
+
\ môn tiếng Anh trong các trường tiểu học nhằm đáp ứng nhu cầu phát triển của\
|
871 |
+
\ xã hội và hội nhập khu vực và quốc tế. Đào tạo cử nhân ngôn ngữ Anh có phẩm\
|
872 |
+
\ 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 cơ bản\
|
873 |
+
\ về ngôn ngữ Anh. Sau khi tốt nghiệp, người học có đủ năng lực để làm việc ở\
|
874 |
+
\ các cơ quan, tổ chức, các công ty, doanh nghiệp liên quan đến chuyên ngành biên\
|
875 |
+
\ phiên dịch, chuyên ngành thương mại và các công việc có liên quan nhằm đáp ứng\
|
876 |
+
\ nhu cầu phát triển của xã hội và hội nhập khu vực và quốc tế. Thạc sĩ Lí luận\
|
877 |
+
\ và phương pháp dạy học bộ môn tiếng Anh: có mục tiêu đào tạo đội ngũ giáo viên\
|
878 |
+
\ giảng dạy tiếng Anh có trình độ chuyên môn và nghiệp vụ sư phạm cao do được\
|
879 |
+
\ trang bị kiến thức khoa học về ngôn ngữ một cách có hệ thống, sâu, rộng, hiện\
|
880 |
+
\ đại đồng thời nắm vững cơ sở lí luận về các phương pháp dạy học tích cực, hiện\
|
881 |
+
\ đại và thực tiễn vận dụng các phương pháp này vào giảng dạy nhằm nâng cao hiệu\
|
882 |
+
\ quả việc giảng dạy và học tập tiếng Anh. Chương trình bao gồm 2 định hướng:\
|
883 |
+
\ định hướng nghiên cứu và định hướng ứng dụng. 4. CÁC NGÀNH ĐÀO TẠO\n\na)\tĐẠI\
|
884 |
+
\ HỌC\n\nCử nhân Sư phạm tiếng Anh (bậc trung học)\n\nCử nhân Sư phạm tiếng Anh\
|
885 |
+
\ (bậc tiểu học)\n\nCử nhân Ngôn ngữ Anh (Biên phiên dịch)\n\nCử nhân Ngôn ngữ\
|
886 |
+
\ Anh (Tiếng Anh thương mại)\n\nb)\tSAU ĐẠI HỌC\n\nThạc sĩ Lí luận và phương pháp\
|
887 |
+
\ dạy học bộ môn tiếng Anh\n\nc)\tBỒI DƯỠNG\n\nBồi dưỡng giáo viên tiếng Anh theo\
|
888 |
+
\ khuôn khổ Đề án Ngoại ngữ Quốc gia tại các địa phương khu vực phía Nam. Bồi\
|
889 |
+
\ dưỡng giáo viên tiếng Anh theo đặt hàng từ các Sở giáo dục và đào tạo. d)\t\
|
890 |
+
LIÊN KẾT QUỐC TẾ\n\nCử nhân Ngôn ngữ Anh (thuộc ngành Liberal Studies) liên kết\
|
891 |
+
\ quốc tế với Đại học William Jessup (Hoa Kỳ)\n\nThạc sĩ Lí luận và phương pháp\
|
892 |
+
\ giảng dạy tiếng Anh liên kết quốc tế với Đại học Victoria Wellington (New Zealand)\n\
|
893 |
+
\nxi. Khoa tiếng Pháp\n\n1. CHẤT LƯỢNG ĐÀO TẠO\n\nĐÀO TẠO CỬ NHÂN (4 NĂM)\n\n\
|
894 |
+
Cử nhân Sư phạm tiếng Pháp\n\nCử nhân Ngôn ngữ Pháp\n\nTUYỂN SINH:\n\n2019-2022:\
|
895 |
+
\ 519 SV\n\nĐÀO TẠO CAO HỌC (2 NĂM)\n\nThạc sĩ Lý luận và phương pháp dạy học\
|
896 |
+
\ bộ môn tiếng Pháp. 2.CHẤT LƯỢNG GIẢNG VIÊN\n\nĐỘI NGŨ GIẢNG VIÊN: 14\n\nTiến\
|
897 |
+
\ sĩ: 9\n\nThạc sĩ: 5\n\n3. MỤC TIÊU ĐÀO TẠO\n\nNgành sư phạm tiếng Pháp đào tạo\
|
898 |
+
\ giáo viên tiếng Pháp có phẩm chất chính trị và đạo đức nghề nghiệp, có khả năng\
|
899 |
+
\ giải quyết tốt các nhiệm vụ chuyên môn, đáp ứng yêu cầu của xã hội và của nền\
|
900 |
+
\ kinh tế trong quá trình hội nhập quốc tế. Ngành Ngôn ngữ Pháp đào tạo cử nhân\
|
901 |
+
\ Ngôn ngữ Pháp có phẩm chất chính trị và đạo đức nghề nghiệp, được trang bị đầy\
|
902 |
+
\ đủ nền tảng kiến thức chuyên môn và những năng lực nghề nghiệp để làm việc trong\
|
903 |
+
\ môi trường đa văn hóa, có khả năng thích ứng và giải quyết tốt các công việc\
|
904 |
+
\ thuộc ngành nghề chuyên môn, đáp ứng yêu cầu của xã hội và của nền kinh tế trong\
|
905 |
+
\ bối cảnh hội nhập quốc tế."
|
906 |
+
- "8. Điểm trúng tuyển của các ngành năm 2021 Dựa vào điểm thi tốt nghiệp THPT Nhóm\
|
907 |
+
\ ngành đào tạo giáo viên 1. Giáo dục Mầm non o\tMã ngành: 7140201 o\tTổ hợp xét\
|
908 |
+
\ tuyển: M00 o\tĐiểm trúng tuyển: 22.05 2. Giáo dục Tiểu học o\tMã ngành: 7140202\
|
909 |
+
\ o\tTổ hợp xét tuyển: A00, A01, D01 o\tĐiểm trúng tuyển: 25.40 3. Giáo dục Đặc\
|
910 |
+
\ biệt o\tMã ngành: 7140203 o\tTổ hợp xét tuyển: D01, C00, C15 o\tĐiểm trúng tuyển:\
|
911 |
+
\ 23.40 4. Giáo dục Chính trị o\tMã ngành: 7140205 o\tTổ hợp xét tuyển: C00, C19,\
|
912 |
+
\ D01 o\tĐiểm trúng tuyển: 25.75 5. Giáo dục Thể chất o\tMã ngành: 7140206 o\t\
|
913 |
+
Tổ hợp xét tuyển: M08, T01 o\tĐiểm trúng tuyển: 23.75 6. Giáo dục Quốc phòng -\
|
914 |
+
\ An ninh o\tMã ngành: 7140208 o\tTổ hợp xét tuyển: C00, C19, A08 o\tĐiểm trúng\
|
915 |
+
\ tuyển: 24.40 7. Sư phạm Toán học o\tMã ngành: 7140209 o\tTổ hợp xét tuyển: A00,\
|
916 |
+
\ A01 o\tĐiểm trúng tuyển: 26.70 8. Sư phạm Tin học o\tMã ngành: 7140210 o\tTổ\
|
917 |
+
\ hợp xét tuyển: A00, A01 o\tĐiểm trúng tuyển: 23.00 9. Sư phạm Vật lý o\tMã ngành:\
|
918 |
+
\ 7140211 o\tTổ hợp xét tuyển: A00, A01, C01 o\tĐiểm trúng tuyển: 25.80 10. Sư\
|
919 |
+
\ phạm Hóa học o\tMã ngành: 7140212 o\tTổ hợp xét tuyển: A00, B00, D07 o\tĐiểm\
|
920 |
+
\ trúng tuyển: 27.00 11. Sư phạm Sinh học o\tMã ngành: 7140213 o\tTổ hợp xét tuyển:\
|
921 |
+
\ B00, D08 o\tĐiểm trúng tuyển: 25.00 12. Sư phạm Ngữ văn o\tMã ngành: 7140217\
|
922 |
+
\ o\tTổ hợp xét tuyển: D01, C00, D78 o\tĐiểm trúng tuyển: 27.00 13. Sư phạm Lịch\
|
923 |
+
\ sử o\tMã ngành: 7140218 o\tTổ hợp xét tuyển: C00, D14 o\tĐiểm trúng tuyển: 26.00\
|
924 |
+
\ 14. Sư phạm Địa lý o\tMã ngành: 7140219 o\tTổ hợp xét tuyển: C00, C04, D78 o\t\
|
925 |
+
Điểm trúng tuyển: 25.20 15. Sư phạm Tiếng Anh o\tMã ngành: 7140231 o\tTổ hợp xét\
|
926 |
+
\ tuyển: D01 o\tĐiểm trúng tuyển: 27.15 16. Sư phạm Tiếng Trung Quốc o\tMã ngành:\
|
927 |
+
\ 7140234 o\tTổ hợp xét tuyển: D04, D01 o\tĐiểm trúng tuyển: 25.50 17. Sư phạm\
|
928 |
+
\ Khoa học tự nhiên o\tMã ngành: 7140247 o\tTổ hợp xét tuyển: A00, B00, D90 o\t\
|
929 |
+
Điểm trúng tuyển: 24.40 18. Sư phạm Lịch sử - Địa lý o\tMã ngành: 7140249 o\t\
|
930 |
+
Tổ hợp xét tuyển: C00, C19, C20 o\tĐiểm trúng tuyển: 25.00 Nhóm ngành khác 19.\
|
931 |
+
\ Giáo dục học o\tMã ngành: 7140101 o\tTổ hợp xét tuyển: B00, C00, C01, D01 o\t\
|
932 |
+
Điểm trúng tuyển: 19.50 20. Quản lý giáo dục o\tMã ngành: 7140114 o\tTổ hợp xét\
|
933 |
+
\ tuyển: D01, A00, C00 o\tĐiểm trúng tuyển: 23.30 21. Ngôn ngữ Anh o\tMã ngành:\
|
934 |
+
\ 7220201 o\tTổ hợp xét tuyển: D01 o\tĐiểm trúng tuyển: 26.00 22. Ngôn ngữ Nga\
|
935 |
+
\ o\tMã ngành: 7220202 o\tTổ hợp xét tuyển: D02, D80, D01, D78 o\tĐiểm trúng tuyển:\
|
936 |
+
\ 20.53 23. Ngôn ngữ Pháp o\tMã ngành: 7220203 o\tTổ hợp xét tuyển: D03, D01 o\t\
|
937 |
+
Điểm trúng tuyển: 22.80 24. Ngôn ngữ Trung Quốc o\tMã ngành: 7220204 o\tTổ hợp\
|
938 |
+
\ xét tuyển: D04, D01 o\tĐiểm trúng tuyển: 25.20 25. Ngôn ngữ Nhật o\tMã ngành:\
|
939 |
+
\ 7220209 o\tTổ hợp xét tuyển: D06, D01 o\tĐiểm trúng tuyển: 24.90 26. Ngôn ngữ\
|
940 |
+
\ Hàn Quốc o\tMã ngành: 7220210 o\tTổ hợp xét tuyển: D01, D96, D78, DD2 o\tĐiểm\
|
941 |
+
\ trúng tuyển: 25.80 27. Văn học o\tMã ngành: 7229030 o\tTổ hợp xét tuyển: D01,\
|
942 |
+
\ C00, D78 o\tĐiểm trúng tuyển: 24.30 28. Tâm lý học o\tMã ngành: 7310401 o\t\
|
943 |
+
Tổ hợp xét tuyển: B00, C00, D01 o\tĐiểm trúng tuyển: 25.50 29. Tâm lý học giáo\
|
944 |
+
\ dục o\tMã ngành: 7310403 o\tTổ hợp xét tuyển: A00, D01, C00 o\tĐiểm trúng tuyển:\
|
945 |
+
\ 23.70 30. Quốc tế học o\tMã ngành: 7310601 o\tTổ hợp xét tuyển: D01, D14, D78\
|
946 |
+
\ o\tĐiểm trúng tuyển: 24.60 31. Việt Nam học o\tMã ngành: 7310630 o\tTổ hợp xét\
|
947 |
+
\ tuyển: C00, D01, D78 o\tĐiểm trúng tuyển: 22.92 32. Hóa học o\tMã ngành: 7440112\
|
948 |
+
\ o\tTổ hợp xét tuyển: A00, B00, D07 o\tĐiểm trúng tuyển: 23.25 33. Công nghệ\
|
949 |
+
\ thông tin o\tMã ngành: 7480201 o\tTổ hợp xét tuyển: A00, A01 o\tĐiểm trúng tuyển:\
|
950 |
+
\ 24.00 34. Công tác xã hội o\tMã ngành: 7760101 o\tTổ hợp xét tuyển: A00, D01,\
|
951 |
+
\ C00 o\tĐiểm trúng tuyển: 22.50\n\nDựa vào điểm học bạ"
|
952 |
+
- 'Trường Đại học Sư phạm Kỹ thuật Thành phố Hồ Chí Minh (tiếng Anh: Ho Chi Minh
|
953 |
+
City University of Technology and Education) là một trường đại học đa ngành tại
|
954 |
+
Việt Nam, với thế mạnh về đào tạo kỹ thuật, được đánh giá là trường hàng đầu về
|
955 |
+
đào tạo khối ngành kỹ thuật tại miền Nam. Trường là một trong 6 Đại học Sư phạm
|
956 |
+
Kỹ thuật của cả nước – đào tạo kỹ thuật lấy ứng dụng làm trọng tâm để giảng dạy,
|
957 |
+
có chức năng đào tạo kỹ sư công nghệ và giáo viên kỹ thuật. Đồng thời cũng là
|
958 |
+
trung tâm nghiên cứu khoa học và chuyển giao công nghệ của miền Nam Việt Nam.'
|
959 |
+
- source_sentence: Xin vui lòng cung cấp địa chỉ, số điện thoại và email của các cơ
|
960 |
+
sở đào tạo thuộc Đại học FPT?
|
961 |
+
sentences:
|
962 |
+
- 'TP. Hồ Chí Minh: Khu Công nghệ cao, Quận 9. Đà Nẵng, Quy Nhơn, Cần Thơ: Các khu
|
963 |
+
vực trung tâm với cơ sở hiện đại. Đây là thông tin liên hệ của các cơ sở đào tạo
|
964 |
+
thuộc Đại học FPT trên toàn quốc, bao gồm các địa chỉ, số điện thoại, và email
|
965 |
+
của từng cơ sở. Các thông tin này giúp học sinh, phụ huynh, và đối tác dễ dàng
|
966 |
+
liên lạc hoặc đến trực tiếp các cơ sở của trường. Chi tiết từng cơ sở:
|
967 |
+
|
968 |
+
|
969 |
+
Hà Nội
|
970 |
+
|
971 |
+
|
972 |
+
Địa chỉ: Khu Giáo dục và Đào tạo – Khu Công nghệ cao Hòa Lạc, Km29 Đại lộ Thăng
|
973 |
+
Long, Huyện Thạch Thất, TP. Hà Nội. Điện thoại: (024) 7300 5588
|
974 |
+
|
975 |
+
|
976 |
+
Email: [email protected]
|
977 |
+
|
978 |
+
|
979 |
+
TP. Hồ Chí Minh
|
980 |
+
|
981 |
+
|
982 |
+
Địa chỉ: Lô E2a-7, Đường D1, Khu Công nghệ cao, Phường Long Thạnh Mỹ, TP.'
|
983 |
+
- 'Chính vì vậy các kỹ sư lập trình hiện nay đều thiếu kỹ năng ngoại ngữ và khả
|
984 |
+
năng tự học kiến thức mới Các vị trí công việc sau khi ra trường:
|
985 |
+
|
986 |
+
|
987 |
+
Lập trình viên phát triển ứng dụng
|
988 |
+
|
989 |
+
|
990 |
+
Kỹ sư cầu nối
|
991 |
+
|
992 |
+
|
993 |
+
Chuyên viên phân tích nghiệp vụ
|
994 |
+
|
995 |
+
|
996 |
+
Kỹ sư đảm bảo chất lượng phần mềm
|
997 |
+
|
998 |
+
|
999 |
+
Kỹ sư quy trình sản xuất phần mềm
|
1000 |
+
|
1001 |
+
|
1002 |
+
Quản trị viên dự án phần mềm và CNTT
|
1003 |
+
|
1004 |
+
|
1005 |
+
Giám đốc kỹ thuật
|
1006 |
+
|
1007 |
+
|
1008 |
+
Chuyên viên phát triển ứng dụng AI về xử lý hình ảnh, âm thanh
|
1009 |
+
|
1010 |
+
|
1011 |
+
**HỌC PHÍ TRƯỜNG ĐẠI HỌC FPT TẠI HÀ NỘI VÀ TP. HCM
|
1012 |
+
|
1013 |
+
|
1014 |
+
**ÁP DỤNG CHO SINH VIÊN NHẬP HỌC MỚI NĂM 2024 HỆ ĐẠI HỌC CHÍNH QUY
|
1015 |
+
|
1016 |
+
|
1017 |
+
Trường Đại học FPT trân trọng thông báo các mức học phí áp dụng cho sinh viên
|
1018 |
+
nhập học mới năm 2024 hệ đại học chính quy tại Hà Nội và TP. Hồ Chí Minh như sau:
|
1019 |
+
|
1020 |
+
|
1021 |
+
1. Học phí Chương trình chính khóa
|
1022 |
+
|
1023 |
+
|
1024 |
+
Số kỳ học: 9 học kỳ (bao gồm cả giai đoạn thực tập tại doanh nghiệp). Thời lượng
|
1025 |
+
học mỗi kỳ: 4 tháng. Học phí chuyên ngành:
|
1026 |
+
|
1027 |
+
|
1028 |
+
Từ học kỳ 1 đến học kỳ 3: 28,700,000 VNĐ/Học kỳ
|
1029 |
+
|
1030 |
+
|
1031 |
+
Từ học kỳ 4 đến học kỳ 6: 30,500,000 VNĐ/Học kỳ
|
1032 |
+
|
1033 |
+
|
1034 |
+
Từ học kỳ 7 đến học kỳ 9: 32,500,000 VNĐ/Học kỳ
|
1035 |
+
|
1036 |
+
|
1037 |
+
Mức học phí trên áp dụng cho sinh viên nhập học mới năm 2024 hệ đại học chính
|
1038 |
+
quy của Trường ĐH FPT, theo QĐ 08/QĐ-CTGDFPT ngày 12/01/2024 Quy định tài chính
|
1039 |
+
sinh viên năm học 2024-2025 các hệ đào tạo thuộc hệ thống giáo dục FPT.'
|
1040 |
+
- 'Các môn học được giảng dạy chủ yếu bằng tiếng Anh, giúp sinh viên phát triển
|
1041 |
+
kỹ năng ngoại ngữ cũng như kiến thức chuyên môn trong lĩnh vực sinh học. Chương
|
1042 |
+
trình chú trọng vào các kỹ năng nghiên cứu, phân tích và giải quyết vấn đề trong
|
1043 |
+
môi trường sinh học toàn cầu. CƠ SỞ VẬT CHẤT CHẤT LƯỢNG CAO
|
1044 |
+
|
1045 |
+
|
1046 |
+
Các sinh viên trong chương trình này sẽ được học tập và nghiên cứu trong một môi
|
1047 |
+
trường quốc tế hóa, với các thiết bị nghiên cứu hiện đại và các cơ sở vật chất
|
1048 |
+
đạt chuẩn quốc tế. Ngoài ra, các phòng thí nghiệm và khu vực học tập đều được
|
1049 |
+
trang bị công nghệ tiên tiến phục vụ cho nghiên cứu chuyên sâu. CÁC ĐIỂM ĐẶC BIỆT
|
1050 |
+
|
1051 |
+
|
1052 |
+
Học bằng tiếng Anh: Mọi môn học đều được giảng dạy bằng tiếng Anh, giúp sinh viên
|
1053 |
+
nâng cao khả năng ngoại ngữ và tiếp cận kiến thức quốc tế. Cơ hội trao đổi quốc
|
1054 |
+
tế: Sinh viên có cơ hội tham gia các chương trình trao đổi sinh viên, học tập
|
1055 |
+
tại các trường đối tác quốc tế. Hỗ trợ nghề nghiệp: Chương trình cung cấp các
|
1056 |
+
khóa huấn luyện và tư vấn nghề nghiệp, giúp sinh viên chuẩn bị tốt cho công việc
|
1057 |
+
sau khi tốt nghiệp. TRIỂN VỌNG NGHỀ NGHIỆP & CƠ HỘI VIỆC LÀM
|
1058 |
+
|
1059 |
+
|
1060 |
+
Với nền tảng kiến thức vững chắc và khả năng sử dụng tiếng Anh, sinh viên chương
|
1061 |
+
trình tăng cường tiếng Anh có thể làm việc tại:
|
1062 |
+
|
1063 |
+
|
1064 |
+
Các tổ chức nghiên cứu quốc tế, các viện nghiên cứu sinh học.'
|
1065 |
+
pipeline_tag: sentence-similarity
|
1066 |
+
library_name: sentence-transformers
|
1067 |
+
metrics:
|
1068 |
+
- cosine_accuracy@1
|
1069 |
+
- cosine_accuracy@3
|
1070 |
+
- cosine_accuracy@5
|
1071 |
+
- cosine_accuracy@10
|
1072 |
+
- cosine_precision@1
|
1073 |
+
- cosine_precision@3
|
1074 |
+
- cosine_precision@5
|
1075 |
+
- cosine_precision@10
|
1076 |
+
- cosine_recall@1
|
1077 |
+
- cosine_recall@3
|
1078 |
+
- cosine_recall@5
|
1079 |
+
- cosine_recall@10
|
1080 |
+
- cosine_ndcg@10
|
1081 |
+
- cosine_mrr@10
|
1082 |
+
- cosine_map@100
|
1083 |
+
model-index:
|
1084 |
+
- name: SentenceTransformer based on dangvantuan/vietnamese-document-embedding
|
1085 |
+
results:
|
1086 |
+
- task:
|
1087 |
+
type: information-retrieval
|
1088 |
+
name: Information Retrieval
|
1089 |
+
dataset:
|
1090 |
+
name: dim 768
|
1091 |
+
type: dim_768
|
1092 |
+
metrics:
|
1093 |
+
- type: cosine_accuracy@1
|
1094 |
+
value: 0.466
|
1095 |
+
name: Cosine Accuracy@1
|
1096 |
+
- type: cosine_accuracy@3
|
1097 |
+
value: 0.63
|
1098 |
+
name: Cosine Accuracy@3
|
1099 |
+
- type: cosine_accuracy@5
|
1100 |
+
value: 0.678
|
1101 |
+
name: Cosine Accuracy@5
|
1102 |
+
- type: cosine_accuracy@10
|
1103 |
+
value: 0.752
|
1104 |
+
name: Cosine Accuracy@10
|
1105 |
+
- type: cosine_precision@1
|
1106 |
+
value: 0.466
|
1107 |
+
name: Cosine Precision@1
|
1108 |
+
- type: cosine_precision@3
|
1109 |
+
value: 0.21
|
1110 |
+
name: Cosine Precision@3
|
1111 |
+
- type: cosine_precision@5
|
1112 |
+
value: 0.1356
|
1113 |
+
name: Cosine Precision@5
|
1114 |
+
- type: cosine_precision@10
|
1115 |
+
value: 0.0752
|
1116 |
+
name: Cosine Precision@10
|
1117 |
+
- type: cosine_recall@1
|
1118 |
+
value: 0.466
|
1119 |
+
name: Cosine Recall@1
|
1120 |
+
- type: cosine_recall@3
|
1121 |
+
value: 0.63
|
1122 |
+
name: Cosine Recall@3
|
1123 |
+
- type: cosine_recall@5
|
1124 |
+
value: 0.678
|
1125 |
+
name: Cosine Recall@5
|
1126 |
+
- type: cosine_recall@10
|
1127 |
+
value: 0.752
|
1128 |
+
name: Cosine Recall@10
|
1129 |
+
- type: cosine_ndcg@10
|
1130 |
+
value: 0.6057962726654487
|
1131 |
+
name: Cosine Ndcg@10
|
1132 |
+
- type: cosine_mrr@10
|
1133 |
+
value: 0.5595198412698414
|
1134 |
+
name: Cosine Mrr@10
|
1135 |
+
- type: cosine_map@100
|
1136 |
+
value: 0.5681839398170727
|
1137 |
+
name: Cosine Map@100
|
1138 |
+
- task:
|
1139 |
+
type: information-retrieval
|
1140 |
+
name: Information Retrieval
|
1141 |
+
dataset:
|
1142 |
+
name: dim 512
|
1143 |
+
type: dim_512
|
1144 |
+
metrics:
|
1145 |
+
- type: cosine_accuracy@1
|
1146 |
+
value: 0.464
|
1147 |
+
name: Cosine Accuracy@1
|
1148 |
+
- type: cosine_accuracy@3
|
1149 |
+
value: 0.626
|
1150 |
+
name: Cosine Accuracy@3
|
1151 |
+
- type: cosine_accuracy@5
|
1152 |
+
value: 0.684
|
1153 |
+
name: Cosine Accuracy@5
|
1154 |
+
- type: cosine_accuracy@10
|
1155 |
+
value: 0.746
|
1156 |
+
name: Cosine Accuracy@10
|
1157 |
+
- type: cosine_precision@1
|
1158 |
+
value: 0.464
|
1159 |
+
name: Cosine Precision@1
|
1160 |
+
- type: cosine_precision@3
|
1161 |
+
value: 0.20866666666666664
|
1162 |
+
name: Cosine Precision@3
|
1163 |
+
- type: cosine_precision@5
|
1164 |
+
value: 0.1368
|
1165 |
+
name: Cosine Precision@5
|
1166 |
+
- type: cosine_precision@10
|
1167 |
+
value: 0.0746
|
1168 |
+
name: Cosine Precision@10
|
1169 |
+
- type: cosine_recall@1
|
1170 |
+
value: 0.464
|
1171 |
+
name: Cosine Recall@1
|
1172 |
+
- type: cosine_recall@3
|
1173 |
+
value: 0.626
|
1174 |
+
name: Cosine Recall@3
|
1175 |
+
- type: cosine_recall@5
|
1176 |
+
value: 0.684
|
1177 |
+
name: Cosine Recall@5
|
1178 |
+
- type: cosine_recall@10
|
1179 |
+
value: 0.746
|
1180 |
+
name: Cosine Recall@10
|
1181 |
+
- type: cosine_ndcg@10
|
1182 |
+
value: 0.6015125723964755
|
1183 |
+
name: Cosine Ndcg@10
|
1184 |
+
- type: cosine_mrr@10
|
1185 |
+
value: 0.55565
|
1186 |
+
name: Cosine Mrr@10
|
1187 |
+
- type: cosine_map@100
|
1188 |
+
value: 0.5647776015769205
|
1189 |
+
name: Cosine Map@100
|
1190 |
+
- task:
|
1191 |
+
type: information-retrieval
|
1192 |
+
name: Information Retrieval
|
1193 |
+
dataset:
|
1194 |
+
name: dim 256
|
1195 |
+
type: dim_256
|
1196 |
+
metrics:
|
1197 |
+
- type: cosine_accuracy@1
|
1198 |
+
value: 0.454
|
1199 |
+
name: Cosine Accuracy@1
|
1200 |
+
- type: cosine_accuracy@3
|
1201 |
+
value: 0.602
|
1202 |
+
name: Cosine Accuracy@3
|
1203 |
+
- type: cosine_accuracy@5
|
1204 |
+
value: 0.674
|
1205 |
+
name: Cosine Accuracy@5
|
1206 |
+
- type: cosine_accuracy@10
|
1207 |
+
value: 0.73
|
1208 |
+
name: Cosine Accuracy@10
|
1209 |
+
- type: cosine_precision@1
|
1210 |
+
value: 0.454
|
1211 |
+
name: Cosine Precision@1
|
1212 |
+
- type: cosine_precision@3
|
1213 |
+
value: 0.20066666666666666
|
1214 |
+
name: Cosine Precision@3
|
1215 |
+
- type: cosine_precision@5
|
1216 |
+
value: 0.1348
|
1217 |
+
name: Cosine Precision@5
|
1218 |
+
- type: cosine_precision@10
|
1219 |
+
value: 0.073
|
1220 |
+
name: Cosine Precision@10
|
1221 |
+
- type: cosine_recall@1
|
1222 |
+
value: 0.454
|
1223 |
+
name: Cosine Recall@1
|
1224 |
+
- type: cosine_recall@3
|
1225 |
+
value: 0.602
|
1226 |
+
name: Cosine Recall@3
|
1227 |
+
- type: cosine_recall@5
|
1228 |
+
value: 0.674
|
1229 |
+
name: Cosine Recall@5
|
1230 |
+
- type: cosine_recall@10
|
1231 |
+
value: 0.73
|
1232 |
+
name: Cosine Recall@10
|
1233 |
+
- type: cosine_ndcg@10
|
1234 |
+
value: 0.5886054274273598
|
1235 |
+
name: Cosine Ndcg@10
|
1236 |
+
- type: cosine_mrr@10
|
1237 |
+
value: 0.5436785714285712
|
1238 |
+
name: Cosine Mrr@10
|
1239 |
+
- type: cosine_map@100
|
1240 |
+
value: 0.5535436564504117
|
1241 |
+
name: Cosine Map@100
|
1242 |
+
---
|
1243 |
+
|
1244 |
+
# SentenceTransformer based on dangvantuan/vietnamese-document-embedding
|
1245 |
+
|
1246 |
+
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.
|
1247 |
+
|
1248 |
+
## Model Details
|
1249 |
+
|
1250 |
+
### Model Description
|
1251 |
+
- **Model Type:** Sentence Transformer
|
1252 |
+
- **Base model:** [dangvantuan/vietnamese-document-embedding](https://huggingface.co/dangvantuan/vietnamese-document-embedding) <!-- at revision 6fa4e2f8ed2d33120b0f4442cc81f8f973c3f56b -->
|
1253 |
+
- **Maximum Sequence Length:** 8192 tokens
|
1254 |
+
- **Output Dimensionality:** 768 dimensions
|
1255 |
+
- **Similarity Function:** Cosine Similarity
|
1256 |
+
<!-- - **Training Dataset:** Unknown -->
|
1257 |
+
<!-- - **Language:** Unknown -->
|
1258 |
+
<!-- - **License:** Unknown -->
|
1259 |
+
|
1260 |
+
### Model Sources
|
1261 |
+
|
1262 |
+
- **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
|
1263 |
+
- **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
|
1264 |
+
- **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
|
1265 |
+
|
1266 |
+
### Full Model Architecture
|
1267 |
+
|
1268 |
+
```
|
1269 |
+
SentenceTransformer(
|
1270 |
+
(0): Transformer({'max_seq_length': 8192, 'do_lower_case': False, 'architecture': 'VietnameseModel'})
|
1271 |
+
(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})
|
1272 |
+
(2): Normalize()
|
1273 |
+
)
|
1274 |
+
```
|
1275 |
+
|
1276 |
+
## Usage
|
1277 |
+
|
1278 |
+
### Direct Usage (Sentence Transformers)
|
1279 |
+
|
1280 |
+
First install the Sentence Transformers library:
|
1281 |
+
|
1282 |
+
```bash
|
1283 |
+
pip install -U sentence-transformers
|
1284 |
+
```
|
1285 |
+
|
1286 |
+
Then you can load this model and run inference.
|
1287 |
+
```python
|
1288 |
+
from sentence_transformers import SentenceTransformer
|
1289 |
+
|
1290 |
+
# Download from the 🤗 Hub
|
1291 |
+
model = SentenceTransformer("HoangVuSnape/vietnamese-document-embedding-finetuned-univ15")
|
1292 |
+
# Run inference
|
1293 |
+
sentences = [
|
1294 |
+
'Xin vui lòng cung cấp địa chỉ, số điện thoại và email của các cơ sở đào tạo thuộc Đại học FPT?',
|
1295 |
+
'TP. Hồ Chí Minh: Khu Công nghệ cao, Quận 9. Đà Nẵng, Quy Nhơn, Cần Thơ: Các khu vực trung tâm với cơ sở hiện đại. Đây là thông tin liên hệ của các cơ sở đào tạo thuộc Đại học FPT trên toàn quốc, bao gồm các địa chỉ, số điện thoại, và email của từng cơ sở. Các thông tin này giúp học sinh, phụ huynh, và đối tác dễ dàng liên lạc hoặc đến trực tiếp các cơ sở của trường. Chi tiết từng cơ sở:\n\nHà Nội\n\nĐịa chỉ: Khu Giáo dục và Đào tạo – Khu Công nghệ cao Hòa Lạc, Km29 Đại lộ Thăng Long, Huyện Thạch Thất, TP. Hà Nội. Điện thoại: (024) 7300 5588\n\nEmail: [email protected]\n\nTP. Hồ Chí Minh\n\nĐịa chỉ: Lô E2a-7, Đường D1, Khu Công nghệ cao, Phường Long Thạnh Mỹ, TP.',
|
1296 |
+
'Chính vì vậy các kỹ sư lập trình hiện nay đều thiếu kỹ năng ngoại ngữ và khả năng tự học kiến thức mới Các vị trí công việc sau khi ra trường:\n\nLập trình viên phát triển ứng dụng\n\nKỹ sư cầu nối\n\nChuyên viên phân tích nghiệp vụ\n\nKỹ sư đảm bảo chất lượng phần mềm\n\nKỹ sư quy trình sản xuất phần mềm\n\nQuản trị viên dự án phần mềm và CNTT\n\nGiám đốc kỹ thuật\n\nChuyên viên phát triển ứng dụng AI về xử lý hình ảnh, âm thanh\n\n**HỌC PHÍ TRƯỜNG ĐẠI HỌC FPT TẠI HÀ NỘI VÀ TP. HCM\n\n**ÁP DỤNG CHO SINH VIÊN NHẬP HỌC MỚI NĂM 2024 HỆ ĐẠI HỌC CHÍNH QUY\n\nTrường Đại học FPT trân trọng thông báo các mức học phí áp dụng cho sinh viên nhập học mới năm 2024 hệ đại học chính quy tại Hà Nội và TP. Hồ Chí Minh như sau:\n\n1. Học phí Chương trình chính khóa\n\nSố kỳ học: 9 học kỳ (bao gồm cả giai đoạn thực tập tại doanh nghiệp). Thời lượng học mỗi kỳ: 4 tháng. Học phí chuyên ngành:\n\nTừ học kỳ 1 đến học kỳ 3: 28,700,000 VNĐ/Học kỳ\n\nTừ học kỳ 4 đến học kỳ 6: 30,500,000 VNĐ/Học kỳ\n\nTừ học kỳ 7 đến học kỳ 9: 32,500,000 VNĐ/Học kỳ\n\nMức học phí trên áp dụng cho sinh viên nhập học mới năm 2024 hệ đại học chính quy của Trường ĐH FPT, theo QĐ 08/QĐ-CTGDFPT ngày 12/01/2024 Quy định tài chính sinh viên năm học 2024-2025 các hệ đào tạo thuộc hệ thống giáo dục FPT.',
|
1297 |
+
]
|
1298 |
+
embeddings = model.encode(sentences)
|
1299 |
+
print(embeddings.shape)
|
1300 |
+
# [3, 768]
|
1301 |
+
|
1302 |
+
# Get the similarity scores for the embeddings
|
1303 |
+
similarities = model.similarity(embeddings, embeddings)
|
1304 |
+
print(similarities)
|
1305 |
+
# tensor([[1.0000, 0.7543, 0.5277],
|
1306 |
+
# [0.7543, 1.0000, 0.4779],
|
1307 |
+
# [0.5277, 0.4779, 1.0000]])
|
1308 |
+
```
|
1309 |
+
|
1310 |
+
<!--
|
1311 |
+
### Direct Usage (Transformers)
|
1312 |
+
|
1313 |
+
<details><summary>Click to see the direct usage in Transformers</summary>
|
1314 |
+
|
1315 |
+
</details>
|
1316 |
+
-->
|
1317 |
+
|
1318 |
+
<!--
|
1319 |
+
### Downstream Usage (Sentence Transformers)
|
1320 |
+
|
1321 |
+
You can finetune this model on your own dataset.
|
1322 |
+
|
1323 |
+
<details><summary>Click to expand</summary>
|
1324 |
+
|
1325 |
+
</details>
|
1326 |
+
-->
|
1327 |
+
|
1328 |
+
<!--
|
1329 |
+
### Out-of-Scope Use
|
1330 |
+
|
1331 |
+
*List how the model may foreseeably be misused and address what users ought not to do with the model.*
|
1332 |
+
-->
|
1333 |
+
|
1334 |
+
## Evaluation
|
1335 |
+
|
1336 |
+
### Metrics
|
1337 |
+
|
1338 |
+
#### Information Retrieval
|
1339 |
+
|
1340 |
+
* Dataset: `dim_768`
|
1341 |
+
* Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator) with these parameters:
|
1342 |
+
```json
|
1343 |
+
{
|
1344 |
+
"truncate_dim": 768
|
1345 |
+
}
|
1346 |
+
```
|
1347 |
+
|
1348 |
+
| Metric | Value |
|
1349 |
+
|:--------------------|:-----------|
|
1350 |
+
| cosine_accuracy@1 | 0.466 |
|
1351 |
+
| cosine_accuracy@3 | 0.63 |
|
1352 |
+
| cosine_accuracy@5 | 0.678 |
|
1353 |
+
| cosine_accuracy@10 | 0.752 |
|
1354 |
+
| cosine_precision@1 | 0.466 |
|
1355 |
+
| cosine_precision@3 | 0.21 |
|
1356 |
+
| cosine_precision@5 | 0.1356 |
|
1357 |
+
| cosine_precision@10 | 0.0752 |
|
1358 |
+
| cosine_recall@1 | 0.466 |
|
1359 |
+
| cosine_recall@3 | 0.63 |
|
1360 |
+
| cosine_recall@5 | 0.678 |
|
1361 |
+
| cosine_recall@10 | 0.752 |
|
1362 |
+
| **cosine_ndcg@10** | **0.6058** |
|
1363 |
+
| cosine_mrr@10 | 0.5595 |
|
1364 |
+
| cosine_map@100 | 0.5682 |
|
1365 |
+
|
1366 |
+
#### Information Retrieval
|
1367 |
+
|
1368 |
+
* Dataset: `dim_512`
|
1369 |
+
* Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator) with these parameters:
|
1370 |
+
```json
|
1371 |
+
{
|
1372 |
+
"truncate_dim": 512
|
1373 |
+
}
|
1374 |
+
```
|
1375 |
+
|
1376 |
+
| Metric | Value |
|
1377 |
+
|:--------------------|:-----------|
|
1378 |
+
| cosine_accuracy@1 | 0.464 |
|
1379 |
+
| cosine_accuracy@3 | 0.626 |
|
1380 |
+
| cosine_accuracy@5 | 0.684 |
|
1381 |
+
| cosine_accuracy@10 | 0.746 |
|
1382 |
+
| cosine_precision@1 | 0.464 |
|
1383 |
+
| cosine_precision@3 | 0.2087 |
|
1384 |
+
| cosine_precision@5 | 0.1368 |
|
1385 |
+
| cosine_precision@10 | 0.0746 |
|
1386 |
+
| cosine_recall@1 | 0.464 |
|
1387 |
+
| cosine_recall@3 | 0.626 |
|
1388 |
+
| cosine_recall@5 | 0.684 |
|
1389 |
+
| cosine_recall@10 | 0.746 |
|
1390 |
+
| **cosine_ndcg@10** | **0.6015** |
|
1391 |
+
| cosine_mrr@10 | 0.5556 |
|
1392 |
+
| cosine_map@100 | 0.5648 |
|
1393 |
+
|
1394 |
+
#### Information Retrieval
|
1395 |
+
|
1396 |
+
* Dataset: `dim_256`
|
1397 |
+
* Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator) with these parameters:
|
1398 |
+
```json
|
1399 |
+
{
|
1400 |
+
"truncate_dim": 256
|
1401 |
+
}
|
1402 |
+
```
|
1403 |
+
|
1404 |
+
| Metric | Value |
|
1405 |
+
|:--------------------|:-----------|
|
1406 |
+
| cosine_accuracy@1 | 0.454 |
|
1407 |
+
| cosine_accuracy@3 | 0.602 |
|
1408 |
+
| cosine_accuracy@5 | 0.674 |
|
1409 |
+
| cosine_accuracy@10 | 0.73 |
|
1410 |
+
| cosine_precision@1 | 0.454 |
|
1411 |
+
| cosine_precision@3 | 0.2007 |
|
1412 |
+
| cosine_precision@5 | 0.1348 |
|
1413 |
+
| cosine_precision@10 | 0.073 |
|
1414 |
+
| cosine_recall@1 | 0.454 |
|
1415 |
+
| cosine_recall@3 | 0.602 |
|
1416 |
+
| cosine_recall@5 | 0.674 |
|
1417 |
+
| cosine_recall@10 | 0.73 |
|
1418 |
+
| **cosine_ndcg@10** | **0.5886** |
|
1419 |
+
| cosine_mrr@10 | 0.5437 |
|
1420 |
+
| cosine_map@100 | 0.5535 |
|
1421 |
+
|
1422 |
+
<!--
|
1423 |
+
## Bias, Risks and Limitations
|
1424 |
+
|
1425 |
+
*What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
|
1426 |
+
-->
|
1427 |
+
|
1428 |
+
<!--
|
1429 |
+
### Recommendations
|
1430 |
+
|
1431 |
+
*What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
|
1432 |
+
-->
|
1433 |
+
|
1434 |
+
## Training Details
|
1435 |
+
|
1436 |
+
### Training Dataset
|
1437 |
+
|
1438 |
+
#### Unnamed Dataset
|
1439 |
+
|
1440 |
+
* Size: 500 training samples
|
1441 |
+
* Columns: <code>anchor</code> and <code>positive</code>
|
1442 |
+
* Approximate statistics based on the first 500 samples:
|
1443 |
+
| | anchor | positive |
|
1444 |
+
|:--------|:-----------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------|
|
1445 |
+
| type | string | string |
|
1446 |
+
| details | <ul><li>min: 10 tokens</li><li>mean: 26.05 tokens</li><li>max: 62 tokens</li></ul> | <ul><li>min: 29 tokens</li><li>mean: 605.11 tokens</li><li>max: 6602 tokens</li></ul> |
|
1447 |
+
* Samples:
|
1448 |
+
| anchor | positive |
|
1449 |
+
|:-----------------------------------------------------------------------------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
1450 |
+
| <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> |
|
1451 |
+
| <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> |
|
1452 |
+
| <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> |
|
1453 |
+
* Loss: [<code>MatryoshkaLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#matryoshkaloss) with these parameters:
|
1454 |
+
```json
|
1455 |
+
{
|
1456 |
+
"loss": "MultipleNegativesRankingLoss",
|
1457 |
+
"matryoshka_dims": [
|
1458 |
+
768,
|
1459 |
+
512,
|
1460 |
+
256
|
1461 |
+
],
|
1462 |
+
"matryoshka_weights": [
|
1463 |
+
1,
|
1464 |
+
1,
|
1465 |
+
1
|
1466 |
+
],
|
1467 |
+
"n_dims_per_step": -1
|
1468 |
+
}
|
1469 |
+
```
|
1470 |
+
|
1471 |
+
### Training Hyperparameters
|
1472 |
+
#### Non-Default Hyperparameters
|
1473 |
+
|
1474 |
+
- `eval_strategy`: steps
|
1475 |
+
- `per_device_train_batch_size`: 1
|
1476 |
+
- `per_device_eval_batch_size`: 1
|
1477 |
+
- `gradient_accumulation_steps`: 10
|
1478 |
+
- `learning_rate`: 2e-05
|
1479 |
+
- `num_train_epochs`: 1
|
1480 |
+
- `lr_scheduler_type`: cosine
|
1481 |
+
- `warmup_ratio`: 0.1
|
1482 |
+
- `fp16`: True
|
1483 |
+
- `load_best_model_at_end`: True
|
1484 |
+
- `optim`: adamw_torch_fused
|
1485 |
+
- `batch_sampler`: no_duplicates
|
1486 |
+
|
1487 |
+
#### All Hyperparameters
|
1488 |
+
<details><summary>Click to expand</summary>
|
1489 |
+
|
1490 |
+
- `overwrite_output_dir`: False
|
1491 |
+
- `do_predict`: False
|
1492 |
+
- `eval_strategy`: steps
|
1493 |
+
- `prediction_loss_only`: True
|
1494 |
+
- `per_device_train_batch_size`: 1
|
1495 |
+
- `per_device_eval_batch_size`: 1
|
1496 |
+
- `per_gpu_train_batch_size`: None
|
1497 |
+
- `per_gpu_eval_batch_size`: None
|
1498 |
+
- `gradient_accumulation_steps`: 10
|
1499 |
+
- `eval_accumulation_steps`: None
|
1500 |
+
- `torch_empty_cache_steps`: None
|
1501 |
+
- `learning_rate`: 2e-05
|
1502 |
+
- `weight_decay`: 0.0
|
1503 |
+
- `adam_beta1`: 0.9
|
1504 |
+
- `adam_beta2`: 0.999
|
1505 |
+
- `adam_epsilon`: 1e-08
|
1506 |
+
- `max_grad_norm`: 1.0
|
1507 |
+
- `num_train_epochs`: 1
|
1508 |
+
- `max_steps`: -1
|
1509 |
+
- `lr_scheduler_type`: cosine
|
1510 |
+
- `lr_scheduler_kwargs`: {}
|
1511 |
+
- `warmup_ratio`: 0.1
|
1512 |
+
- `warmup_steps`: 0
|
1513 |
+
- `log_level`: passive
|
1514 |
+
- `log_level_replica`: warning
|
1515 |
+
- `log_on_each_node`: True
|
1516 |
+
- `logging_nan_inf_filter`: True
|
1517 |
+
- `save_safetensors`: True
|
1518 |
+
- `save_on_each_node`: False
|
1519 |
+
- `save_only_model`: False
|
1520 |
+
- `restore_callback_states_from_checkpoint`: False
|
1521 |
+
- `no_cuda`: False
|
1522 |
+
- `use_cpu`: False
|
1523 |
+
- `use_mps_device`: False
|
1524 |
+
- `seed`: 42
|
1525 |
+
- `data_seed`: None
|
1526 |
+
- `jit_mode_eval`: False
|
1527 |
+
- `use_ipex`: False
|
1528 |
+
- `bf16`: False
|
1529 |
+
- `fp16`: True
|
1530 |
+
- `fp16_opt_level`: O1
|
1531 |
+
- `half_precision_backend`: auto
|
1532 |
+
- `bf16_full_eval`: False
|
1533 |
+
- `fp16_full_eval`: False
|
1534 |
+
- `tf32`: None
|
1535 |
+
- `local_rank`: 0
|
1536 |
+
- `ddp_backend`: None
|
1537 |
+
- `tpu_num_cores`: None
|
1538 |
+
- `tpu_metrics_debug`: False
|
1539 |
+
- `debug`: []
|
1540 |
+
- `dataloader_drop_last`: False
|
1541 |
+
- `dataloader_num_workers`: 0
|
1542 |
+
- `dataloader_prefetch_factor`: None
|
1543 |
+
- `past_index`: -1
|
1544 |
+
- `disable_tqdm`: False
|
1545 |
+
- `remove_unused_columns`: True
|
1546 |
+
- `label_names`: None
|
1547 |
+
- `load_best_model_at_end`: True
|
1548 |
+
- `ignore_data_skip`: False
|
1549 |
+
- `fsdp`: []
|
1550 |
+
- `fsdp_min_num_params`: 0
|
1551 |
+
- `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
|
1552 |
+
- `fsdp_transformer_layer_cls_to_wrap`: None
|
1553 |
+
- `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
|
1554 |
+
- `deepspeed`: None
|
1555 |
+
- `label_smoothing_factor`: 0.0
|
1556 |
+
- `optim`: adamw_torch_fused
|
1557 |
+
- `optim_args`: None
|
1558 |
+
- `adafactor`: False
|
1559 |
+
- `group_by_length`: False
|
1560 |
+
- `length_column_name`: length
|
1561 |
+
- `ddp_find_unused_parameters`: None
|
1562 |
+
- `ddp_bucket_cap_mb`: None
|
1563 |
+
- `ddp_broadcast_buffers`: False
|
1564 |
+
- `dataloader_pin_memory`: True
|
1565 |
+
- `dataloader_persistent_workers`: False
|
1566 |
+
- `skip_memory_metrics`: True
|
1567 |
+
- `use_legacy_prediction_loop`: False
|
1568 |
+
- `push_to_hub`: False
|
1569 |
+
- `resume_from_checkpoint`: None
|
1570 |
+
- `hub_model_id`: None
|
1571 |
+
- `hub_strategy`: every_save
|
1572 |
+
- `hub_private_repo`: None
|
1573 |
+
- `hub_always_push`: False
|
1574 |
+
- `hub_revision`: None
|
1575 |
+
- `gradient_checkpointing`: False
|
1576 |
+
- `gradient_checkpointing_kwargs`: None
|
1577 |
+
- `include_inputs_for_metrics`: False
|
1578 |
+
- `include_for_metrics`: []
|
1579 |
+
- `eval_do_concat_batches`: True
|
1580 |
+
- `fp16_backend`: auto
|
1581 |
+
- `push_to_hub_model_id`: None
|
1582 |
+
- `push_to_hub_organization`: None
|
1583 |
+
- `mp_parameters`:
|
1584 |
+
- `auto_find_batch_size`: False
|
1585 |
+
- `full_determinism`: False
|
1586 |
+
- `torchdynamo`: None
|
1587 |
+
- `ray_scope`: last
|
1588 |
+
- `ddp_timeout`: 1800
|
1589 |
+
- `torch_compile`: False
|
1590 |
+
- `torch_compile_backend`: None
|
1591 |
+
- `torch_compile_mode`: None
|
1592 |
+
- `include_tokens_per_second`: False
|
1593 |
+
- `include_num_input_tokens_seen`: False
|
1594 |
+
- `neftune_noise_alpha`: None
|
1595 |
+
- `optim_target_modules`: None
|
1596 |
+
- `batch_eval_metrics`: False
|
1597 |
+
- `eval_on_start`: False
|
1598 |
+
- `use_liger_kernel`: False
|
1599 |
+
- `liger_kernel_config`: None
|
1600 |
+
- `eval_use_gather_object`: False
|
1601 |
+
- `average_tokens_across_devices`: False
|
1602 |
+
- `prompts`: None
|
1603 |
+
- `batch_sampler`: no_duplicates
|
1604 |
+
- `multi_dataset_batch_sampler`: proportional
|
1605 |
+
- `router_mapping`: {}
|
1606 |
+
- `learning_rate_mapping`: {}
|
1607 |
+
|
1608 |
+
</details>
|
1609 |
+
|
1610 |
+
### Training Logs
|
1611 |
+
| Epoch | Step | Training Loss | dim_768_cosine_ndcg@10 | dim_512_cosine_ndcg@10 | dim_256_cosine_ndcg@10 |
|
1612 |
+
|:-------:|:------:|:-------------:|:----------------------:|:----------------------:|:----------------------:|
|
1613 |
+
| -1 | -1 | - | 0.6061 | 0.6015 | 0.5884 |
|
1614 |
+
| **0.2** | **10** | **0.0** | **0.6058** | **0.6015** | **0.5886** |
|
1615 |
+
| 0.4 | 20 | 0.0 | 0.6058 | 0.6015 | 0.5886 |
|
1616 |
+
| 0.6 | 30 | 0.0 | 0.6058 | 0.6015 | 0.5886 |
|
1617 |
+
| 0.8 | 40 | 0.0 | 0.6058 | 0.6015 | 0.5886 |
|
1618 |
+
| 1.0 | 50 | 0.0 | 0.6058 | 0.6015 | 0.5886 |
|
1619 |
+
|
1620 |
+
* The bold row denotes the saved checkpoint.
|
1621 |
+
|
1622 |
+
### Framework Versions
|
1623 |
+
- Python: 3.10.12
|
1624 |
+
- Sentence Transformers: 5.0.0
|
1625 |
+
- Transformers: 4.54.0
|
1626 |
+
- PyTorch: 2.7.1+cu118
|
1627 |
+
- Accelerate: 1.9.0
|
1628 |
+
- Datasets: 4.0.0
|
1629 |
+
- Tokenizers: 0.21.2
|
1630 |
+
|
1631 |
+
## Citation
|
1632 |
+
|
1633 |
+
### BibTeX
|
1634 |
+
|
1635 |
+
#### Sentence Transformers
|
1636 |
+
```bibtex
|
1637 |
+
@inproceedings{reimers-2019-sentence-bert,
|
1638 |
+
title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
|
1639 |
+
author = "Reimers, Nils and Gurevych, Iryna",
|
1640 |
+
booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
|
1641 |
+
month = "11",
|
1642 |
+
year = "2019",
|
1643 |
+
publisher = "Association for Computational Linguistics",
|
1644 |
+
url = "https://arxiv.org/abs/1908.10084",
|
1645 |
+
}
|
1646 |
+
```
|
1647 |
+
|
1648 |
+
#### MatryoshkaLoss
|
1649 |
+
```bibtex
|
1650 |
+
@misc{kusupati2024matryoshka,
|
1651 |
+
title={Matryoshka Representation Learning},
|
1652 |
+
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},
|
1653 |
+
year={2024},
|
1654 |
+
eprint={2205.13147},
|
1655 |
+
archivePrefix={arXiv},
|
1656 |
+
primaryClass={cs.LG}
|
1657 |
+
}
|
1658 |
+
```
|
1659 |
+
|
1660 |
+
#### MultipleNegativesRankingLoss
|
1661 |
+
```bibtex
|
1662 |
+
@misc{henderson2017efficient,
|
1663 |
+
title={Efficient Natural Language Response Suggestion for Smart Reply},
|
1664 |
+
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},
|
1665 |
+
year={2017},
|
1666 |
+
eprint={1705.00652},
|
1667 |
+
archivePrefix={arXiv},
|
1668 |
+
primaryClass={cs.CL}
|
1669 |
+
}
|
1670 |
+
```
|
1671 |
+
|
1672 |
+
<!--
|
1673 |
+
## Glossary
|
1674 |
+
|
1675 |
+
*Clearly define terms in order to be accessible across audiences.*
|
1676 |
+
-->
|
1677 |
+
|
1678 |
+
<!--
|
1679 |
+
## Model Card Authors
|
1680 |
+
|
1681 |
+
*Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
|
1682 |
+
-->
|
1683 |
+
|
1684 |
+
<!--
|
1685 |
+
## Model Card Contact
|
1686 |
+
|
1687 |
+
*Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
|
1688 |
+
-->
|
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.54.0",
|
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.0.0",
|
4 |
+
"transformers": "4.54.0",
|
5 |
+
"pytorch": "2.7.1+cu118"
|
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:065a1836422f393b06c40cc2aabb25c36c401692cdb38239e3fe4eb8b59fce23
|
3 |
+
size 1221487872
|
modeling.py
ADDED
@@ -0,0 +1,1319 @@
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
}
|