Provide the written-out form of the input text in Vietnamese. If the text is fully not…
- User
Provide the written-out form of the input text in Vietnamese. If the text is fully not Vietnamese, return empty. Then, identify and classify any number written in digit form by the following tags: + Cardinal: If the number after be expanded to word and should be read as cardinal (E.g. 123 is expanded to "một trăm hai mươi ba"; 26 is expanded to "hai mươi sáu") + Digit: If the number after be expanded to word and should be read each digit that make it up (E.g. 0123456 is expanded to "không một hai ba bốn năm sáu", 113 is expanded to "một một ba") + Ordinal: If the number after be expanded to word and should be read as ordinal (E.g. 1 is expanded to "nhất", 2 is expanded to "nhì", 4 is expanded to "tư")
The number can be alone as a single word or a part of a word (E.g. "150" is a part if "KA-150S", "100" is a part of "100VND", "2" is a part of "2cm", "23" is a part of "23.1").
Output the results as a JSON object with the following structure: { "raw_text": original text, "exp_text": expanded sentence, "exp_num": [ {"number": original number, "position": (start index, end index), "expand": expanded number, "tag": tag} ] }.
Example input: {"text": "thứ 4, ngày 1/6, bão nhiệt đới: tốc độ gió từ 39 - 73m 1 phút"}. Expected output (do not add json word, do not add line continuation character): { 'raw_text': "thứ 4, ngày 1/6, bão nhiệt đới: tốc độ gió từ 39 - 73m 1 phút", 'exp_text': 'ngày một tháng sáu, bão nhiệt đới: tốc độ gió từ ba mươi chín đến bảy mươi ba mét một phút', 'exp_num': [ {"number": "4", "position": (4, 5), "expand": "tư", "tag": "ordinal"}, {"number": "1", "position": (12, 13), "expand": "một", "tag": "digit"}, {"number": "6", "position": (14, 15), "expand": "sáu", "tag": "digit"}, {"number": "39", "position": (44, 46), "expand": "ba mươi chín", "tag": "cardinal"}, {"number": "73", "position": (49, 51), "expand": "bảy mươi ba", "tag": "cardianl"}, {"number": "1", "position": (53, 54), "expand": "một", "tag": "digit"}, ] }
Input: 'text': Cháy nghiêm trọng tại hà nội. Theo thông tin ban đầu vụ cháy xảy ra vào hơn 3h40 phút rạng sáng ngày 1/6/2024 tại ngõ 35/75 Đường quang trung, phường Đống đa, quận tây hồ, Hà Nội.
- Assistant
{ 'raw_text': 'Cháy nghiêm trọng tại hà nội. Theo thông tin ban đầu vụ cháy xảy ra vào hơn 3h40 phút rạng sáng ngày 1/6/2024 tại ngõ 35/75 Đường quang trung, phường Đống đa, quận tây hồ, Hà Nội.', 'exp_text': 'Cháy nghiêm trọng tại hà nội. Theo thông tin ban đầu vụ cháy xảy ra vào hơn ba giờ bốn mươi phút rạng sáng ngày một tháng sáu năm hai nghìn không trăm hai mươi tư tại ngõ ba mươi lăm trên bảy mươi lăm Đường quang trung, phường Đống đa, quận tây hồ, Hà Nội.', 'exp_num': [ {"number": "3", "position": (75, 76), "expand": "ba", "tag": "digit"}, {"number": "40", "position": (78, 80), "expand": "bốn mươi", "tag": "cardinal"}, {"number": "1", "position": (101, 102), "expand": "một", "tag": "digit"}, {"number": "6", "position": (103, 104), "expand": "sáu", "tag": "digit"}, {"number": "2024", "position": (105, 109), "expand": "hai nghìn không trăm hai mươi tư", "tag": "cardinal"}, {"number": "35", "position": (118, 120), "expand": "ba mươi lăm", "tag": "cardinal"}, {"number": "75", "position": (121, 123), "expand": "bảy mươi lăm", "tag": "cardinal"} ] }