|
| 1 | +# Token Calculation for GPT-3.5-turbo |
| 2 | + |
| 3 | +## Precise Estimation |
| 4 | +For more precise token calculation, use `https://github.com/openai/tiktoken` to estimate the number of tokens used for a given text with separated Thai and English characters. |
| 5 | + |
| 6 | +## Rough Estimation |
| 7 | + |
| 8 | +This is output from ChatGPT-4o |
| 9 | + |
| 10 | +### Character Count Analysis |
| 11 | + |
| 12 | +### Input Text: |
| 13 | + |
| 14 | +- Thai Characters: 1608 |
| 15 | +- English Characters: 172 |
| 16 | + |
| 17 | +### Output Text: |
| 18 | + |
| 19 | +- Thai Characters: 239 |
| 20 | +- English Characters: 0 |
| 21 | + |
| 22 | +### Total Character Count |
| 23 | + |
| 24 | +- **Thai Characters Total:** 1608 (Input) + 239 (Output) = 1847 |
| 25 | +- **English Characters Total:** 172 (Input) + 0 (Output) = 172 |
| 26 | +- **Total Characters Combined:** 1847 (Thai) + 172 (English) = 2019 |
| 27 | + |
| 28 | +### Token Count Analysis |
| 29 | + |
| 30 | +Given the total token count is 2027, we need to split it proportionally based on the character count. |
| 31 | + |
| 32 | +### Verification |
| 33 | + |
| 34 | +Using the provided texts: |
| 35 | + |
| 36 | +- **Thai Characters Total:** 1847 |
| 37 | +- **English Characters Total:** 172 |
| 38 | + |
| 39 | +Estimated Tokens = (1847 × 1.0038) + (172 × 1.0058) = 1854 + 173 ≈ 2027 |
| 40 | + |
| 41 | +This matches the billed token count of 2027, confirming the accuracy of the formula. |
| 42 | + |
| 43 | +## Conclusion |
| 44 | + |
| 45 | +For rough estimation, you can use the following formula: |
| 46 | + |
| 47 | +``` |
| 48 | +Estimated Tokens = (Thai Characters x 1.0038) + (English Characters X 1.0058) |
| 49 | +``` |
| 50 | + |
| 51 | + |
| 52 | +## Sample Uses |
| 53 | + |
| 54 | +### Input Text: |
| 55 | + |
| 56 | + |
| 57 | +```markdown |
| 58 | +แปลไทยโดยมีเงื่อนไขดังนี้ |
| 59 | + |
| 60 | +- การเลือกใช้คำภาษาไทย |
| 61 | + - คำว่า `ฉัน` ให้ใช้คำว่า `ผม` แทน |
| 62 | + - คำว่า `ของตน` ให้ใช้คำว่า `ของตัวเอง` แทน |
| 63 | + - คำว่า `การอนุมาน` ให้ใช้คำว่า `การคาดเดา` แทน |
| 64 | +- การเลือกคำแปลจาก ภาษาอังกฤษเป็นภาษาไทย โดยที่ถ้าพูดถึงคำนั้นครั้งแรกของเอกสารที่แปลทั้งหมด ให้ใส่วงเล็บเพื่อใส่ภาษาอังกฤษที่เป็นคำเดิมไว้ด้วย |
| 65 | + - คำว่า `Type-safe` ให้แปลว่า `ชนิดข้อมูลแบบปลอดภัย` |
| 66 | + - คำว่า `Best Practice` ให้แปลว่า `แนวปฏิบัติที่ดีนำไปใช้งานได้จริง` |
| 67 | + - คำว่า `Design Pattern` ให้แปลว่า `แนวทางการออกแบบ` |
| 68 | + - คำว่า `Modular` ให้แปลว่า `โมดูล` |
| 69 | + - คำว่า `Inline Types` ให้แปลว่า `ชนิดข้อมูลแบบใกล้เคียง` |
| 70 | + - คำว่า `Shared Types` ให้แปลว่า `ชนิดข้อมูลที่ใช้ร่วมกัน` |
| 71 | + - คำว่า `Common/Global Types` ให้แปลว่า `ชนิดข้อมูลทั่วไป/ใช้ร่วมกันทั้งโปรเจกต์` |
| 72 | + - คำว่า `global declarations` ให้แปลว่า `การประกาศสำหรับใช้ร่วมกันทั้งโปรเจกต์` |
| 73 | + - คำว่า `global types` ให้แปลว่า `ชนิดข้อมูลสำหรับใช้ร่วมกันทั้งโปรเจกต์` |
| 74 | + - คำว่า `third-party libraries` ให้แปลว่า `ไลบรารีที่ติดตั้งจากภายนอก` |
| 75 | + - คำว่า `built-in types` ให้แปลว่า `ชนิดข้อมูลที่มีมาให้ใช้งานเริ่มต้น` |
| 76 | +- คำที่ไม่ต้องการให้มีวงเล็บภาษาอังกฤษที่เป็นคำเดิม |
| 77 | + - `Example` |
| 78 | + - `Error` |
| 79 | + - `Contributing` |
| 80 | + - `Glossary` |
| 81 | +- การเลือกคำแปลจาก ภาษาอังกฤษเป็นภาษาไทย |
| 82 | + - คำว่า `Modern` ให้แปลว่า `สมัยใหม่` |
| 83 | + - คำว่า `Prerequisites` ให้แปลว่า `สิ่งที่ควรเรียนรู้มาก่อน` |
| 84 | + - คำว่า `Recommended Reading` ให้แปลว่า `หนังสือและเอกสารที่แนะนำให้อ่าน` |
| 85 | + - คำว่า `Disclaimer` ให้แปลว่า `คำชี้แจงที่สำคัญ` |
| 86 | + - คำว่า `open an issue ... on Github` ให้แปลว่า `เปิด Issue ... บน Github` |
| 87 | + - คำว่า `Traditional Type` ให้แปลว่า `การประกาศชนิดข้อมูลแบบดั้งเดิม` |
| 88 | + - คำว่า `type inference` ให้แปลว่า `การคาดเดาชนิดข้อมูล` |
| 89 | + - คำว่า `type system` ให้แปลว่า `ระบบชนิดข้อมูล` |
| 90 | + - คำว่า `definition of types` หรือ `type definition` ให้แปลว่า `การประกาศชนิดข้อมูล` |
| 91 | + - คำว่า `Let's break down` ให้แปลว่า `ลองพยายามอธิบาย` |
| 92 | + - คำว่า `Type loosing` ให้แปลว่า `การทำให้ชนิดข้อมูลหลวมลง` |
| 93 | + - คำว่า `Type tightening` ให้แปลว่า `การทำให้ชนิดข้อมูลเข้มข้นขึ้น` |
| 94 | + - คำว่า `codebase` ให้แปลว่า `โค้ด` |
| 95 | + - คำว่า `TypeScript Libraries` ให้แปลว่า `ไลบรารี TypeScript` |
| 96 | + - คำว่า `Glossary` ให้แปลว่า `คลังคำศัพท์` |
| 97 | + - คำว่า `Project` ให้แปลว่า `โปรเจกต์` |
| 98 | + - คำว่า `catch ... errors` ให้แปลว่า `เจอ ... ข้อผิดพลาด` |
| 99 | + - คำว่า `data interfaces` ให้แปลว่า `interface ของข้อมูล` |
| 100 | +- การเลือกคำคำที่มีบริบทข้างเคียง ซึ่งแต่ละที่อาจจะแปลไม่เหมือนกัน |
| 101 | + - คำว่า `Type` อาจจะแปลว่า `ชนิดข้อมูล` หรือ `ประเภท` ให้พิจารณาจากบริบทข้างเคียง |
| 102 | +- คำที่ไม่ต้องการแปล |
| 103 | + - `Pull Request` |
| 104 | + - `Libraries` |
| 105 | + - `E-book` |
| 106 | + - `business logic` |
| 107 | + - `Domain` |
| 108 | + |
| 109 | + |
| 110 | +# Prompt |
| 111 | + |
| 112 | +This page is special page that collect the prompt from generative AI for example GPT-3, GPT-4, etc. The prompt is used to generate the content for the page. |
| 113 | + |
| 114 | +## Localization Prompt List |
| 115 | +- [Thai Prompt](./th/prompt.md) |
| 116 | + |
| 117 | +``` |
| 118 | + |
| 119 | +### Output Text: |
| 120 | + |
| 121 | +```markdown |
| 122 | +# หัวข้อ |
| 123 | + |
| 124 | +หน้านี้เป็นหน้าพิเศษที่รวบรวมข้อความโดยใช้เทคโนโลยี AI ที่สร้างข้อความเช่น GPT-3, GPT-4 เป็นต้น โดยข้อความที่ใช้เป็นข้อความเริ่มต้นสำหรับสร้างเนื้อหาของหน้านี้ |
| 125 | + |
| 126 | +## รายการข้อความเริ่มต้นในภาษาไทย |
| 127 | +- [ข้อความเริ่มต้นภาษาไทย](./th/prompt.md) |
| 128 | +``` |
0 commit comments