--- title: Ner Annotation emoji: 👀 colorFrom: pink colorTo: green sdk: gradio sdk_version: 5.31.0 app_file: app.py pinned: false short_description: the ui for annotation ner for healthcare --- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference # NER Annotation Tool A powerful tool for annotating text with named entities using GLiNER models. This tool provides both automatic annotation using pre-trained models and a manual annotation interface for reviewing and correcting the results. ## Features - Automatic NER annotation using GLiNER models - Support for multiple pre-trained models - Interactive dataset viewer and editor - Export/import functionality for annotated data - Integration with Hugging Face Hub for dataset sharing - Support for various file formats (JSON, CoNLL, TXT) ## Installation 1. Clone the repository: ```bash git clone https://github.com/yourusername/ner-annotation.git cd ner-annotation ``` 2. Create and activate a virtual environment: ```bash python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate ``` 3. Install the package: ```bash pip install -e . ``` ## Usage 1. Start the application: ```bash python -m ner_annotation.app ``` 2. The application will open in your default web browser with two main tabs: - **Auto Annotation**: Upload text files and automatically annotate them using GLiNER models - **Dataset Viewer**: Review, edit, and validate annotated data ### Auto Annotation 1. Upload a text file (one sentence per line) 2. Select a GLiNER model 3. Enter the entity labels to detect (comma-separated) 4. Adjust the confidence threshold 5. Optionally add a prompt 6. Click "Annotate Data" ### Dataset Viewer 1. Load a dataset (local or from Hugging Face) 2. Navigate through examples using the slider or buttons 3. Edit annotations as needed 4. Validate examples 5. Save the dataset locally or to Hugging Face Hub ## Configuration Create a `.env` file in the project root with your Hugging Face token: ``` HUGGINGFACE_ACCESS_TOKEN=your_token_here ``` ## Available Models - `BookingCare/gliner-multi-healthcare` - `knowledgator/gliner-multitask-large-v0.5` - `knowledgator/gliner-multitask-base-v0.5` ## Contributing Contributions are welcome! Please feel free to submit a Pull Request. ## License This project is licensed under the MIT License - see the LICENSE file for details.