30
A Beginner’s Guide to Project 1 11-711: Algorithms for NLP Fall 2019 A Beginner’s Guide to Project 1 1 / 30 Fall 2019

A Beginner’s Guide to Project 1demo.clab.cs.cmu.edu/11711fa19/projects/initial_setup.pdf · Outline 1 Install the Required Software 2 Getting Started with Your Project 3 Eclipse

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: A Beginner’s Guide to Project 1demo.clab.cs.cmu.edu/11711fa19/projects/initial_setup.pdf · Outline 1 Install the Required Software 2 Getting Started with Your Project 3 Eclipse

A Beginner’s Guide to Project 111-711: Algorithms for NLP

Fall 2019

A Beginner’s Guide to Project 1 1 / 30Fall 2019

Page 2: A Beginner’s Guide to Project 1demo.clab.cs.cmu.edu/11711fa19/projects/initial_setup.pdf · Outline 1 Install the Required Software 2 Getting Started with Your Project 3 Eclipse

Table of Contents

1 Install the Required Software

2 Getting Started with Your Project

3 Eclipse Basic Usages

4 Navigating the Starter Code

5 Your Work

6 Java Basics

A Beginner’s Guide to Project 1 2 / 30Fall 2019

Page 3: A Beginner’s Guide to Project 1demo.clab.cs.cmu.edu/11711fa19/projects/initial_setup.pdf · Outline 1 Install the Required Software 2 Getting Started with Your Project 3 Eclipse

Outline

1 Install the Required Software

2 Getting Started with Your Project

3 Eclipse Basic Usages

4 Navigating the Starter Code

5 Your Work

6 Java Basics

A Beginner’s Guide to Project 1 3 / 30Fall 2019

Page 4: A Beginner’s Guide to Project 1demo.clab.cs.cmu.edu/11711fa19/projects/initial_setup.pdf · Outline 1 Install the Required Software 2 Getting Started with Your Project 3 Eclipse

Install Eclipse

• Link: https://www.eclipse.org/downloads/

• Follow their instructions

A Beginner’s Guide to Project 1 4 / 30Fall 2019

Page 5: A Beginner’s Guide to Project 1demo.clab.cs.cmu.edu/11711fa19/projects/initial_setup.pdf · Outline 1 Install the Required Software 2 Getting Started with Your Project 3 Eclipse

Is Your Mac 64-bit?

• May create unexpected results with HashMap, HashSet, etc.• What you see on your computers may be different from what we

see when grading• Do this in your Terminal

$ getconf LONG BIT

• Most of your Mac computers are compatible with 64 bits.

A Beginner’s Guide to Project 1 5 / 30Fall 2019

Page 6: A Beginner’s Guide to Project 1demo.clab.cs.cmu.edu/11711fa19/projects/initial_setup.pdf · Outline 1 Install the Required Software 2 Getting Started with Your Project 3 Eclipse

Install Apache Ant

• On Mac$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"$ brew install ant

• On Linux$ sudo apt-get update$ sudo apt-get install ant

• On Windows• DIY: https://www.mkyong.com/ant/how-to-install-apache-ant-on-windows/

A Beginner’s Guide to Project 1 6 / 30Fall 2019

Page 7: A Beginner’s Guide to Project 1demo.clab.cs.cmu.edu/11711fa19/projects/initial_setup.pdf · Outline 1 Install the Required Software 2 Getting Started with Your Project 3 Eclipse

Outline

1 Install the Required Software

2 Getting Started with Your Project

3 Eclipse Basic Usages

4 Navigating the Starter Code

5 Your Work

6 Java Basics

A Beginner’s Guide to Project 1 7 / 30Fall 2019

Page 8: A Beginner’s Guide to Project 1demo.clab.cs.cmu.edu/11711fa19/projects/initial_setup.pdf · Outline 1 Install the Required Software 2 Getting Started with Your Project 3 Eclipse

Download Project Code

• Starter code:

https://storage.googleapis.com/11711/code1.tar.gz

• Data:

https://storage.googleapis.com/11711/data1.tar.gz

• Unzip

$ tar -xzf code1.tar.gz$ tar -xzf data1.tar.gz

A Beginner’s Guide to Project 1 8 / 30Fall 2019

Page 9: A Beginner’s Guide to Project 1demo.clab.cs.cmu.edu/11711fa19/projects/initial_setup.pdf · Outline 1 Install the Required Software 2 Getting Started with Your Project 3 Eclipse

Try Running the Starter Code

• Go to code1

$ ant -f build assign1.xml$ export DATA PATH="/absolute/path/to/your/data/folder"$ java -cp assign1.jar:assign1-submit.jar -server -mx500m \

edu.berkeley.nlp.assignments.assign1.LanguageModelTester \-path $DATA PATH -lmType UNIGRAM

A Beginner’s Guide to Project 1 9 / 30Fall 2019

Page 10: A Beginner’s Guide to Project 1demo.clab.cs.cmu.edu/11711fa19/projects/initial_setup.pdf · Outline 1 Install the Required Software 2 Getting Started with Your Project 3 Eclipse

Automatize Your Workflow

• Create a run.sh script that launches your experiment$ vim run.sh$ # copy the scripts from the previous slide$ # changing UNIGRAM to TRIGRAM$ chmod 777 run.sh

• Now you can run your experiment with 1 command$ ./run.sh

• Much less frustration when working on large projects

A Beginner’s Guide to Project 1 10 / 30Fall 2019

Page 11: A Beginner’s Guide to Project 1demo.clab.cs.cmu.edu/11711fa19/projects/initial_setup.pdf · Outline 1 Install the Required Software 2 Getting Started with Your Project 3 Eclipse

Outline

1 Install the Required Software

2 Getting Started with Your Project

3 Eclipse Basic Usages

4 Navigating the Starter Code

5 Your Work

6 Java Basics

A Beginner’s Guide to Project 1 11 / 30Fall 2019

Page 12: A Beginner’s Guide to Project 1demo.clab.cs.cmu.edu/11711fa19/projects/initial_setup.pdf · Outline 1 Install the Required Software 2 Getting Started with Your Project 3 Eclipse

Launch Eclipse and Create your Workspace

• This is not where your code lives

A Beginner’s Guide to Project 1 12 / 30Fall 2019

Page 13: A Beginner’s Guide to Project 1demo.clab.cs.cmu.edu/11711fa19/projects/initial_setup.pdf · Outline 1 Install the Required Software 2 Getting Started with Your Project 3 Eclipse

Launch Eclipse and Create your Workspace

• Looks like this when done correctly

A Beginner’s Guide to Project 1 13 / 30Fall 2019

Page 14: A Beginner’s Guide to Project 1demo.clab.cs.cmu.edu/11711fa19/projects/initial_setup.pdf · Outline 1 Install the Required Software 2 Getting Started with Your Project 3 Eclipse

Create Your Eclipse Project

A Beginner’s Guide to Project 1 14 / 30Fall 2019

Page 15: A Beginner’s Guide to Project 1demo.clab.cs.cmu.edu/11711fa19/projects/initial_setup.pdf · Outline 1 Install the Required Software 2 Getting Started with Your Project 3 Eclipse

Create Your Eclipse Project

A Beginner’s Guide to Project 1 15 / 30Fall 2019

Page 16: A Beginner’s Guide to Project 1demo.clab.cs.cmu.edu/11711fa19/projects/initial_setup.pdf · Outline 1 Install the Required Software 2 Getting Started with Your Project 3 Eclipse

Create Your Eclipse Project

• The project folder lives in your workspace

• The code does not.

A Beginner’s Guide to Project 1 16 / 30Fall 2019

Page 17: A Beginner’s Guide to Project 1demo.clab.cs.cmu.edu/11711fa19/projects/initial_setup.pdf · Outline 1 Install the Required Software 2 Getting Started with Your Project 3 Eclipse

Outline

1 Install the Required Software

2 Getting Started with Your Project

3 Eclipse Basic Usages

4 Navigating the Starter Code

5 Your Work

6 Java Basics

A Beginner’s Guide to Project 1 17 / 30Fall 2019

Page 18: A Beginner’s Guide to Project 1demo.clab.cs.cmu.edu/11711fa19/projects/initial_setup.pdf · Outline 1 Install the Required Software 2 Getting Started with Your Project 3 Eclipse

Import Code

A Beginner’s Guide to Project 1 18 / 30Fall 2019

Page 19: A Beginner’s Guide to Project 1demo.clab.cs.cmu.edu/11711fa19/projects/initial_setup.pdf · Outline 1 Install the Required Software 2 Getting Started with Your Project 3 Eclipse

Import Code

A Beginner’s Guide to Project 1 19 / 30Fall 2019

Page 20: A Beginner’s Guide to Project 1demo.clab.cs.cmu.edu/11711fa19/projects/initial_setup.pdf · Outline 1 Install the Required Software 2 Getting Started with Your Project 3 Eclipse

Import Code

• Point to where you downloaded the code

A Beginner’s Guide to Project 1 20 / 30Fall 2019

Page 21: A Beginner’s Guide to Project 1demo.clab.cs.cmu.edu/11711fa19/projects/initial_setup.pdf · Outline 1 Install the Required Software 2 Getting Started with Your Project 3 Eclipse

Import Code

• Looks like this if done correctly

A Beginner’s Guide to Project 1 21 / 30Fall 2019

Page 22: A Beginner’s Guide to Project 1demo.clab.cs.cmu.edu/11711fa19/projects/initial_setup.pdf · Outline 1 Install the Required Software 2 Getting Started with Your Project 3 Eclipse

Outline

1 Install the Required Software

2 Getting Started with Your Project

3 Eclipse Basic Usages

4 Navigating the Starter Code

5 Your Work

6 Java Basics

A Beginner’s Guide to Project 1 22 / 30Fall 2019

Page 23: A Beginner’s Guide to Project 1demo.clab.cs.cmu.edu/11711fa19/projects/initial_setup.pdf · Outline 1 Install the Required Software 2 Getting Started with Your Project 3 Eclipse

Write Your Code

• Open the file LmFactory.java

• It’s tricky

A Beginner’s Guide to Project 1 23 / 30Fall 2019

Page 24: A Beginner’s Guide to Project 1demo.clab.cs.cmu.edu/11711fa19/projects/initial_setup.pdf · Outline 1 Install the Required Software 2 Getting Started with Your Project 3 Eclipse

Write Your Code

• Looks like this if done correctly

A Beginner’s Guide to Project 1 24 / 30Fall 2019

Page 25: A Beginner’s Guide to Project 1demo.clab.cs.cmu.edu/11711fa19/projects/initial_setup.pdf · Outline 1 Install the Required Software 2 Getting Started with Your Project 3 Eclipse

Open code1 from Eclipse

• Easier to navigate and organize your files

A Beginner’s Guide to Project 1 25 / 30Fall 2019

Page 26: A Beginner’s Guide to Project 1demo.clab.cs.cmu.edu/11711fa19/projects/initial_setup.pdf · Outline 1 Install the Required Software 2 Getting Started with Your Project 3 Eclipse

Open code1 from Eclipse

• Select the folder with build assign1.xml

A Beginner’s Guide to Project 1 26 / 30Fall 2019

Page 27: A Beginner’s Guide to Project 1demo.clab.cs.cmu.edu/11711fa19/projects/initial_setup.pdf · Outline 1 Install the Required Software 2 Getting Started with Your Project 3 Eclipse

Open code1 from Eclipse

• Looks like this if done correctly

A Beginner’s Guide to Project 1 27 / 30Fall 2019

Page 28: A Beginner’s Guide to Project 1demo.clab.cs.cmu.edu/11711fa19/projects/initial_setup.pdf · Outline 1 Install the Required Software 2 Getting Started with Your Project 3 Eclipse

Outline

1 Install the Required Software

2 Getting Started with Your Project

3 Eclipse Basic Usages

4 Navigating the Starter Code

5 Your Work

6 Java Basics

A Beginner’s Guide to Project 1 28 / 30Fall 2019

Page 29: A Beginner’s Guide to Project 1demo.clab.cs.cmu.edu/11711fa19/projects/initial_setup.pdf · Outline 1 Install the Required Software 2 Getting Started with Your Project 3 Eclipse

Java Basics

• 15-110: Principles of Computing• http://www.cs.cmu.edu/˜jxc/100.html

A Beginner’s Guide to Project 1 29 / 30Fall 2019

Page 30: A Beginner’s Guide to Project 1demo.clab.cs.cmu.edu/11711fa19/projects/initial_setup.pdf · Outline 1 Install the Required Software 2 Getting Started with Your Project 3 Eclipse

Questions?

A Beginner’s Guide to Project 1 30 / 30Fall 2019