{ "info": { "author": "Jonathan K. Kummerfeld", "author_email": "jkk@berkeley.edu", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "License :: OSI Approved :: ISC License (ISCL)", "Operating System :: OS Independent", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Topic :: Scientific/Engineering :: Artificial Intelligence" ], "description": "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 can be found [here](https://bitbucket.org/dainkaplan/slate/wiki/Home) and 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 {ACL} 2019, System Demonstrations},\n location = {Florence, Italy},\n month = {July},\n year = {2019},\n pages = {},\n url = {https://github.com/jkkummerfeld/slate/raw/master/paper/acl19slate.pdf},\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/content/2-allissues/12-Heft2-2011/11.pdf).\nIt takes a very different approach, using a web based interface that includes a suite of project management tools as well as annotation.\nThe code it available at [https://bitbucket.org/dainkaplan/slate/wiki/Home](https://bitbucket.org/dainkaplan/slate/wiki/Home).\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 ` to start annotating `` 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 (`.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==> label.annotations <==\n(2, 1) - label:a\n((3, 5), (3, 8)) - label:a\n(7, 8) - label:s label:a\n\n==> link.annotations <==\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---- | --------\nLabelling spans of text in a document | `python slate.py tutorial/label.md -t categorical -s token -o -hh -l log.tutorial.label.txt`\nLinking lines in a document | `python slate.py tutorial/link.md -t link -s line -o -hh -l log.tutorial.link.txt`\nComparing annotations | To be created\n\n### Example Workflow\n\nThis tool has already been used for two annotation efforts involving multiple annotators ([Durrett et al., 2017](http://jkk.name/publication/emnlp17forums/) and [Kummerfeld et al., 2018](http://jkk.name/publication/arxiv18disentangle/)).\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## 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]\n [-l LOG_PREFIX] [-ld] [-hh] [-r] [-o] [-ps] [-pf]\n [--do-not-show-linked] [--alternate-comparisons]\n [data [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 -hh, --hide-help Do not show help on startup.\n -r, --readonly Do not allow changes or save annotations.\n -o, --overwrite If they exist already, read abd overwrite output\n 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\n token.\n --alternate-comparisons\n Activate alternative way of showing different\n annotations (one colour per set of markings, rather\n 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. Commands are:\n\nType | Key | Labelling Affect | Linking Affect\n--------------------------- | --------------------------------------------------------- | -------------------------------- | ---------------------\nMovement | j or | move to the left | move selected item to the left\n  | i or | move up a line | move selected item up a line\n  | o or | move down a line | move selected item down a line\n  | ; or | move to the right | move selected item to the right\n  | J or [Shift + ] | go to the start of the line | move linking item to the left\n  | I or [Shift + ] | go to first line | move linking item up a line\n  | O or [Shift + ] | go to last line | move linking item down a line\n  | : or [Shift + ] | go to the end of the line | move linking item to the right\nEdit Span | m | extend left | extend selected item left\n  | k | contract left side | contract selected item left\n  | / | extend right | extend selected item right\n  | l | contract right side | contract selected item right\n  | M | - | extend linking item left\n  | K | - | contract linking item left\n  | ? | - | extend linking item right\n  | L | - | contract linking item right\nLabel Annotation (default) | Space then a | [un]mark this item as a | -\n  | Space then s | [un]mark this item as s | -\n  | Space then d | [un]mark this item as d | -\n  | Space then v | [un]mark this item as v | -\nLink Annotation | d | - | create a link and move right / down\n  | D | - | create a link\nEither Annotation mode | u | undo annotation on this item | undo all annotations for the current item\n\nShared commands:\n\nType | Mode | Key | Affect \n--------------------------- | ------ | ----------------------------------------------- | ----------------------------\nSearching | Normal | \\\\ | enter query editing mode\n  | Query | ? or Enter | exit query editing mode\n  | Query | ! or Backspace | delete last character in query\n  | Query | characters except ? and ! | add character to query\n  | Normal | p | go to previous match\n  | Normal | n | go to next match\n  | Normal | P | go to previous match for linking line\n  | Normal | N | go to next match for linking line\nAssigning text labels | Normal | t | enter label editing mode\n  | Label | ? or Enter | exit label editing mode and assign the label\n  | Label | ! or Backspace | delete last character in label\n  | Label | characters except ? and ! | add character to label\nSaving, exiting, etc | Normal | ] | save and go to next file \n  | Normal | [ | save and go to previous file \n  | Normal | q | save and quit \n  | Normal | s | save \n  | Normal | Q | quit \nMisc | Normal | # | toggle line numbers\n  | Normal | h | toggle help info (default on) \n  | Normal | { or PAGE-UP | shift view up 5 lines\n  | Normal | } or PAGE-DOWN | shift view down 5 lines\n  | Normal | > then p | toggle showing progress through files\n  | Normal | > then l | toggle showing legend for labels\n  | Normal | > then m | toggle showing the mark on the current item\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\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`.\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 > 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\nNote - adjudication has not been as thoroughly tested.\nPlease share any issues you come across!\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# 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 [jkummerf@umich.edu](mailto:jkummerf@umich.edu).\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\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\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://jkk.name/slate/", "keywords": "nlp annotation labeling natural-language-processing text-annotation", "license": "", "maintainer": "", "maintainer_email": "", "name": "slate-nlp", "package_url": "https://pypi.org/project/slate-nlp/", "platform": "", "project_url": "https://pypi.org/project/slate-nlp/", "project_urls": { "Homepage": "https://jkk.name/slate/" }, "release_url": "https://pypi.org/project/slate-nlp/1.0.3/", "requires_dist": null, "requires_python": ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*, <4", "summary": "A terminal-based text annotation tool", "version": "1.0.3" }, "last_serial": 5797822, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "37ff135e822d8cbed202f5a37713a996", "sha256": "8f6d51c367fc253b1997667102fea5a7c42ff2f18b716f1126e100e6dd00b509" }, "downloads": -1, "filename": "slate_nlp-1.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "37ff135e822d8cbed202f5a37713a996", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*, <4", "size": 26972, "upload_time": "2019-07-16T21:46:49", "url": "https://files.pythonhosted.org/packages/60/43/0ae88c84521b84af8e9c7435d1daef76355a620d74e594c6ae01888985bc/slate_nlp-1.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "54122120366661d1595d9c291e803ac4", "sha256": "1c7a22266c3ac7ab8a41905e98314e079f64af5a9d640594175d802a4a0f94d5" }, "downloads": -1, "filename": "slate-nlp-1.0.0.tar.gz", "has_sig": false, "md5_digest": "54122120366661d1595d9c291e803ac4", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*, <4", "size": 29985, "upload_time": "2019-07-16T21:46:51", "url": "https://files.pythonhosted.org/packages/2d/b1/57b169f2cc58fb4208defcca8ef5de40b49be89dbb8f5cad76df4e0d41c7/slate-nlp-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "e1caed53fd57933c60d2c64d8851a59f", "sha256": "13ceee763a39cc93c903dfa8e8a986a5760d91440fb4d6a3978bd2cc8da63362" }, "downloads": -1, "filename": "slate_nlp-1.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e1caed53fd57933c60d2c64d8851a59f", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*, <4", "size": 26969, "upload_time": "2019-07-16T21:49:12", "url": "https://files.pythonhosted.org/packages/14/9d/085ddabf69ff12c81675c6ecfc9952816997c05371c5e20d1a2dc75481a3/slate_nlp-1.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8b8922ccb2d6c965770eadf714a19bc8", "sha256": "b34f5d422ab3b933877cb51ef5d57af006b1765add75033195c86419fa48d70c" }, "downloads": -1, "filename": "slate-nlp-1.0.1.tar.gz", "has_sig": false, "md5_digest": "8b8922ccb2d6c965770eadf714a19bc8", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*, <4", "size": 29988, "upload_time": "2019-07-16T21:49:13", "url": "https://files.pythonhosted.org/packages/59/6d/f09d34655401ffb9c72a4f038db9b79f89cc41255e6e756d085ee8335f47/slate-nlp-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "8b1bf2f556dcfa3b7d5fd3112d17602f", "sha256": "9c32413fb3da2696915c201e8065efa2922aa17181a1846c831cac0f63d9bc7c" }, "downloads": -1, "filename": "slate_nlp-1.0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "8b1bf2f556dcfa3b7d5fd3112d17602f", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*, <4", "size": 27435, "upload_time": "2019-07-16T23:33:02", "url": "https://files.pythonhosted.org/packages/f5/23/28be60a4b6e2a86f28125dd39a8aefa0271409321dcfc927d20bda6c24e1/slate_nlp-1.0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d95aa8dc568da8d7182ac4b69ea2a5c0", "sha256": "7ed86daa04f58e1eee2653defa0a623b37e2c50063212d66399c91996efa67c9" }, "downloads": -1, "filename": "slate-nlp-1.0.2.tar.gz", "has_sig": false, "md5_digest": "d95aa8dc568da8d7182ac4b69ea2a5c0", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*, <4", "size": 30963, "upload_time": "2019-07-16T23:33:04", "url": "https://files.pythonhosted.org/packages/06/bf/fab42f75b00b342e42118298d87d9a91cc654620dc7bc2fb6df4153ac6e1/slate-nlp-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "627d0920957bc4c0cc41817a40acab54", "sha256": "99db79d92a9bc555ab08689a5be27811b6ca5ffc1f566182100aa76ddf9db4cd" }, "downloads": -1, "filename": "slate_nlp-1.0.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "627d0920957bc4c0cc41817a40acab54", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*, <4", "size": 27949, "upload_time": "2019-09-08T00:08:36", "url": "https://files.pythonhosted.org/packages/7d/49/289636d41a1a21a157f14371abb6fa11ff487888cada446f83816a0acfce/slate_nlp-1.0.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f740ce5a022fbcbf5496861efda2f6da", "sha256": "5313d3f9da4114a99d1b6a918888367b7aa4fbc76795363fb9fa51a608a40579" }, "downloads": -1, "filename": "slate-nlp-1.0.3.tar.gz", "has_sig": false, "md5_digest": "f740ce5a022fbcbf5496861efda2f6da", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*, <4", "size": 32059, "upload_time": "2019-09-08T00:08:38", "url": "https://files.pythonhosted.org/packages/0e/b0/df4551a207b7e7e19ca8fa81c7bfc2b7448ffccae000dd0357fca1a44bfe/slate-nlp-1.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "627d0920957bc4c0cc41817a40acab54", "sha256": "99db79d92a9bc555ab08689a5be27811b6ca5ffc1f566182100aa76ddf9db4cd" }, "downloads": -1, "filename": "slate_nlp-1.0.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "627d0920957bc4c0cc41817a40acab54", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*, <4", "size": 27949, "upload_time": "2019-09-08T00:08:36", "url": "https://files.pythonhosted.org/packages/7d/49/289636d41a1a21a157f14371abb6fa11ff487888cada446f83816a0acfce/slate_nlp-1.0.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f740ce5a022fbcbf5496861efda2f6da", "sha256": "5313d3f9da4114a99d1b6a918888367b7aa4fbc76795363fb9fa51a608a40579" }, "downloads": -1, "filename": "slate-nlp-1.0.3.tar.gz", "has_sig": false, "md5_digest": "f740ce5a022fbcbf5496861efda2f6da", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*, <4", "size": 32059, "upload_time": "2019-09-08T00:08:38", "url": "https://files.pythonhosted.org/packages/0e/b0/df4551a207b7e7e19ca8fa81c7bfc2b7448ffccae000dd0357fca1a44bfe/slate-nlp-1.0.3.tar.gz" } ] }