Presentation is loading. Please wait.

Presentation is loading. Please wait.

NLTK & Python Day 8 LING 681.02 Computational Linguistics Harry Howard Tulane University.

Similar presentations


Presentation on theme: "NLTK & Python Day 8 LING 681.02 Computational Linguistics Harry Howard Tulane University."— Presentation transcript:

1 NLTK & Python Day 8 LING 681.02 Computational Linguistics Harry Howard Tulane University

2 11-Sept-2009LING 681.02, Prof. Howard, Tulane University2 Course organization  NLTK should be installed on the computers in this room!

3 NLPP §2 Accessing text corpora and lexical resources §2.2 Conditional frequency

4 11-Sept-2009LING 681.02, Prof. Howard, Tulane University4 Practice  Do "Your Turn" up to p. 55  Exercises 2.8.2-4, 2.8.8

5 NLPP §2 Accessing text corpora and lexical resources §2.3 More Python: Reusing code

6 11-Sept-2009LING 681.02, Prof. Howard, Tulane University6 Creating a program with a text editor  Create the monty.py program.

7 11-Sept-2009LING 681.02, Prof. Howard, Tulane University7 Other IDEs  Eclipse (Java Dev) + Pydev plugin  http://www.eclipse.org/downloads/ http://www.eclipse.org/downloads/  Mac users should use Cocoa version  http://pydev.org/index.html http://pydev.org/index.html  Xcode Tools now supports Python  It is part of optional installation on DVD.  You have to register as a developer to download it from http://developer.apple.com/http://developer.apple.com/

8 11-Sept-2009LING 681.02, Prof. Howard, Tulane University8 Functions  What might you want to put in your program?  Why, a function, of course!  A function takes an input to produce an output or return value: >>> def my_function_name(my_inputs)... # calculate my_output... return my_output...

9 11-Sept-2009LING 681.02, Prof. Howard, Tulane University9 Modules and higher  As you accumulate functions, you will want to store them somewhere.  Save them all in the same text file with the.py suffix, i.e. my_mod.py, called a module and  import them as needed:  from my_mod import my_function_name  Hierarchy  function < module < package < library

10 NLPP §2 Accessing text corpora and lexical resources §2.4 Lexical resources

11 11-Sept-2009LING 681.02, Prof. Howard, Tulane University11 Lexical resources  What is a lexicon?  a collection of words and/or phrases, sometimes with additional information such as part of speech or meaning  What is a lexical entry?  A headword/lemma, along with that other info saw 1 [verb] past tense of see saw 2 [noun] cutting instrument

12 11-Sept-2009LING 681.02, Prof. Howard, Tulane University12 More corpora  Wordlist corpora  words  Names Corpus  Do ex. 2.8.8  CMU Pronouncing Dictionary  Do ex. 2.8.12  Comparative wordlists  Swadesh wordlist  Shoebox/Toolbox

13 NLPP §2 Accessing text corpora and lexical resources §2.5 WordNet

14 11-Sept-2009LING 681.02, Prof. Howard, Tulane University14 Semantic relations  Synonym  Synonyms are grouped into synsets in WordNet  look at code  Do Your turn

15 Next time Q/P2 Do two of Ex. 2.8.16-19 Start NLPP §3


Download ppt "NLTK & Python Day 8 LING 681.02 Computational Linguistics Harry Howard Tulane University."

Similar presentations


Ads by Google