Homework
HW0: Getting Started
Environment Setup
Python
Install Python version 3.10 or higher. Earlier versions are not compatible with this course.
You are encouraged to install the latest version of Python. Please review the new features introduced in each version.
GitHub
Login to GitHub (create an account if you do not have one).
Create a new repository called nlp-essentials and set it to private.
From the
[Settings]
menu, add the following as a collaborator to this repository: EmoryTA.
PyCharm
Install PyCharm on your local machine:
The following instructions assume that you have "PyCharm 2023.3.x Professional Edition".
You can get the professional version by applying for an academic license.
Configure your GitHub account:
Go to
[Settings] - [Version Control] - [GitHub]
.Press
[+]
, selectLog in via GitHub
, and follow the procedure.
Create a new project:
Press the
[Get from VCS]
button on theWelcome
prompt.Choose
[GitHub]
on the left menu, select thenlp-essentials
repository, and press[Clone]
(make sure the directory name isnlp-essentials
).
Setup an interpreter:
Go to
[Settings] - [Project: nlp-essentials] - [Project Interpreter]
.Click
Add Interpreter
and selectAdd Local Interpreter
.In the prompted window, choose
[Virtualenv Environment]
on the left menu, configure as follows, then press[OK]
:Environment:
New
Location:
SOME_LOCAL_PATH/nlp-essentials/venv
Base interpreter:
Python 3.11
(or the Python version you installed)
https://plugins.jetbrains.com/plugin/10081-jetbrains-academy
Tasks
Install Package
Open a terminal by clicking
[Terminal]
at the bottom (or go to[View] - [Terminal]
).Upgrade pip (if necessary) by entering the following command into the terminal:
Install setuptools (if necessary) using the following command:
Install the ELIT Tokenizer with the following command:
If the terminal prompts "Successfully installed ...", the packages are installed on your machine.
Run Program
1. Create a package called src
under the nlp-essentials
directory.
PyCharm may automatically create the __init__.py
file under src
, which is required for Python to recognize the directory as a package, so leave the file as it is.
2. Create a homework
package under the src
package.
3. Create a Python file called getting_started.py
under homework
and copy the code:
If PyCharm prompts you to add getting_started.py
to git, press [Add]
.
4. Run the program by clicking [Run] - [Run 'getting_started']
. An alternative way is to click the green triangle (L20) and select Run 'getting_started'
:
5. If you see the following output, your program runs successfully.
Commit & Push
1. Create a .gitignore
file under the nlp-essentials
directory and copy the content:
2. Add the following files to git by right-clicking on them and selecting [Git] - [Add]
(if not already):
getting_started.py
.gitignore
Once the files are added to git, they should turn green. If not, restart PyCharm and try to add them again.
3. Commit and push your changes to GitHub:
Right-click on
nlp-essentials
.Select
[Git] - [Commit Directory]
.Enter a commit message (e.g., Submit Quiz 0).
Press the
[Commit and Push]
button.
Make sure you both commit
and push
, not just commit
.
4. Check if the above files are properly pushed to your GitHub repository.
Submission
Submit the URL of your GitHub repository to Canvas.
Last updated