This project provides a user-friendly graphical interface to tokenize Markdown files within a selected directory, calculate character counts, and estimate the cost of using specific OpenAI models based on the token count. It is designed specifically for Logseq's pages and journals folders, but can tokenize any folder of markdown files.
- Python
- PySide6 for GUI
- tiktoken for tokenization
- Python
- PySide6
- tiktoken library
-
Clone the repository:
git clone https://github.com/yourusername/logseq-tokenizer.git
-
Navigate to the cloned directory:
cd logseq-tokenizer
-
Install the required Python packages:
pip install -r requirements.txt
-
Run the application:
python main.py
-
Click on 'Select Folder to Tokenize' to choose the directory containing Markdown files.
-
Enter the desired name for the output CSV file.
-
Click 'Start' to begin the tokenization process.
-
Check the generated CSV file for results.
- GUI for easy interaction
- Tokenization of Markdown files
- Calculation of character count
- Estimation of cost for using OpenAI models
- Output results to a CSV file
- Support for additional file formats
- Integration with more OpenAI models/use cases beyond text embeddings
- Enhanced data visualization in the GUI
- Pre-processing content for stopwords before encoding