Permalink
Browse files

Merge branch 'tutorials_greek'

  • Loading branch information...
aurelberra committed Feb 20, 2018
2 parents 724c029 + e2e7e1b commit e6dbabdeca528e9f2666ff08b16a3eb201252dd0
@@ -435,7 +435,7 @@
}
],
"source": [
"!ls -l /home/kyle/cltk_data/originals/ # To be adapted to your file system"
"!ls -l /home/kyle/cltk_data/originals/"
]
}
],
@@ -61,8 +61,8 @@
" words[i] = words[i].lower()\n",
" if lang in [\"bn\",\"hi\",\"sa\"]:\n",
" tokens= i_word(text)\n",
"\n",
" # Locating the matches of the words in the text\n",
" \n",
" # Locating the matches of the words in the text. \n",
" x_length = len(tokens)\n",
" y_length = len(words)\n",
" x_list = []\n",
@@ -72,16 +72,17 @@
" if tokens[i]==words[j]:\n",
" x_list.append(i+1)\n",
" y_list.append(j)\n",
"\n",
" # Creation of Dispersion Plot with Matplotlib's pyplot\n",
" \n",
" #Creation of Dispersion Plot with Matplotlib's pyplot. \n",
" plt.plot(x_list, y_list, \"b|\", scalex=.1)\n",
" plt.yticks(list(range(len(words))), words, color=\"b\")\n",
" plt.ylim(-1, len(words))\n",
" plt.xlabel(\"Lexical Distribution\")\n",
" plt.show()\n",
"\n",
" \n",
" else:\n",
" print(\"Language not presently covered by CLTK or wrong language code\")"
" print(\"Language not presently covered by CLTK or wrong language code\") \n",
" \n"
]
},
{
@@ -0,0 +1,129 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Install Python\n",
"\n",
"## Mac\n",
"\n",
"See <https://www.python.org/downloads/> (current version is 3.6.4).\n",
"\n",
"\n",
"## Linux\n",
"\n",
"Open Terminal and check current version with `python --version` or `python3 --version`. If 3.4 or 3.5, you're fine. If Python version is out of date, run these:\n",
"\n",
"``` bash\n",
"$ curl -O https://raw.githubusercontent.com/kylepjohnson/python3_bootstrap/master/install.sh\n",
"$ chmod +x install.sh\n",
"$ ./install.sh\n",
"```\n",
"\n",
"This Linux build from source will take around 5 minutes."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Install Git\n",
"\n",
"The CLTK uses Git for corpus management. For Mac, install it from here: <https://git-scm.com/downloads>. For Linux, check if present (`git --version`); if not then use your package manager to get it (e.g., `apt-get install git`)."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Create a virtual environment\n",
"\n",
"This makes a special environment (a \"sandbox\") just for the CLTK. If something goes wrong, you can just delete it and start again.\n",
"\n",
"``` bash\n",
"$ cd ~/\n",
"$ mkdir cltk\n",
"$ cd cltk\n",
"$ pyvenv venv\n",
"$ source venv/bin/activate\n",
"```\n",
"\n",
"Now you can see that you're not using your system Python but this particular one:\n",
"\n",
"``` bash\n",
"$ which python\n",
"```\n",
"\n",
"Note that every time you open a new Terminal window, you'll need to \"activate\" this environment with `source ~/cltk/venv/bin/activate`."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Install CLTK\n",
"\n",
"``` bash\n",
"$ pip install cltk\n",
"```\n",
"\n",
"This will take a few minutes, as it will install several \"dependencies\", being other Python libraries which the CLTK uses.\n",
"\n",
"Also install Jupyter, which is a really handy way of writing code.\n",
"\n",
"``` bash\n",
"$ pip install jupyter\n",
"```"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Test Jupyter\n",
"\n",
"From your `cltk` directory, launch a notebook (such as this one) from the Terminal with `jupyter notebook`. Then open your preferred browser to <http://localhost:8888>."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Download these tutorials\n",
"\n",
"You may find these instructions at <https://github.com/cltk/tutorials>."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Join GitHub\n",
"\n",
"GitHub is a nice way to share code. Come visit us at <https://github.com/cltk/cltk/>!"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.4"
}
},
"nbformat": 4,
"nbformat_minor": 1
}
Oops, something went wrong.

0 comments on commit e6dbabd

Please sign in to comment.