20 lines
743 B
Markdown
20 lines
743 B
Markdown
# 📝 AIRA NLP & Tokenization Engine (`ai/nlp`)
|
|
|
|
[](https://github.com/adameehanairagroup/Airalang)
|
|
[](https://github.com/adameehanairagroup/Airalang)
|
|
|
|
The `ai/nlp` package implements text tokenization, byte-pair encoding (BPE), vocabulary mapping, and dense semantic embedding search.
|
|
|
|
```aira
|
|
import "ai/nlp";
|
|
|
|
let tokenizer = new BPETokenizer();
|
|
tokenizer.load_vocab("vocab.json", "merges.txt");
|
|
|
|
let token_ids = tokenizer.encode("Sovereign AI Engineering in AIRA");
|
|
say token_ids; // [1284, 9942, 381, 2901]
|
|
|
|
let text = tokenizer.decode(token_ids);
|
|
say text;
|
|
```
|