LING 388: Computers and Language

Slides:



Advertisements
Similar presentations
MY NCBI To register, add filters and use the MY NCBI options, you should directly access PubMed using the following address:
Advertisements

CS 100: Roadmap to Computing Fall 2014 Lecture 0.
Lecture 1 Describing Data.
LING/C SC/PSYC 438/538 Lecture 4 9/1 Sandiway Fong.
1 Session-12 CSIT 121 Spring 2006 Test-1 is on March 9 th ; Demo-5 due date extended to March 7 Test-1 is on March 9 th ; Demo-5 due date extended to March.
MA 102 Statistical Controversies Monday, February 18, 2002 Today: Discuss Chapter 9 concepts and exercises Review Part 1 of the text Test 1 question types.
Using the Diagram It Template Copy this presentation to your hard drive. There are two sets of templates: Slides #3 & 4 for a flow chart Slides #5 & 6.
Recitation 1 Programming for Engineers in Python.
LING 408/508: Programming for Linguists Lecture 19 November 4 th.
Matlab tutorial course Exercises 1:. Exercises Go back to my webpage, download the file ‘startup.m’ and save it in your MATLAB home folder – Must be directly.
Matlab tutorial course Exercises 2:. Exercises Copy the script ‘face_points.m’ from my webpage into your ‘scripts’ folder Create a new folder in your.
Lists and More About Strings CS303E: Elements of Computers and Programming.
Python File Handling. In all the programs you have made so far when program is closed all the data is lost, but what if you want to keep the data to use.
CSC 171 – FALL 2001 COMPUTER PROGRAMMING LECTURE 0 ADMINISTRATION.
Topic 1Topic 2Topic 3Topic 4Topic
LING 388: Language and Computers Sandiway Fong Lecture 6: 9/15.
YEAR 8 – WEB DESIGN IN HTML Lesson 2. STARTER Use the internet to find out what JavaScript is? Use ‘Microsoft Word’ to write down your list.
The DSpace Course Module – Items in DSpace. Module objectives  By the end of this module you will:  Understand what an item in DSpace is, and what it.
Introduction Copyright © Software Carpentry This work is licensed under the Creative Commons Attribution License See
12/7/2015B.Ramamurthy1 Exam2 Review CSE111 B.Ramamurthy.
1 Lecture 4 Post-Graduate Students Advanced Programming (Introduction to MATLAB) Code: ENG 505 Dr. Basheer M. Nasef Computers & Systems Dept.
Field Education: Weekly Tracking Sheet In D2L, select your Field Education Course.
LING 408/508: Programming for Linguists Lecture 20 November 16 th.
How to Save a Microsoft Document onto a PowerPoint Slide 1. Open Microsoft Office Word and minimize it so you can go to the internet to find your information.
Download class materials onto your desktop… as usual.
LING 408/508: Programming for Linguists Lecture 19 November 9 th.
LING 408/508: Programming for Linguists Online Lecture 7 September 16 th.
OCR Computing GCSE © Hodder Education 2013 Slide 1 OCR GCSE Computing Python programming 10: Files.
Files in Python Opening and Closing. Big Picture To use a file in a programming language – You have to open the file – Then you process the data in the.
Print the sample banner slides or customize with your own message. Click on the letter and type your own text. Use one character per slide. C.
Lesson 10: Dictionaries Topic: Introduction to Programming, Zybook Ch 9, P4E Ch 9. Slides on website.
Topics discussed in this section:
LING 388: Computers and Language
LING 388: Computers and Language
LING 388: Computers and Language
LING 388: Computers and Language
LING 388: Computers and Language
Fill the screen challenge!
LING 388: Computers and Language
Diagram It! When you wish to visually render a process, variables or components that are part of a larger system, Diagram It! is your game!
LING 388: Computers and Language
Lesson 09: Lists Topic: Introduction to Programming, Zybook Ch 8, P4E Ch 8. Slides on website.
LING 388: Computers and Language
Set Up for Instructor Classroom Support Services (CSS), 35 Kane Hall,
Matlab tutorial course
CS 100: Roadmap to Computing
LING 408/508: Computational Techniques for Linguists
Lesson 09: Lists Class Chat: Attendance: Participation
Winter 2019 CISC101 2/17/2019 CISC101 Reminders
Introduction In today’s lesson we will look at: why Python?
Lesson 10: Dictionaries Class Chat: Attendance: Participation
How to use this Template
CS-401 Assembly Language Programming
LING 408/508: Computational Techniques for Linguists
LING 388: Computers and Language
LING 388: Computers and Language
Investment Analysis and Portfolio Management
Software Engineering Lecture #29
Introduction to Computer Science
Retrieve Your Colored Folder |
How Should You Participate in this Course?
CS 100: Roadmap to Computing
Topic A Grade 1.
Topics discussed in this section:
Introduction to Computer Science
LING 388: Computers and Language
LING 388: Computers and Language
LING 388: Computers and Language
Exam #2 covering Sections 11 to 15 - NEXT CLASS!
ME 123 Computer Applications I Lecture 5: Input and Output 3/17/03
Presentation transcript:

LING 388: Computers and Language Lecture 9

Administrivia Reminder: next week TA Patricia Lee will lead the class Lecture 8 slides updated with examples from last class Today topic: file handling

Python: Files Like all other programming languages, uses a file handle, called file variable: open() infile = open("file.txt","r") outfile = open("results.txt,"w")

Python: Files https://docs.python.org/3/tutorial/inputoutput.html#reading-and- writing-files

Sample text file Course webpage: falconheavylaunch.txt http://www.bbc.com/news/science- environment-42969020 Course webpage: falconheavylaunch.txt

Class Exercise Download falconheavylaunch.txt to your computer. Answer the following questions. How many characters are there in the article? How many lines of text are there in the article? How many lines excluding blank lines? How many words are there in the article? How many characters per word? What are the most common words? Recall from lecture 7: from collections import Counter c = Counter() c.most_common()

Answers to class exercise

Class Example: Questions 1 and 2

Class Example: Question 3

Class Example: Question 4

Class Example: Question 5 4.88 characters per word

Class Example: Question 6 Closed class items only in most common 10. First open class items to appear are: rocket, Falcon, Jeavy, aircraft, Elon Recall text summarizati on?

Python: Files Writing (assuming you've opened a file for writing):

Python: json JSON = JavaScript Object Notation 7.2.2. Saving structured data with json https://docs.python.org/3/library/json.ht ml#module-json

Class Example: Python: json Explanation: we loaded it back in as a dict. most_common() is a method of Counter