{"id":37073599,"url":"https://github.com/jkkummerfeld/slate","last_synced_at":"2026-01-14T08:38:25.561Z","repository":{"id":143297211,"uuid":"59550720","full_name":"jkkummerfeld/slate","owner":"jkkummerfeld","description":"A Super-Lightweight Annotation Tool for Experts: Label text in a terminal with just Python","archived":false,"fork":false,"pushed_at":"2025-05-29T04:09:27.000Z","size":1256,"stargazers_count":112,"open_issues_count":1,"forks_count":16,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-10-29T10:02:52.965Z","etag":null,"topics":["annotation","labeling","natural-language-processing","nlp","python","terminal-based","text-annotation"],"latest_commit_sha":null,"homepage":"http://jkk.name/slate/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jkkummerfeld.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-05-24T07:33:39.000Z","updated_at":"2025-10-11T15:29:31.000Z","dependencies_parsed_at":"2023-05-14T20:15:12.045Z","dependency_job_id":null,"html_url":"https://github.com/jkkummerfeld/slate","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jkkummerfeld/slate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkkummerfeld%2Fslate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkkummerfeld%2Fslate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkkummerfeld%2Fslate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkkummerfeld%2Fslate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jkkummerfeld","download_url":"https://codeload.github.com/jkkummerfeld/slate/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkkummerfeld%2Fslate/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28414670,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T08:31:27.429Z","status":"ssl_error","status_checked_at":"2026-01-14T08:31:19.098Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["annotation","labeling","natural-language-processing","nlp","python","terminal-based","text-annotation"],"created_at":"2026-01-14T08:38:24.844Z","updated_at":"2026-01-14T08:38:25.543Z","avatar_url":"https://github.com/jkkummerfeld.png","language":"Python","readme":"This is a tool for labeling text documents.\nSlate supports annotation at different scales (spans of characters, tokens, and lines, or a document) and of different types (free text, labels, and links).\nThis covers a range of tasks, such as Part-of-Speech tagging, Named Entity Recognition, Text Classification (including Sentiment Analysis), Discourse Structure, and more.\n\nWhy use this tool over the range of other text annotation tools out there?\n\n- Fast\n- Trivial installation\n- Focuses all of the screen space on annotation (good for large fonts)\n- Terminal based, so it works in constrained environments (e.g. only allowed ssh access to a machine)\n- Not difficult to configure and modify\n\nNote - this repository is **not** for the \"Segment and Link-based Annotation Tool, Enhanced\", which was first presented at [LREC 2010](http://www.lrec-conf.org/proceedings/lrec2010/pdf/129_Paper.pdf).\nSee 'Citing' below for additional notes on that work.\n\n## Installation\n\nTwo options:\n\n### 1. Install with pip\n```bash\npip install slate-nlp\n```\n\nThen run from any directory in one of two ways:\n```\nslate\npython -m slate\n```\n\n### 2. Or download and run without installing\nEither download as a zip file:\n```bash\ncurl https://codeload.github.com/jkkummerfeld/slate/zip/master -o \"slate.zip\"\nunzip slate.zip\ncd slate-master\n```\nOr clone the repository:\n```bash\ngit clone https://github.com/jkkummerfeld/slate\ncd slate\n```\n\nThen run with either of:\n```\npython slate.py\n./slate.py\n```\nTo run from another directory, use:\n```\npython PATH_TO_SLATE/slate.py\nPATH_TO_SLATE/slate.py\n```\n\n### Requirements\n\nThe code requires only Python (2 or 3) and can be run out of the box.\nYour terminal must be at least 80 characters wide and 20 tall to use the tool.\n\n## Citing\n\nIf you use this tool in your work, please cite:\n\n```\n@InProceedings{acl19slate,\n  title     = {SLATE: A Super-Lightweight Annotation Tool for Experts},\n  author    = {Jonathan K. Kummerfeld},\n  booktitle = {Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics: System Demonstrations},\n  location  = {Florence, Italy},\n  month     = {July},\n  year      = {2019},\n  pages     = {7--12},\n  doi       = {10.18653/v1/P19-3002},\n  url       = {https://aclweb.org/anthology/papers/P/P19/P19-3002/},\n  software  = {https://jkk.name/slate},\n}\n```\n\nWhile presenting this work at ACL I learned of another annotation tool called SLATE.\nThat tool was first described in \"Annotation Process Management Revisited\", [Kaplan et al. (LREC 2010)](http://www.lrec-conf.org/proceedings/lrec2010/pdf/129_Paper.pdf) and then in \"Slate - A Tool for Creating and Maintaining Annotated Corpora\", [Kaplan et al. (JLCL 2011)](https://jlcl.org/article/view/149).\nIt takes a very different approach, using a web based interface that includes a suite of project management tools as well as annotation.\n\n## Getting Started\n\nNote: if you used pip to install, reaplce `python slate.py` with `slate` everywhere below.\n\nRun `python slate.py \u003cfilename\u003e` to start annotating `\u003cfilename\u003e` with labels over spans of tokens.\nThe entire interface is contained in your terminal, there is no GUI.\nWith command line arguments you can vary properties such as the type of annotation (labels or links) and scope of annotation (characters, tokens, lines, documents).\n\nThe input file should be plain text, organised however you like.\nPrepare the data with your favourite sentence splitting and/or tokenisation software (e.g., [SpaCy](https://spacy.io)).\nIf you use Python 3 then unicode should be supported, but the code has not been tested extensively with non-English text (please share any issues!).\n\nWhen you start the tool it displays a set of core commands by default.\nThese are also specified below, along with additional commands.\n\nThe tool saves annotations in a separate file (`\u003cfilename\u003e.annotations` by default, this can be varied with a file list as described below).\nAnnotation files are formatted with one line per annotated item.\nThe item is specified with a tuple of numbers.\nFor labels, the item is followed by a hyphen and the list of labels.\nFor links, there are two items on the line before the hyphen.\nFor example, these are two annotation files, one for labels of token spans and the other for links between lines:\n\n```\n==\u003e label.annotations \u003c==\n(2, 1) - label:a\n((3, 5), (3, 8)) - label:a\n(7, 8) - label:s label:a\n\n==\u003e link.annotations \u003c==\n13 0 - \n13 7 - \n16 7 - \n```\n\nA few notes:\n- The second label annotation is on a span of tokens, going from 5 to 8 on line 3.\n- The third label annotation has two labels.\n- The line annotations only have one number to specify the item.\n- When the same line is linked to multiple other lines, each link is a separate item.\n\n### Tutorials\n\nIncluded in this repository are a set of interactive tutorials that teach you how to use the tool from within the tool itself.\n\nTask | Command\n---- | --------\nNamed Entity Recognition annotation |  `python slate.py tutorial/ner.md -t categorical -s token -o -c ner-book.config -l log.tutorial.ner.txt -sl -sm`\nLabelling spans of text in a document | `python slate.py tutorial/label.md -t categorical -s token -o -l log.tutorial.label.txt`\nLinking lines in a document | `python slate.py tutorial/link.md -t link -s line -o -l log.tutorial.link.txt`\n\n### Example Workflow\n\nThis tool has already been used for two annotation efforts involving multiple annotators ([Durrett et al., 2017](https://aclanthology.org/D17-1275/) and [Kummerfeld et al., 2018](https://aclanthology.org/P19-1374/)).\nOur workflow was as follows:\n\n- Create a repository containing (1) the annotation guide, (2) the data to be annotated divided into user-specific folders.\n- Each annotator downloaded slate and used it to do their annotations and commit the files to the repository.\n- Either the whole group or the project leader went through files that were annotated by multiple people, using the adjudication mode in the tool.\n\n### Comparing Annotations\n\nThe tool supports displaying annotations for the purpose of adjudicating disagreements.\nThere are two steps involved.\nSpecifically, you can request that a set of other annotation files be read.\nThen, whenever one of those annotation files includes something that your current adjudication does not, the text is shown in red.\n\n#### Data list file creation\nA  data list file contains a series of lines in the format:\n\n```\nraw_file [output_file [cur_position [other_annotations]]]\n```\n\nFor example, this line says there is a raw text file `my-book.txt`, that the adjudications should be saved in `annotations-adjudicated.txt`, that annotation should start at the very start of `my-book.txt` and that there are three existing annotations to be compared:\n\n```\nmy-book.txt annotations-adjudicated.txt ((0, 0), (0, 0)) my-book.txt.annotations1 my-book.txt.annotations2 my-book.txt.annotations3\n```\n\nNote: you can have as many \"other_annotation\" files as you want.\n\n#### Run slate with the data list file\nNow run slate as follows:\n\n```\npython slate.py -d data-list-file [any other arguments]\n```\n\n#### Example\n\nThe tutorial folder contains two example data list files:\n\n- `tutorial/data/list_with_disagreements.category.txt`\n- `tutorial/data/list_with_disagreements.link.txt`\n\nYou can use them as follows:\n\n```\ncd tutorial/data\npython ../../slate.py -d list_with_disagreements.category.txt -t categorical -s token\n```\n\n#### Efficiency Tip\n\nYou can save time by putting annotations that all annotators agreed on into the `annotations-adjudicated.txt` file.\nThis bash pipeline will do that if you replace:\n\n- `ANNOTATION_FILES` with the names of all of your annotation files, separated by spaces\n- `N_FILES` with the number of annotation files you have\n\n```\ncat ANNOTATION_FILES | sort | uniq -c | awk -v count=N_FILES '$1 == count' | sed 's/^ *[0-9]* *//' \u003e annotations-adjudicated.txt\n```\n\nBreaking this down, it does the following:\n- `cat ANNOTATION_FILES `, print the annotation files in the terminal\n- `sort `, sort their contents together\n- `uniq -c `, where there are consecutive lines that are the same, only keep one, and also indicate how many times each line occurred\n- `awk -v count=N_FILES '$1 == count' `, only keep lines where the number at the start matches `N_FILES`\n- `sed 's/^ *[0-9]* *//' \u003e annotations-adjudicated.txt`, remove the number at the start of the line (placed there by the `uniq` command)\n\n## Detailed Usage Instructions\n\n### Invocation options\n\n```\nusage: slate.py [-h] [-d DATA_LIST [DATA_LIST ...]] [-t {categorical,link}]\n                [-s {character,token,line,document}] [-c CONFIG_FILE] [-l LOG_PREFIX] [-ld]\n                [-sh] [-sl] [-sp] [-sm] [-r] [-o] [-ps] [-pf] [--do-not-show-linked]\n                [--alternate-comparisons]\n                [data ...]\n\nA tool for annotating text data.\n\npositional arguments:\n  data                  Files to be annotated\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -d DATA_LIST [DATA_LIST ...], --data-list DATA_LIST [DATA_LIST ...]\n                        Files containing lists of files to be annotated\n  -t {categorical,link}, --ann-type {categorical,link}\n                        The type of annotation being done.\n  -s {character,token,line,document}, --ann-scope {character,token,line,document}\n                        The scope of annotation being done.\n  -c CONFIG_FILE, --config-file CONFIG_FILE\n                        A file containing configuration information.\n  -l LOG_PREFIX, --log-prefix LOG_PREFIX\n                        Prefix for logging files\n  -ld, --log-debug      Provide detailed logging.\n  -sh, --show-help      Show help on startup.\n  -sl, --show-legend    Start with legend showing.\n  -sp, --show-progress  Start with progress showing.\n  -sm, --show-mark      Start with mark showing.\n  -r, --readonly        Do not allow changes or save annotations.\n  -o, --overwrite       If they exist already, read and overwrite output files.\n  -ps, --prevent-self-links\n                        Prevent an item from being linked to itself.\n  -pf, --prevent-forward-links\n                        Prevent a link from an item to one after it.\n  --do-not-show-linked  Do not have a special color to indicate any linked token.\n  --alternate-comparisons\n                        Activate alternative way of showing different annotations (one colour\n                        per set of markings, rather than counts).\n```\n\nYou may also define arguments in a file and pass them in as follows:\n\n```bash\npython slate.py @arguments.txt\n```\n\n### Keybindings\n\nThe tool shows files one at a time in plain text. Default commands are shown below.\n\nNote: special keys such as `ENTER` and `BACKSPACE` may not work on non-OS-X operating systems. That is why in all places where they are used we have an alternative as well.\n\nType                        | Key                                                       | Labelling Affect                 | Linking Affect\n--------------------------- | --------------------------------------------------------- | -------------------------------- | ---------------------\nMovement                    | \u003ckbd\u003ej\u003c/kbd\u003e or \u003ckbd\u003e\u0026larr;\u003c/kbd\u003e                         | move to the left                 | move selected item to the left\n\u0026nbsp;                      | \u003ckbd\u003ei\u003c/kbd\u003e or \u003ckbd\u003e\u0026uarr;\u003c/kbd\u003e                         | move up a line                   | move selected item up a line\n\u0026nbsp;                      | \u003ckbd\u003eo\u003c/kbd\u003e or \u003ckbd\u003e\u0026darr;\u003c/kbd\u003e                         | move down a line                 | move selected item down a line\n\u0026nbsp;                      | \u003ckbd\u003e;\u003c/kbd\u003e or \u003ckbd\u003e\u0026rarr;\u003c/kbd\u003e                         | move to the right                | move selected item to the right\n\u0026nbsp;                      | \u003ckbd\u003eJ\u003c/kbd\u003e or [\u003ckbd\u003eShift\u003c/kbd\u003e + \u003ckbd\u003e\u0026larr;\u003c/kbd\u003e]        | go to the start of the line      | move linking item to the left\n\u0026nbsp;                      | \u003ckbd\u003eI\u003c/kbd\u003e or [\u003ckbd\u003eShift\u003c/kbd\u003e + \u003ckbd\u003e\u0026uarr;\u003c/kbd\u003e]        | go to first line                 | move linking item up a line\n\u0026nbsp;                      | \u003ckbd\u003eO\u003c/kbd\u003e or [\u003ckbd\u003eShift\u003c/kbd\u003e + \u003ckbd\u003e\u0026darr;\u003c/kbd\u003e]        | go to last line                  | move linking item down a line\n\u0026nbsp;                      | \u003ckbd\u003e:\u003c/kbd\u003e or [\u003ckbd\u003eShift\u003c/kbd\u003e + \u003ckbd\u003e\u0026rarr;\u003c/kbd\u003e]        | go to the end of the line        | move linking item to the right\nEdit Span                   | \u003ckbd\u003em\u003c/kbd\u003e                                              | extend left                      | extend selected item left\n\u0026nbsp;                      | \u003ckbd\u003ek\u003c/kbd\u003e                                              | contract left side               | contract selected item left\n\u0026nbsp;                      | \u003ckbd\u003e/\u003c/kbd\u003e                                              | extend right                     | extend selected item right\n\u0026nbsp;                      | \u003ckbd\u003el\u003c/kbd\u003e                                              | contract right side              | contract selected item right\n\u0026nbsp;                      | \u003ckbd\u003eM\u003c/kbd\u003e                                              | -                                | extend linking item left\n\u0026nbsp;                      | \u003ckbd\u003eK\u003c/kbd\u003e                                              | -                                | contract linking item left\n\u0026nbsp;                      | \u003ckbd\u003e?\u003c/kbd\u003e                                              | -                                | extend linking item right\n\u0026nbsp;                      | \u003ckbd\u003eL\u003c/kbd\u003e                                              | -                                | contract linking item right\nLabel Annotation (default)  | \u003ckbd\u003eSpace\u003c/kbd\u003e then \u003ckbd\u003ea\u003c/kbd\u003e                        | [un]mark this item as a          | -\n\u0026nbsp;                      | \u003ckbd\u003eSpace\u003c/kbd\u003e then \u003ckbd\u003es\u003c/kbd\u003e                        | [un]mark this item as s          | -\n\u0026nbsp;                      | \u003ckbd\u003eSpace\u003c/kbd\u003e then \u003ckbd\u003ed\u003c/kbd\u003e                        | [un]mark this item as d          | -\n\u0026nbsp;                      | \u003ckbd\u003eSpace\u003c/kbd\u003e then \u003ckbd\u003ev\u003c/kbd\u003e                        | [un]mark this item as v          | -\nLink Annotation             | \u003ckbd\u003ed\u003c/kbd\u003e                                              | -                                | create a link and move right / down\n\u0026nbsp;                      | \u003ckbd\u003eD\u003c/kbd\u003e                                              | -                                | create a link\nEither Annotation mode      | \u003ckbd\u003eu\u003c/kbd\u003e                                              | undo annotation on this item     | undo all annotations for the current item\n\nShared commands:\n\nType                        | Mode   | Key                                             | Affect               \n--------------------------- | ------ | ----------------------------------------------- | ----------------------------\nSearching                   | Normal | \u003ckbd\u003e\\\\\u003c/kbd\u003e                                    | enter query editing mode\n\u0026nbsp;                      | Query  | \u003ckbd\u003e?\u003c/kbd\u003e or \u003ckbd\u003eEnter\u003c/kbd\u003e                    | exit query editing mode\n\u0026nbsp;                      | Query  | \u003ckbd\u003e!\u003c/kbd\u003e or \u003ckbd\u003eBackspace\u003c/kbd\u003e                    | delete last character in query\n\u0026nbsp;                      | Query  | characters except \u003ckbd\u003e?\u003c/kbd\u003e and \u003ckbd\u003e!\u003c/kbd\u003e | add character to query\n\u0026nbsp;                      | Normal | \u003ckbd\u003ep\u003c/kbd\u003e                                    | go to previous match\n\u0026nbsp;                      | Normal | \u003ckbd\u003en\u003c/kbd\u003e                                    | go to next match\n\u0026nbsp;                      | Normal | \u003ckbd\u003eP\u003c/kbd\u003e                                    | go to previous match for linking line\n\u0026nbsp;                      | Normal | \u003ckbd\u003eN\u003c/kbd\u003e                                    | go to next match for linking line\nAssigning text labels       | Normal | \u003ckbd\u003et\u003c/kbd\u003e                                    | enter label editing mode\n\u0026nbsp;                      | Label  | \u003ckbd\u003e?\u003c/kbd\u003e or \u003ckbd\u003eEnter\u003c/kbd\u003e                    | exit label editing mode and assign the label\n\u0026nbsp;                      | Label  | \u003ckbd\u003e!\u003c/kbd\u003e or \u003ckbd\u003eBackspace\u003c/kbd\u003e                    | delete last character in label\n\u0026nbsp;                      | Label  | characters except \u003ckbd\u003e?\u003c/kbd\u003e and \u003ckbd\u003e!\u003c/kbd\u003e | add character to label\nSaving, exiting, etc        | Normal | \u003ckbd\u003e]\u003c/kbd\u003e                                    | save and go to next file         \n\u0026nbsp;                      | Normal | \u003ckbd\u003e[\u003c/kbd\u003e                                    | save and go to previous file     \n\u0026nbsp;                      | Normal | \u003ckbd\u003eq\u003c/kbd\u003e                                    | save and quit                    \n\u0026nbsp;                      | Normal | \u003ckbd\u003es\u003c/kbd\u003e                                    | save                             \n\u0026nbsp;                      | Normal | \u003ckbd\u003eQ\u003c/kbd\u003e                                    | quit                             \nMisc                        | Normal | \u003ckbd\u003e#\u003c/kbd\u003e                                    | toggle line numbers\n\u0026nbsp;                      | Normal | \u003ckbd\u003eh\u003c/kbd\u003e                                    | toggle help info (default on)    \n\u0026nbsp;                      | Normal | \u003ckbd\u003e{\u003c/kbd\u003e or \u003ckbd\u003ePAGE-UP\u003c/kbd\u003e              | shift view up 5 lines\n\u0026nbsp;                      | Normal | \u003ckbd\u003e}\u003c/kbd\u003e or \u003ckbd\u003ePAGE-DOWN\u003c/kbd\u003e            | shift view down 5 lines\n\u0026nbsp;                      | Normal | \u003ckbd\u003e\u003e\u003c/kbd\u003e then \u003ckbd\u003ep\u003c/kbd\u003e                  | toggle showing progress through files\n\u0026nbsp;                      | Normal | \u003ckbd\u003e\u003e\u003c/kbd\u003e then \u003ckbd\u003el\u003c/kbd\u003e                  | toggle showing legend for labels\n\u0026nbsp;                      | Normal | \u003ckbd\u003e\u003e\u003c/kbd\u003e then \u003ckbd\u003em\u003c/kbd\u003e                  | toggle showing the mark on the current item\n\n### Misc\n\nTo annotate multiple files, specify more than one as an argument.\nFor greater control, provide a list of files in a file specified with `--data-list` / `-d`.\nThe list should be formatted as follows, where [] indicate optional values:\n\n```\nraw_file [annotation_file [starting_position [additional_annotation_files]]]\n```\n\nFor example, these commands will create a file list, use it, then return to it later:\n\n```bash\nfind . -name *txt \u003e filenames_todo\n./slate.py -d filenames_todo -l do_later\n# ... do some work, then quit, go away, come back...\n./slate.py -d do_later.todo -l do_even_later -o\n```\n\nNote, the `-o` flag is added so it will allow you to edit the annotations you have already created.\nOtherwise the system will complain that you are overwriting existing annotation files.\n\nWhen the `additional_annotation_files` are included it activates an adjudication mode.\nBy default, all annotations that appear in all additional files are added to the current annotations.\nDisagreements are coloured in the text, but will disappear once a decision is made (using the normal annotation commands).\n\n### Running in Windows\n\nUsers have reported a range of issues when trying to run slate:\n\n- Underlining, which is used to show the currently selected text, does not work.\n- Shift keys do not work\n\nHere are a few things to try that others have found helpful:\n\n- Use the Windows Subsystem for Linux (WSL) with Ubuntu\n- Reinstall ncurses, or install windows-curses\n- If you hit an encoding issue, try converting your raw text file to ASCII\n- Try powershell\n- Use a config file with different keybindings, to avoid needing shift\n\n## Customisation\n\nColours and keys are customisable. For labelling, the default is:\n\n - Underlined, current selected item\n - Green on black, 'a' items\n - Blue on black, 's' items\n - Magenta on black, 'd' items\n - Red on black, 'v' items\n - Cyan on black, multiple types for a single token\n\nFor linking, the default is:\n\n - Underlined, current selected item\n - Green on black, current linking item\n - Blue on black, item is linked to the current linking item\n - Yellow on black, item is in some link, though not with the current linking item\n\n### Modifying the Code\n\nSlate has a relatively small codebase (~2,200 lines) and is designed to make adding new functionality not too hard.\nThe code is divided up as follows:\n\n - `annotate.py`, the main program, this has the core loop that gets user input.\n - `config.py`, contains the default configuration, including colours and keyboard bindings.\n - `data.py`, classes to read, store and write data.\n - `view.py`, rendering the screen.\n\nLogic for determining what colour goes where is split across two parts of the code.\nIn `data.py`, the set of labels for an item is determined.\nIn `view.py`, that set of labels is used to choose a suitable colour.\n\nAdding a new command involves:\n\n - Adding the name and key to `input_action_list` in `config.py`\n - Adding a mapping from the name to a function in `action_to_function` in `annotate.py`\n - Adding or modifying a function in `annotate.py`\n - Modifying `data.py` or `view.py` to apply the action\n\n#### Changing the label set / Adding labels\n\nThe label set is defined in your config file (see an example config [here](https://github.com/jkkummerfeld/slate/blob/master/tutorial/config-example.txt)).\n\nSee lines like this for label definitions:\n\n```\nLabel:          a                         SPACE_a green\n```\n\nThe format is:\n```\nLabel:        \u003clabel\u003e                    \u003ccommand\u003e \u003ccolour\u003e\n```\n\nYou can add / edit / remove these lines to define your own label scheme. For example, for NER you may want to do:\n\n```\nLabel:          O                         SPACE_a green\nLabel:          LOC                       SPACE_s blue\nLabel:          PER                       SPACE_d red\nLabel:          ORG                       SPACE_f yellow\nLabel:          MISC                      SPACE_v magenta\n```\n\nFor an example of a custom config file, see [ner-book.config](ner-book.config)\n\nThe current set of available colours is: [green, blue, white, cyan, magenta, red, yellow].\nNote that by default white is used for regular text and cyan is used for cases where multiple labels apply to the same content.\n\nTo define more colours, edit the top of `slate/config.py`.\nBy varying both the text colour (foreground) and background colour you can achieve quite a range of variations.\nYou can also define any RGB colour you want using the curses [init_color](https://docs.python.org/3/library/curses.html#curses.init_color) function and the [init_pair](https://docs.python.org/3/library/curses.html#curses.init_pair) function.\n\n# Questions\n\nIf you have a question please either:\n\n- Open an issue on [github](https://github.com/jkkummerfeld/slate/issues).\n- Mail me at [jonathan.kummerfeld@sydney.edu.au](mailto:jonathan.kummerfeld@sydney.edu.au).\n\n# Contributions\n\nIf you find a bug in the code, please submit an issue, or even better, a pull request with a fix.\n\nHere are some possible improvements:\n- Improve adjudication mode for NER\n- Make a tool to help create data list files\n- Allow mouse input, e.g., with \"getmouse()\" and some sort of event loop to get both mouse and keyboard\n- Check keys with \"has_key()\" so that we can do modifier keys more cleaning\n- Change how ncurses is used to be more idiomatic and clean\n- Expand the range of colours that can be used\n\n# Acknowledgments\n\nThis tool is based in part upon work supported by IBM under contract 4915012629, and by ONR under MURI grant N000140911081.\nAny opinions, findings, conclusions or recommendations expressed are those of the authors and do not necessarily reflect the views of IBM.\n\n","funding_links":[],"categories":["🛠️ Developer Tools"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjkkummerfeld%2Fslate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjkkummerfeld%2Fslate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjkkummerfeld%2Fslate/lists"}