LING/C SC/PSYC 438/538. Lecture 3 Sandiway Fong

Similar documents
LING/C SC/PSYC 438/538. Lecture 4 Sandiway Fong

LING/C SC/PSYC 438/538. Lecture 2 Sandiway Fong

LING/C SC/PSYC 438/538. Lecture 2 Sandiway Fong

LING/C SC/PSYC 438/538. Lecture 10 Sandiway Fong

LING/C SC/PSYC 438/538. Lecture 10 Sandiway Fong

UNIVERSITY OF EDINBURGH COLLEGE OF SCIENCE AND ENGINEERING SCHOOL OF INFORMATICS INFR08008 INFORMATICS 2A: PROCESSING FORMAL AND NATURAL LANGUAGES

Student Guide for Usage of Criterion

Syntax and Grammars 1 / 21

Lecture 14: Annotation

View and Submit an Assignment in Criterion

CS1 Lecture 3 Jan. 18, 2019

The CKY Parsing Algorithm and PCFGs. COMP-550 Oct 12, 2017

Privacy and Security in Online Social Networks Department of Computer Science and Engineering Indian Institute of Technology, Madras

Homework & Announcements

LING/C SC/PSYC 438/538. Lecture 18 Sandiway Fong

1DL321: Kompilatorteknik I (Compiler Design 1) Introduction to Programming Language Design and to Compilation

1DL321: Kompilatorteknik I (Compiler Design 1)

1. Introduction. 2. Scalar Data

Hands-On Perl Scripting and CGI Programming

CS101: Intro to Computing Summer Week 1

Dependency grammar and dependency parsing

IT441. Network Services Administration. Data Structures: Arrays

Topics in Parsing: Context and Markovization; Dependency Parsing. COMP-599 Oct 17, 2016

LING/C SC/PSYC 438/538. Lecture 6 Sandiway Fong

Topic 1: Introduction

INF FALL NATURAL LANGUAGE PROCESSING. Jan Tore Lønning, Lecture 4, 10.9

SURVEY PAPER ON WEB PAGE CONTENT VISUALIZATION

Final Project Discussion. Adam Meyers Montclair State University

Introduction to Programming Languages and Compilers. CS164 11:00-12:30 TT 10 Evans. UPRM ICOM 4029 (Adapted from: Prof. Necula UCB CS 164)

Perl Scripting. Students Will Learn. Course Description. Duration: 4 Days. Price: $2295

Ling/CSE 472: Introduction to Computational Linguistics. 5/4/17 Parsing

CSE450 Translation of Programming Languages. Lecture 4: Syntax Analysis

1DL321: Kompilatorteknik I (Compiler Design 1) Introduction to Programming Language Design and to Compilation

Lesson 4: Type Conversion, Mutability, Sequence Indexing. Fundamentals of Text Processing for Linguists Na-Rae Han

Assignment 4 CSE 517: Natural Language Processing

CS1 Lecture 3 Jan. 22, 2018

Compiler Design 1. Introduction to Programming Language Design and to Compilation

announcements CSE 311: Foundations of Computing review: regular expressions review: languages---sets of strings

CS1 Lecture 2 Jan. 16, 2019

[ SEO LINK ROBOT QUICK USAGE GUIDE]

CS102 Unit 2. Sets and Mathematical Formalism Programming Languages and Simple Program Execution

Introduction to: Computers & Programming: Strings and Other Sequences

Morpho-syntactic Analysis with the Stanford CoreNLP

LING/C SC/PSYC 438/538. Lecture 20 Sandiway Fong

Intro to XML. Borrowed, with author s permission, from:

Intro to Programming. Unit 7. What is Programming? What is Programming? Intro to Programming

Identifying Idioms of Source Code Identifier in Java Context

Question Bank. 10CS63:Compiler Design

Public-Service Announcement

Structural Text Features. Structural Features

CSCI 4152/6509 Natural Language Processing. Perl Tutorial CSCI 4152/6509. CSCI 4152/6509, Perl Tutorial 1

ECE251 Midterm practice questions, Fall 2010

Programming Language Design and Implementation. Cunning Plan. Your Host For The Semester. Wes Weimer TR 9:30-10:45 MEC 214. Who Are We?

Principles of Programming Languages COMP251: Syntax and Grammars

Intro to Haskell Notes: Part 5

CMSC 201 Fall 2016 Lab 09 Advanced Debugging

Lexical Analysis. Lecture 2-4

Final Examination. Preliminaries. Compilers (CS F) Due: 11 a.m., Friday, 20 December 2002

CS 415 Midterm Exam Spring 2002

Pathologically Eclectic Rubbish Lister

Homework 2: Parsing and Machine Learning

PERL Scripting - Course Contents

L435/L555. Dept. of Linguistics, Indiana University Fall 2016

Refresher on Dependency Syntax and the Nivre Algorithm

Usage And Punctuation Standards

CS 3813/718 Fall Python Programming. Professor Liang Huang.

CSE P 501 Exam 8/5/04

Defining Program Syntax. Chapter Two Modern Programming Languages, 2nd ed. 1

CSE 143: Computer Programming II Summer 2017 HW4: Grammar (due Tuesday, July :30pm)

Chapter 4. Lexical and Syntax Analysis. Topics. Compilation. Language Implementation. Issues in Lexical and Syntax Analysis.

Wednesday, August 31, Parsers

The CKY algorithm part 2: Probabilistic parsing

Lesson 3: Basic Programming Concepts

6.S189 Homework 1. What to turn in. Exercise 1.1 Installing Python. Exercise 1.2 Hello, world!

Administrivia. Lexical Analysis. Lecture 2-4. Outline. The Structure of a Compiler. Informal sketch of lexical analysis. Issues in lexical analysis

Chapter 3 Parsing. time, arrow, banana, flies, like, a, an, the, fruit

A Survey Of Different Text Mining Techniques Varsha C. Pande 1 and Dr. A.S. Khandelwal 2

COMP-202: Foundations of Programming. Lecture 26: Review; Wrap-Up Jackie Cheung, Winter 2016

CS101 Introduction to Programming Languages and Compilers

CSCI 1060U Programming Workshop

Semester Review CSC 301

8/13/ /printqp.php?heading=II BSc [ ], Semester III, Allied: COMPUTER PROGRAMMING-PERL -309C&qname=309C

Software Concepts. 2-8 Explain the process of translating and executing a Java program. How might the World Wide Web be involved?

Syntax Analysis. Chapter 4

Principles of Programming Languages COMP251: Syntax and Grammars

A language is a subset of the set of all strings over some alphabet. string: a sequence of symbols alphabet: a set of symbols

Transition-based Parsing with Neural Nets

COMP 181 Compilers. Administrative. Last time. Prelude. Compilation strategy. Translation strategy. Lecture 2 Overview

CS 1044 Program 6 Summer I dimension ??????

Chapter 2 Basic Elements of C++

COMS 3101 Programming Languages: Perl. Lecture 2

CS 415 Midterm Exam Spring SOLUTION

CS1 Lecture 4 Jan. 23, 2019

Selec%on and Decision Structures in Java: If Statements and Switch Statements CSC 121 Fall 2016 Howard Rosenthal

T Hands-on 2. User-mode debuggers OllyDbg

Compilers. Lecture 2 Overview. (original slides by Sam

Welcome to CS 115 (Winter 2018)

Meridian Linguistics Testing Service 2018 English Style Guide

Information Retrieval CS Lecture 01. Razvan C. Bunescu School of Electrical Engineering and Computer Science

Outline. CS3157: Advanced Programming. Feedback from last class. Last plug

Transcription:

LING/C SC/PSYC 438/538 Lecture 3 Sandiway Fong

Today s Topics Homework 4 out due next Tuesday by midnight Homework 3 should have been submitted yesterday Quick Homework 3 review Continue with Perl intro

Homework 3 Review Fortune Magazine s Elon Musk AI article In a few decades it may be that our lives are so controlled that we find ourselves unable to deviate from the life path that AI decides we will be slaves to a machine-determined future Notes: URL didn t work for me. I did cut and paste Sample student one-line summaries: Elon Musk is afraid of AI because it may eventually be able to outsmart us. Elon Musk, world renowned businessman, warns that artificial intelligence (AI) used to replace human roles could lead to our undoing as they act without concern for human safety in the pursuit of their tasks.

Homework 3 Review https://qz.com/502071/for-the-firsttime-ever-two-asian-schools-beat-yalein-one-popular-university-ranking/ Headline: 5% summarization = table + caveat

Homework 3 Review Clickbait articles are syndicated?

Homework 3 Review How does OTS work? The Idea behind OTS is that the important ideas in an article are described with many of the same words while redundant information uses less technical terms and is not related to the main subject of the article. Important lines are lines that are related to the subject of the article. The subject of the article is the list of ideas that are most discussed in the article. https://github.com/neopunisher/open-text-summarizer

Homework 3 Review Step 1: Frequency information (unigram): 11 are 17 is 16 a 14 Harry 14 on 13 Sally 11 Love 11 such 4 an 2 taxi 1 university 1 chicago 1 meets Step 2: Remove stopwords: 14 Harry 13 Sally 11 Love 2 taxi 1 university 1 chicago 1 meets Then: 1. Grade each sentence according to the wordlist. 2. Match will include stemming: e.g. run, running, runnable fold plural/singular 3. Pick the N% top-scoring sentences

Homework 4 Question 1: JM Section 1.2 talks about Ambiguity. Go to the Stanford University Parser http://nlp.stanford.edu:8080/parser/index.jsp Try the sentence from section 1.2: I made her duck. Analyze the resulting parse. Explain which of the interpretations (1.5) to (1.9) is the parse obtained by the system compatible with?

Homework 4 Hints How to read the parse http://languagelog.ldc.upenn.edu/myl/penntreebank1995.pdf Phrasal Labels: VP = Verb Phrase, S = Sentence, NP = Noun Phrase, PP = Prepositional Phrase. ADJP = Adjectival Phrase. Part of Speech (POS) Labels: DT = Determiner, JJ = Adjective, JJR = adjective (Comparative Form), NN = common noun, VB = verb (base form), IN = Preposition, PRP$ = Possessive Pronoun. More here: https://www.ling.upenn.edu/courses/fall_2003/ling001/penn_treebank_pos. html

Homework 4 Question 2: JM Section 1.6.3 talks about natural language understanding and the Blocks World simulation: Move the red block on top of the smaller green one Give two different possible structural readings for the sentence Give parses with ( ); i.e. in the style of the Stanford Parser put in as much detail as you think you need to make the difference clear Hint: think about what the (multiword) preposition on top of can modify Explain your parses Use the Stanford Parser on the sentence: which one do you think the parse most closely represents? Explain.

Last Time: Perl Print Perl Python3 Same behavior, different assumptions about end of line (\n) from these two programming languages Note also the differences in syntax: (..) in Python3, no parentheses in Perl ; need to separate the statements in Perl, none in Python

Perl intro http://perldoc.perl.org/perlintro.html Nanny mode : helps with debugging Scalars: variables begin with ($) no such type requirement in Python Numbers (integer, floating point) Python includes complex numbers (cmath library) Strings References (pointers to (non-)scalars)

Perl intro Notes from the tutorial: semicolon (;) is not always necessary Command separator semantics vs. end of command (termination) token Best practice? Terminate every command with a semicolon Variable types: Every variable type has its own namespace. This means that $foo and @foo are two different variables. It also means that $foo[1] is a part of @foo, not a part of $foo. This may seem a bit weird, but that's okay, because it is weird.

Perl Arrays like a simple ordered list Literal: @ARRAY = (,, ) (round brackets; comma separator) Access: $ARRAY[ INDEX] (zero-indexed; negative indices ok; slices ok) Index of last element: $#array (a scalar) Coercion @ARRAY = number of elements in scalar context Built-in functions: sort @ARRAY; reverse @ARRAY,; push @ARRAY, $ELEMENT; pop @ARRAY; shift @ARRAY; unshift @ARRAY, $ELEMENT, splice @ARRAY, $OFFSET, $LENGTH, $ELEMENT $ELEMENT above can be @ARRAY Built-in arrays: @ARGV (command line arguments) @_ (sub(routine) arguments)

Perl Variable Prefixation Reading Perl code (perldata) aloud: Larry Wall was a linguist The '$' symbol works semantically like the English word "the" in that it indicates a single value is expected. Entire arrays (and slices of arrays and hashes) are denoted by '@', which works much like the word "these" or "those" does in English, in that it indicates multiple values are expected. Also: Entire hashes are denoted by '% (no translation) In addition, subroutines are named with an initial '&', though this is optional when unambiguous, just as the word "do" is often redundant in English.

Exercises If you re new to programming, practice using Perl read the intro and run all the examples! Preparatory reading: Chapter 2 of the textbook we ll be using Perl s regular expression (regex) engine for this