Inkline is a powerful desktop application built with PyQt6 that streamlines the process of annotating text data for machine learning tasks. This release is a new and improved version of our previous Tkinter annotation tool, offering a modern, feature-rich interface and enhanced performance. Whether you are preparing training data for NLP models or organizing structured information, Inkline offers a modern interface to quickly wrap selected text in XML-like tags using customizable keyboard shortcuts.
- Modern PyQt6 Interface: Enjoy a responsive desktop application with a clean, user-friendly design.
- Dual File Support: Open and annotate up to two files simultaneously. Each file is loaded into its own subwindow within the main interface.
- Custom Annotation Commands: Map keyboard shortcuts (default keys A–G) to custom annotation commands that wrap selected text in XML tags.
- Shortcut Management: View, update, and add new shortcuts through an integrated shortcuts dock.
- Annotation Export Options:
- Sequence File Export: Generate sequence files for machine learning model training.
- HTML Export: Convert annotated text into a neatly formatted HTML file.
- XML Export: Save annotations as an XML file using the robust lxml library.
- Integrated Tools:
- Embedded Browser: Quickly search online (e.g., via Google) within an integrated browser window.
- Notes Tab: Keep side notes in a dedicated notes window.
- Find & Replace: Use a dedicated dialog to locate and replace text within your annotations.
- Theme Switching: Toggle between light and dark themes to suit your environment.
- Auto-Save & Session Restore: Your work is auto-saved every minute, and previous sessions can be restored upon startup.
- Configurable Preferences: Customize key bindings, fonts, colors, and more. Settings are saved across sessions.
Before running Inkline, ensure you have the following installed:
- Python 3.x (recommended version: 3.7 or higher)
- PyQt6 and PyQt6-WebEngine
- lxml (for XML processing)
- pytablericons (for UI icons)
You can install the required packages using pip:
pip install PyQt6 PyQt6-WebEngine lxml pytablericons
-
Clone the Repository:
git clone https://github.com/Bestroi150/Inkline-text-annotation.gitcd Inkline -
Download or Extract the Source Code:
Alternatively, download the repository as a ZIP archive and extract it to your desired location.
To launch Inkline, open a terminal (or command prompt), navigate to the project directory, and run
python main.py
The application will open in maximized mode, displaying the main window with its menus, toolbars, and dockable panels.
- File Menu: Use File > Open File 1 or Open File 2 to load text files into the application.
- Drag & Drop: You can also drag and drop files into the application. Note that only two files can be open simultaneously.
- Session Restore: If files were open in your previous session, you will be prompted to restore them on startup.
- Select Text: Highlight the text you wish to annotate in the editor.
- Apply Annotation: Press a mapped shortcut key (default keys are A, B, C, D, E, F, and G) to wrap the selected text with the corresponding XML tag.
- Remove Annotation: Use the dedicated command (mapped to Ctrl+Z by default) to remove annotations from the text or the dedicated Undo function.
- Shortcuts Panel: The dockable shortcuts panel displays current key bindings. Edit the commands directly in the provided text fields.
- Add New Shortcuts: Click the Add Shortcut button to define new shortcut keys, annotation commands, and select a highlight color.
- Configuration Saving: Changes to shortcuts and keybindings are automatically saved to the configuration file.
- Sequence Files: Export annotated text as a sequence file for ML training using the Export File options.
- HTML & XML: Convert and export your annotations as HTML or XML files via the File menu.
- Find & Replace: Open the find/replace dialog from the Functions menu to search or modify text within the editors.
- Preferences: Adjust settings such as the default font and reset keybindings in the Preferences dialog.
- Notes & Browser: Open an integrated notes window or an embedded browser for quick online searches.
- Toggle Theme: Switch between dark and light modes using the toggle option in the Functions menu.
- Toggle Markup: Enable or disable XML tag highlighting in the editor.
- Configuration Files: User settings and keybindings are stored in
config.pklanduser_settings.pkl. - Auto-Save: Inkline automatically saves your work every minute to a
.autosavefile appended to the original filename. When reopening a file, you will be prompted to restore autosaved content if available.
This project is open-source software released under the MIT License. You are free to use, modify, and distribute it in accordance with the terms of the license.
