Homework 3 haiku

I have finally finished constructing Homework 3.

It’s really huge. It’s actually more like an “interactive reading” than it is like a homework. It’s mostly walking you through the process of trying to build up a haiku generator using NLTK, the CMU pronunciation corpus, and the Brown corpus. It took a long time to write, I think it might take less long to do. But it is going to look intimidatingly long. The things you actually need to do are not too elaborate, they’re mostly kind of things to help make sure you’re understanding what’s happening along the way.

There might be bugs or typos, too. Please let me know if you see any, I’ll try to get them fixed.

It’s large enough that I’m going to put it on its own page: Homework 3 “Haiku”

I have it down as being due on Friday this time, because that’s almost a week away.

  • homework

Anaconda is the new recommended environment

Even if you have Python working in some fashion on your computers already, I have a new recommendation for installing it. There is a “distribution” of Python (and some other things, including NLTK) called “Anaconda” that makes setting up Python and related software much easier.

I’m going to switch to Anaconda myself, both in and out of class, rather than using the Python/IDLE combination directly from Python.org. The Anaconda distribution makes everything pretty painless, you don’t have to worry about, e.g., not having matplotlib installed, etc., and it also contains some other stuff that we’ll use later in the semester (notably R). And the IDE (Integrated Development Environment, comparable to IDLE) that is included is smarter and nicer to use. It’s more complicated-looking, but it’s better.

To install it, go to the Anaconda page, click on “Download Anaconda”, pick your platform (Mac, Windows, or Linux), and download the Python 3.5 version. For the Mac, I’d advise picking the graphical installer option. Double-click on the downloaded package, follow the instructions.

When you’re finished, you should have an anaconda folder in your home folder (which might not be immediately visible on the Mac—open your Documents folder and then press command + up-arrow to move out of your Documents folder up in the hierarchy, and at that point you should see the anaconda folder). Inside that folder you should see an application called Navigator. If you already see a python application in there, you can double click on that, but otherwise double-click on Navigator and then install/launch Spyder.

This will give you a multipanel interface, with a temporary file on the left, and an “IPython console” in the lower right. The “IPython console” is basically like IDLE. You can drag the separators around to make it bigger.

I’ll use this in class from now on, so you can see how I use it there as well. This is new to me as of today as well, but I can already see that it’s going to much easier than using IDLE or Terminal would be, and having Anaconda installed is going to be useful later for using R and possibly other things that come with it.

  • announcements

Homework 2, and Friday

Greetings – ok, so, I’ve had a few people tell me that they have gotten stumped at various points while going through homework 2. Perhaps you are also stumped by something, in fact.

It is true that some of the exercises in this second homework are a level up in difficulty, particularly if you’re one of those for whom Python (or programming generally) is new. I think once you’re on the other side of them, and understand how everything works and fits together, you’ll look back on them as not being all that complicated—but that’s of limited comfort from this side of them.

It’s not particuarly useful for anyone involved to just hand in a guess you’re not sure about, or skip things, so I have a two part strategy to deal with this.

  • Part One: If you want, you can email the homework to me by Saturday sometime instead. If you’ve already emailed me something, you can send a revision as well, if you wish.
  • Part Two: Friday (this week at least) will be a designated Python/programming workshop day, the idea being that it’s optional/skippable for people who feel confident with programming and Python, and the plan will be not to advance with NLTK but just work through questions, strategies, etc. about the language environment itself.

Apologies to anyone who worked super hard to get it ready for Wednesday. If you hand it in and are happy with it, you don’t have to think about it anymore. But I think for people who don’t think they’ve got it yet, it’ll be helpful to have Friday’s session first, before it’s due.

So, to repeat, 1: Homework 2 is really due on Saturday, and 2: Friday is optional.

  • homework

Homework 2

Here’s the plan for the second homework assignment. It again involves exercises from the book.

From chapter 1: 19, 26

From chapter 2: 8, 15, 16, 17, 18, 20

However, if you feel quite Python-competent already, you can skip the chapter 1 exercises, and instead try out the chapter 2 exercise 24 (about Zipf’s Law). I think if you’re new to Python, ex. 24 will take a bit too much to work though, but I think it can end up being kind of interesting. I’ll talk about it anyway, but if you’re finding the chapter 1 exercises too simple, this one should be significantly less simple.

  • homework

Pardon the mess

This is kind of tangential to the course, but I kept getting locked out of WordPress due to failed login attempts from malicious internet robots, so I have changed the site to a “static” one (which gives malicious internet robots nothing to do, since there is no longer anywhere to sign in).

Mainly, for your purposes: it now looks different, and it may take a little while before everything’s back in order. For example, there are no category listings yet, nor an obvious RSS feed, but I’m working on it.

Now that this is in place, though, I should be able to keep up a bit more easily. Next up will be the promised homework posting.

  • announcements