# Word Similarity Measures

## Install the necessary packages

* First ensure you've followed[ these instructions to install Anaconda Python](https://neurocognitive-imaging-lab.gitbook.io/ncil-lab-handbook/4KX9BrRxON7flu3dJyRM/computer-stuff/data-science-tools/jupyterlab-setup-on-your-computer) on your computer.&#x20;
* Open a Terminal (Mac)/Anaconda Prompt (Windows) window. All of the commands in `computer font` below you should type (or copy/paste to avoid typos) into that window, and hit Enter after each command.
* Install the [pattern](https://pypi.org/project/Pattern/) package:
  * `conda install pattern`
* Install the [Phonological CorpusTools](https://corpustools.readthedocs.io/en/latest/index.html) package:
  * Download the "source" package from[ this link ](https://github.com/PhonologicalCorpusTools/CorpusTools/releases)(doesn't matter if you choose the zip or tar.gz version). Note that if you're used to installing Python packages with conda or pip, this is a nonstandard install procedure, but it works.
  * Uncompress the package (usually simply involves double-clicking it)
  * in the Terminal/Anaconda Prompt, change directories to the CorpusTools folder. Asssuming you downloaded version 1.4.1, the command would be:
    * `cd Downloads/CorpusTools-1.4.1`
  * Then run the installer:
    * `python setup.py install`&#x20;
* Install the [Open Multilingual Wordnet](http://compling.hss.ntu.edu.sg/omw/):&#x20;
  * `ipython`
  * This will activate an interactive Python kernel in the window. Then run these two commands:
    * `import nltk`
    * `nltk.download('omw-1.4')`
  * Type `exit` to exit the interactive Python session
* Install the [spaCy](https://spacy.io) pacakge:
  * `conda install spacy`
  * `spacy download en_core_web_sm`
* Install the [Gensim](https://pypi.org/project/gensim/) package:
  * `pip install gensim`
  * `python -m gensim.downloader --download 'glove-wiki-gigaword-300'`
  *
