LING/C SC/PSYC 438/538 Lecture 10 Sandiway Fong. Today's Topics A note on the UIUC POS Tagger Fun with POS Tagging Perl regex wrap-up.

Slides:



Advertisements
Similar presentations
LING/C SC/PSYC 438/538 Lecture 11 Sandiway Fong. Administrivia Homework 3 graded.
Advertisements

JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
CPSC 422, Lecture 16Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 16 Feb, 11, 2015.
Introduction to JavaScript
LING/C SC/PSYC 438/538 Lecture 12 Sandiway Fong. Administrivia We'll postpone Homework 4 review until next week …
Microsoft Expression Web-Illustrated Unit L: Using Code Tools.
LING/C SC/PSYC 438/538 Lecture 4 Sandiway Fong. Administrivia Homework 1 graded – you should have gotten an from me.
LING/C SC/PSYC 438/538 Lecture 4 9/1 Sandiway Fong.
Project topics Projects are due till the end of May Choose one of these topics or think of something else you’d like to code and send me the details (so.
LING 388 Language and Computers Take-Home Final Examination 12/9/03 Sandiway FONG.
25-Jun-15 JavaScript Language Fundamentals II. 2 Exception handling, I Exception handling in JavaScript is almost the same as in Java throw expression.
LING/C SC/PSYC 438/538 Lecture 8 Sandiway Fong. Adminstrivia.
Introduction to JavaScript. Aim To enable you to write you first JavaScript.
LING/C SC/PSYC 438/538 Lecture 19 Sandiway Fong 1.
LING/C SC/PSYC 438/538 Lecture 5 9/8 Sandiway Fong.
Lecture Note 3: ASP Syntax.  ASP Syntax  ASP Syntax ASP Code is Browser-Independent. You cannot view the ASP source code by selecting "View source"
LING 388: Language and Computers Sandiway Fong Lecture 17.
CNIT 133 Interactive Web Pags – JavaScript and AJAX JavaScript Environment.
JavaScript & DOM Client-side scripting. JavaScript JavaScript is a tool to automate client side (which is implemented using HTML so far) JavaSript syntax.
1 JavaScript. 2 What’s wrong with JavaScript? A very powerful language, yet –Often hated –Browser inconsistencies –Misunderstood –Developers find it painful.
CSC 330 E-Commerce Teacher Ahmed Mumtaz Mustehsan Ahmed Mumtaz Mustehsan GM-IT CIIT Islamabad GM-IT CIIT Islamabad CIIT Virtual Campus, CIIT COMSATS Institute.
LING/C SC/PSYC 438/538 Computational Linguistics Sandiway Fong Lecture 4: 8/30.
Client Scripting1 Internet Systems Design. Client Scripting2 n “A scripting language is a programming language that is used to manipulate, customize,
CIS 218 Advanced UNIX1 CIS 218 – Advanced UNIX (g)awk.
Tutorial 10 Programming with JavaScript
LING/C SC/PSYC 438/538 Lecture 2 Sandiway Fong. Today’s Topics Did you read Chapter 1 of JM? – Short Homework 2 (submit by midnight Friday) Today is Perl.
LING 388: Language and Computers Sandiway Fong Lecture 18.
FireBug. What is Firebug?  Firebug is a powerful tool that allows you to edit HTML, CSS and view the coding behind any website: CSS, HTML, DOM and JavaScript.
LING/C SC/PSYC 438/538 Lecture 3 Sandiway Fong. Administrivia Homework 2 graded.
20-753: Fundamentals of Web Programming 1 Lecture 10: Server-Side Scripting II Fundamentals of Web Programming Lecture 10: Server-Side Scripting II.
LING/C SC/PSYC 438/538 Lecture 13 Sandiway Fong. Administrivia Reading Homework – Chapter 3 of JM: Words and Transducers.
GRAMMARS & PARSING Lecture 8 CS2110 – Spring If you are going to form a group for A2, please do it before tomorrow (Friday) noon.
CPSC 422, Lecture 15Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 15 Oct, 14, 2015.
JavaScript. JavaScript is the programming language of HTML and the Web. Easy to learn One of the 3 languages of all developers MUST learn: 1. HTML to.
LING/C SC/PSYC 438/538 Lecture 8 Sandiway Fong. Adminstrivia Homework 4 not yet graded …
LING/C SC/PSYC 438/538 Lecture 20 Sandiway Fong 1.
LING/C SC/PSYC 438/538 Lecture 18 Sandiway Fong. Adminstrivia Homework 7 out today – due Saturday by midnight.
Text Building a Website Lesson 3. Headings,,,,, Headings,,,,, HTML has 6 levels of headings,,,,,,,,,, is used for main headings is used for main headings.
LING/C SC/PSYC 438/538 Lecture 6 Sandiway Fong. Homework 4 Submit one PDF file Your submission should include code and sample runs Due date Monday 21.
LING/C SC/PSYC 438/538 Lecture 9 Sandiway Fong. Adminstrivia Homework 4 graded Homework 5 out today – Due Saturday night by midnight – (Gives me Sunday.
 Before you continue you should have a basic understanding of the following:  HTML  CSS  JavaScript.
LING/C SC/PSYC 438/538 Lecture 19 Sandiway Fong 1.
Variable Variables A variable variable has as its value the name of another variable without $ prefix E.g., if we have $addr, might have a statement $tmp.
LING/C SC/PSYC 438/538 Online Lecture 7 Sandiway Fong.
JavaScript and Ajax (JavaScript Environment) Week 6 Web site:
IST 210: PHP Basics IST 210: Organization of Data IST2101.
LING/C SC 581: Advanced Computational Linguistics Lecture Notes Feb 17 th.
Tutorial 10 Programming with JavaScript
Intro to JavaScript CS 1150 Spring 2017.
* Lecture # 7 Instructor: Rida Noor Department of Computer Science
LING/C SC/PSYC 438/538 Lecture 11 Sandiway Fong.
LING/C SC/PSYC 438/538 Lecture 10 Sandiway Fong.
LING/C SC/PSYC 438/538 Lecture 23 Sandiway Fong.
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 15
LING/C SC/PSYC 438/538 Lecture 5 Sandiway Fong.
Nouns Nouns not noun noun noun not not
LING/C SC/PSYC 438/538 Lecture 21 Sandiway Fong.
LING/C SC/PSYC 438/538 Lecture 7 Sandiway Fong.
LING/C SC/PSYC 438/538 Lecture 3 Sandiway Fong.
LING/C SC/PSYC 438/538 Lecture 23 Sandiway Fong.
LING/C SC/PSYC 438/538 Lecture 24 Sandiway Fong.
LING/C SC/PSYC 438/538 Lecture 15 Sandiway Fong.
LING/C SC/PSYC 438/538 Lecture 25 Sandiway Fong.
LING/C SC/PSYC 438/538 Lecture 13 Sandiway Fong.
LING/C SC/PSYC 438/538 Lecture 17 Sandiway Fong.
Form Validation (with jQuery, HTML5, and CSS)
LING/C SC/PSYC 438/538 Lecture 5 Sandiway Fong.
LING/C SC/PSYC 438/538 Lecture 4 Sandiway Fong.
LING/C SC/PSYC 438/538 Lecture 3 Sandiway Fong.
LING/C SC/PSYC 438/538 Lecture 8 Sandiway Fong.
Presentation transcript:

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

Today's Topics A note on the UIUC POS Tagger Fun with POS Tagging Perl regex wrap-up

UIUC Tagger Mystery: I mentioned last time that (when I copied the output of the tagger) the forward slashes disappeared. Your classmate Hongyi Zhu not only did some excellent sleuthing but also supplied a script to work around the problem.

UIUC Tagger Hongyi Zhu: I looked at the UIUC POS tagging website and found that the displayed "/" was created by CSS pseudo element, which is not a part of the text. I wrote a short javascript to generate and copy the text with [forward] slash. –st=document.styleSheets;for(var i=0;i - 1){rs=st[i].cssRules;var t=0;for(var j=0;j - 1){t=j;};};if(t!=0){st[i].deleteRule(t);};};};lb=document.getElementsByClassName("label");for(var i=0;i<lb.length;i++){lb[i].innerHTML+="/";};window.prompt("Press Ctrl-C or Right-click and Copy",document.getElementsByClassName("output")[0].innerText.replace(/\/ /g,"/")); After you clicked 'submit', you can call a browser console (F12 in Chrome or Option-Command- C in Safari ) and then copy and execute the script. To make it easy to copy and execute, I removed all the white spaces and line breaks. You should be able to copy the result with [forward] slashes from a prompt.

POS Tagger We'll return to the topic of POS tagging later in the course… POS tagging is not 100% accurate

POS Tagger Let's digress a bit and look at a worst case scenario. Consider the Buffalo sentence from Homework 4 …

POS Tagger Buffalo buffalo = buffalo from Buffalo Since buffalo is a transitive verb, we can form: – NNP/Buffalo NNS/buffalo VBP/buffalo NNP/Buffalo NNS/buffalo

POS Tagger Object relative clause construction: – Buffalo buffalo (that) Buffalo buffalo buffalo – NNP/Buffalo NNS/buffalo NNP/Buffalo NNS/buffalo VBP/buffalo

POS Tagger Substitute the relative clause into the sentence: NNP/Buffalo NNS/buffalo NNP/Buffalo NNS/buffalo VBP/buffalo VBP/buffalo NNP/Buffalo NNS/buffalo Syntactic Analysis

POS Tagger The UIUC tagger:

POS Tagger Stanford Parser: NNP = proper noun, JJ = adjective, VBZ = verb 3 rd person singular present

POS Tagger Berkeley Parser: VBP = verb non-3 rd person singular present

Arrays as Stacks and Queues Arrays: – insertion and deletion from the ends 012n-1n-2 shift/unshift pop/push Perl functions may have side effects and also return values

Arrays as Stacks and Queues Example: Another example: Generalized form:

Regex Recursion Pallindrome = something that reads the same backwards or forwards, e.g. kayak and racecar. Regexs cannot express pallindromes but Perl regexs can because we can use backreferences recursively.

Regex Recursion Program: (?group-ref)

Regex Lookahead and Lookback Zero-width regexs: – ^ (start of string) – $(end of string) – \b(word boundary) matches the imaginary position between \w\W (or \W\w, or just before beginning of string if ^\w, just after the end of the string if \w$ Current position of match (so far) doesn't change! – (?=regex)(lookahead from current position) – (?<=regex) (lookback from current position) – (?!regex)(negative lookahead) – (?<!regex) (negative lookback)

Regex Lookahead and Lookback Example: looks for a word beginning with _ such that there is a duplicate ahead without the _ Note: lookback cannot be variable length in Perl

Debugging Perl regex (?{ Perl code }) can be inserted anywhere in a regex can assist with debugging Example: