Spaces:
Runtime error
Runtime error
File size: 1,690 Bytes
21a3b4f ac19006 e7c169f ac19006 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
---
title: Tokenizers Languages
emoji: 🐠
colorFrom: pink
colorTo: green
sdk: streamlit
sdk_version: 1.19.0
app_file: app.py
pinned: false
license: cc
---
# LLM Tokenizers in Multiple Languages
This is the repo for the [HuggingFace Space](https://huggingface.co/spaces/yenniejun/tokenizers-languages) corresponding with the article, [All languages are NOT created (tokenized) equal](https://www.artfish.ai/p/all-languages-are-not-created-tokenized).
![Screenshot of the corresponding HuggingFace Space](img/screenshot_huggingface_space.png)
The Space explores token length for various LLM tokenizers on many different languages.
### Introduction to the project
Large language models such as ChatGPT process and generate text sequences by first splitting the text into smaller units called tokens. This process of tokenization is not uniform across languages, leading to disparities in the number of tokens produced for equivalent expressions in different languages. For example, a sentence in Burmese or Amharic may require 10x more tokens than a similar message in English.
### Dataset
[MASSIVE](https://arxiv.org/abs/2204.08582) is a parallel dataset [introduced by Amazon](https://github.com/alexa/massive) consisting of 1 million realistic, parallel short texts translated across 52 languages and 18 domains. I used the dev split of the dataset, which consists of 2033 texts translated into each of the languages. The [dataset is available on HuggingFace](https://huggingface.co/datasets/AmazonScience/massive) and is licensed under the CC BY 4.0 license.
![Word cloud of the word "hey" translated into 51 languages, from the Massive dataset](img/word_cloud_massive.png)
|