Prepare for next time No need to buy the book – Free online at Read Chapter 1 –

Slides:



Advertisements
Similar presentations
An Introduction to Inequalities
Advertisements

VARIABLES ON BOTH SIDES
Slope of a Line Slope basically describes the steepness of a line Free powerpoints at
Mayfield Intermediate
Programming for Linguists
How to Get Good Grades 10 easy steps.
Python Mini-Course University of Oklahoma Department of Psychology Day 1 – Lesson 4 Beginning Functions 4/5/09 Python Mini-Course: Day 1 - Lesson 4 1.
Programming for Linguists
Python 3 March 15, NLTK import nltk nltk.download()
Introduction to Python
Object-Oriented Programming
 Computer Science 1MD3 Introduction to Programming Winter 2014.
Def f(n): if (n == 0): return else: print(“*”) return f(n-1) f(3)
Introduction to Coding Standards Phil Pratt-Szeliga CSE 784 Fall 2009.
Engineering Computing I Chapter 1 – Part B A Tutorial Introduction continued.
Chapter 1 What is Economics About. Appendix A Working with Diagrams.
Chapter 2 Writing Simple Programs
Presentation by Kristi Reyes Pictures from Oxford Picture Dictionary
Recitation 1 Programming for Engineers in Python.
NLTK (Natural Language Tool Kit) Unix for Poets (without Unix) Unix  Python.
 2004 Prentice Hall, Inc. All rights reserved. Chapter 35 – Python Outline 35.1 Introduction First Python Program Python Keywords 35.2 Basic.
By November 8 th Solar Energy Definitions Solar Energy is energy made by the sun. Solar energy supplies the earth with electricity.
Programming for Linguists An Introduction to Python 24/11/2011.
Financial Accounting Business 112 Introduction (To Start, select Slide Show, then View Show. Advance slide and topics within slide by mouse click)
PHP Basics Course Introduction SoftUni Team Technical Trainers Software University
Formal Language Theory. Homework Read documentation on Graphviz – –
Haskell Chapter 8. Input and Output  What are I/O actions?  How do I/O actions enable us to do I/O?  When are I/O actions actually performed?
Lecture 6 Hidden Markov Models Topics Smoothing again: Readings: Chapters January 16, 2013 CSCE 771 Natural Language Processing.
Pre-AP Pre-Calculus Chapter 1, Section 5 Parametric Relations and Inverses
Functions. Built-in functions You’ve used several functions already >>> len("ATGGTCA")‏ 7 >>> abs(-6)‏ 6 >>> float("3.1415")‏ >>>
 What are conditionals & biconditionals?  How do you write converses, inverses, and contrapositives?
Introduction to Computing Using Python for loop / def- ining a new function  Execution control structures ( if, for, function call)  def -ining a new.
2.2.1 Analyze Conditional Statements and Proof Chapter 2: Reasoning and Proof.
What is the critical question? How would a pregnancy in your teen years effect you socially, economically, and personally? 1 What are the key terms and.
Algorithms. Homework None – Lectures & Homework Solutions: – Video:
Ch 1.7 (part 1) One Step (Addition & Subtraction) Objective: To solve one-step variable equations using the Inverse Property of Addition.
Introduction To Spirituality Watch the following slide show and listen to the music. Think about what the pictures and music are saying to you.
Debugging and Printing George Mason University. Today’s topics Review of Chapter 3: Printing and Debugging Go over examples and questions debugging in.
What can you see in the pictures? What unites these pictures? What is different?
Dictionaries and File I/O George Mason University.
Quiz 3 Topics Functions – using and writing. Lists: –operators used with lists. –keywords used with lists. –BIF’s used with lists. –list methods. Loops.
Chapter 6 Functions The Tic-Tac-Toe Game. Chapter Content In this chapter you will learn to do the following: 0 Write your own functions 0 Accept values.
Problem Solving with NLTK MSE 2400 EaLiCaRA Dr. Tom Way.
QUESTIONS. Who What Where When Why How How often How much How many How old 1.Jane eats _______________ every day. 2.Paul was born on ______________. 3.They.
Chapter 2 Writing Simple Programs
Week of 12/12/16 Test Review.
Brent M. Dingle Texas A&M University Chapter 6, Sections 1 and 2
My Picture Dictionary Comments and Future Considerations: Sentences T
Functions.
Literacy Test Preparation
First Python Program Professor Hugh C. Lauer CS-1004 — Introduction to Programming for Non-Majors (Slides include materials from Python Programming: An.
Chapter 1: Introduction
Types, Truth, and Expressions (Part 2)
Types, Truth, and Expressions (Part 2)
Ch 2.2 One Step (Addition & Subtraction)
نجاح وفشل المنشآت الصغيرة
Use Inverse Matrices to Solve 2 Variable Linear Systems
Literacy Test Preparation
Title Your Name.
Section 5.4 Study Materials
Types, Truth, and Expressions
Section 7.1 Graphs, Slopes, Inequalities and Applications.
def-ining a function A function as an execution control structure
Conditional Statements
Presentation transcript:

Prepare for next time No need to buy the book – Free online at Read Chapter 1 – Install NLTK (see next slide) – Warning: It might not be easy (and it might not be your fault) – Let us know how it goes (both positive and negative responses are more appreciated)

Installing NLTK Chapter 01: pp – Python – NLTK – Data

Homework

George Miller’s Example: Erode Exercise: Use “erode” in a sentence: – My family erodes a lot. to eat into or away; destroy by slow consumption or disintegration – Battery acid had eroded the engine. – Inflation erodes the value of our money. Miller’s Conclusion: – Dictionary examples are more helpful than defs Definition Examples George Miller: Chomsky’s Mentor & Wordnet

Introduction to Programming Traditional (Start with Definitions) Constants: 1 Variables: x Objects: – lists, strings, arrays, matrices Expressions: 1+x Statements: Side Effects – print 1+x; Conditionals: – If (x<=1) return 1; Iteration: for loops Functions Recursion Streams Non-Traditional (Start with Examples) Recursion def fact(x): if(x <= 1): return 1 else: return x * fact(x-1) Streams: – Unix Pipes Briefly mentioned – Everything else

Python def fact(x): if(x <= 1): return 1 else: return x * fact(x-1) def fact2(x): result=1 for i in range(x): result *=(i+1); return result Exercise: Fibonacci in Python Recursion Iteration

Lists

Strings

Subscripting

Python Objects Lists >>> sent1 ['Call', 'me', 'Ishmael', '.'] >>> type(sent1) >>> sent1[0] 'Call' >>> sent1[1:len(sent1)] ['me', 'Ishmael', '.'] Strings >>> sent1[0] 'Call' >>> type(sent1[0]) >>> sent1[0][0] 'C' >>> sent1[0][1:len(sent1[0])] 'all' First Rest

Flatten: Inverse of Split >>> def flatten(list): if(len(list) == 1): return list[0]; else: return list[0] + ' ' + flatten(list[1:len(list)]); First Rest flatten = split -1

Types & Tokens Polymorphism

Polymorphism (From Wikipedia)

Flatten: Inverse of Split >>> def flatten(list): if(len(list) == 1): return list[0]; else: return list[0] + ' ' + flatten(list[1:len(list)]); +