Skip to content
Alexandre Rademaker edited this page Jan 6, 2020 · 8 revisions

You start sensetion up by calling M-x sensetion.

Projects

To use sensetion, you must first define a project.

A project is defined by:

`name'
     The name of the project.

`backend'
     The database backend used by this project.

`output-buffer-name' (optional, default: sensetion)
     The buffer name where sensetion results are displayed.

`display-meta-data-fn' (optional)
     Function used to display meta data during target mode.
     Its two arguments are a `sensetion--sent' object and a boolean
     value indicating if the current annotation mode is targeted.
     When this function is not defined no metadata is displayed.

`restrict-lemmas' (optional, default: t)
     When non-nil restrict the user to add only lemmas that is part of
     wordnet to a token or a glob.

You can define a project like so:

(sensetion-make-project :name "<PROJECT-NAME>"
			  :backend (sensetion-make-mongo
				    :db "sensetion"
				    :synset-collection "synsets"
				    :document-collection "<PROJECT-NAME>"))

See the configuration section below to see where to place this code snippet.

If you have more than one annotation project and if you haven’t selected a project yet, this will prompt you for one. You can call sensetion-select-project to change the current project. (note: If you change a project you must evaluate the changes and call this function again.)

Configuration

A minimal configuration for sensetion.el is the following Emacs Lisp snippet:

(use-package sensetion
  :commands sensetion
  :load-path "~/sensetion.el/"
  ;; this is the list of projects sensetion can annotate
  :config (setq sensetion-project-list
		  (list
		   (sensetion-make-project
		    :name "<PROJECT-NAME>"
		    :backend (sensetion-make-mongo
			      :db "sensetion"
			      :synset-collection "synsets"
			      :document-collection "<PROJECT-NAME>")))))

This snippet is to be included in the bottom of your Emacs configuration file (the .emacs.d/init.el file mentioned in Install).

If you are an advanced Emacs user, you can do many more customizations using the full power of use-package. If you are not an advanced user but would like some feature, just ask us how to do it (assuming it is possible :)

Annotation

You start up sensetion.el by running M-x sensetion on Emacs. (If you don’t know what M-x means, try clicking Help>Emacs Tutorial in the menu bar.)

You will then be asked for which annotation mode you would like to enter. A targeted annotation has the user select a lemma and (optionally) a PoS tag, and shows her all sentences which have tokens which might have tokens matching these. In sequential annotation the user selects a document by its ID, and all the sentences in that document are shown for annotation of any content word.

You can press TAB in most prompts for completions. If entering a lemma, with current input roc, pressing TAB will show several completion possibilities, like rock, rocambole, roccela.

Colors differentiate a token’s status as unnanotated, annotated, just annotated, or not annotatable. These colors are customizable by the user (see the Customization section). For annotated tokens, dark colours indicate confidence in the annotation.

You can navigate through annotatable tokens with < and >.

You can call a menu with s.

If you wish to sense-tag a token, press / on it. You may select one or many senses – or no sense at all – by pressing the appropriate keyboard key. Senses which are already selected are prefixed by a plus sign (+); when satisfied, press enter/return. If you’d like to quit, press q; note that quitting does not undo or save anything (if you selected an option and then quit, its effects were already carried out).

You can see the number of tokens annotated so far and how many tokens still need to be annotated in the mode-line, next to the sensetion indicator.

All editing actions are saved immediately in the backend. We recommend you dump the corpus data after an annotation session and skim through the changes you made.

If you wish to change a token’s lemma use l. If you wish to say a token is not annotatable (i.e., ignore it), use i. If you wish to say you are unsure about an annotation, use ?.

There is support for word collocations, such as phrasal verbs. The tokens part of a collocation are united by a key, which is shown in their bottom left corner. You can unglob a collocation by pressing u in any token of the collocation. To glob tokens, you mark them with m and finally press g to create the collocation. If you marked a token by mistake, you can unmark tokens by pressing m again. If you try to edit the lemma of a token part of collocation, you will be asked if you would like to edit the token itself or its collocation.

Customization

Among others, sensetion.el allows the following customizations:

  • changing default buffer names ;
  • toggling display of word sense information such as lexicographer file name it is defined in ;
  • changing token status colours ;
  • displaying (or not) sentence ids

A complete and up-to-date list of these can be found by running M-x customize-group RET sensetion.

These customizations can be performed:

  • using the emacs graphical customization system: just run M-x customize-group RET sensetion and all options should be there, with accompanying documentation; do not forget to save your changes (recommended way, specially for beginners)
  • using use-package or similar libraries (recommended for advanced use)
  • manually, by setting the variables to the desired variables using setq or setf (not recommended)
Clone this wiki locally