SlideShare a Scribd company logo
I256 
Applied Natural Language 
Processing 
Fall 2009 
Lecture 1 
Introduction 
Barbara Rosario
Introductions 
• Barbara Rosario 
– iSchool alumni (class 2005) 
– Intel Labs 
• Gopal Vaswani 
– iSchool master student (class 2010) 
• You?
Today 
• Introductions 
• Administrivia 
• What is NLP 
• NLP Applications 
• Why is NLP difficult 
• Corpus-based statistical approaches 
• Course goals 
• What we’ll do in this course
Administrivia 
• http://courses.ischool.berkeley.edu/i256/f09/index.html 
• Books: 
– Foundations of Statistical NLP, Manning and Schuetze, MIT press 
– Natural Language Processing with Python, Bird, Klein & Loper, 
O'Reilly. (also on line) 
– See Web site for additional resources 
• Work: 
– Individual coding assignments (Python & NLTK-Natural Language 
Toolkit) (4 or 5) 
– Final group project 
– Participation 
• Office hours: 
– Barbara: Thursday 2:00-3:00 in Room 6 
– Gopal: Tuesday 2:00-3:00 in Room 6 (to be confirmed)
Administrivia 
• Communication: 
– My email: barbara.rosario@intel.com 
– Gopal : gopal.vaswani@gmail.com 
– Mailing list: i256@ischool.berkeley.edu 
• Send an email to majordomo@ischool.berkeley.edu with subscribe 
i256 in the body 
• Through intranet 
– Announcements: webpage and/or mailing list and/or Bspace 
(TBA) 
– Public discussion: Bspace(?) 
• Related course: Statistical Natural Language 
Processing, Spring 2009, CS 288 
– http://www.cs.berkeley.edu/~klein/cs288/sp09/ 
– Instructor: Dan Klein 
– Much more emphasis on statistical algorithms 
• Questions?
Natural Language Processing 
• Fundamental goal: deep understand of 
broad language 
– Not just string processing or keyword 
matching! 
• End systems that we want to build: 
– Ambitious: speech recognition, machine 
translation, question answering… 
– Modest: spelling correction, text 
categorization… 
Slide taken from Klein’s course: UCB CS 288 spring 09
Example: Machine Translation
NLP applications 
• Text Categorization 
– Classify documents by topics, language, author, spam filtering, 
information retrieval (relevant, not relevant), sentiment 
classification (positive, negative) 
• Spelling & Grammar Corrections 
• Information Extraction 
• Speech Recognition 
• Information Retrieval 
– Synonym Generation 
• Summarization 
• Machine Translation 
• Question Answering 
• Dialog Systems 
– Language generation
Why NLP is difficult 
• A NLP system needs to answer the question 
“who did what to whom” 
• Language is ambiguous 
– At all levels: lexical, phrase, semantic 
– Iraqi Head Seeks Arms 
• Word sense is ambiguous (head, arms) 
– Stolen Painting Found by Tree 
• Thematic role is ambiguous: tree is agent or location? 
– Ban on Nude Dancing on Governor’s Desk 
• Syntactic structure (attachment) is ambiguous: is the ban or 
the dancing on the desk? 
– Hospitals Are Sued by 7 Foot Doctors 
• Semantics is ambiguous : what is 7 foot?
Why NLP is difficult 
• Language is flexible 
– New words, new meanings 
– Different meanings in different contexts 
• Language is subtle 
– He arrived at the lecture 
– He chuckled at the lecture 
– He chuckled his way through the lecture 
– **He arrived his way through the lecture 
• Language is complex!
Why NLP is difficult 
• MANY hidden variables 
– Knowledge about the world 
– Knowledge about the context 
– Knowledge about human communication techniques 
• Can you tell me the time? 
• Problem of scale 
– Many (infinite?) possible words, meanings, context 
• Problem of sparsity 
– Very difficult to do statistical analysis, most things 
(words, concepts) are never seen before 
• Long range correlations
Why NLP is difficult 
• Key problems: 
– Representation of meaning 
– Language presupposes knowledge about the 
world 
– Language only reflects the surface of 
meaning 
– Language presupposes communication 
between people
Meaning 
• What is meaning? 
– Physical referent in the real world 
– Semantic concepts, characterized also by relations. 
• How do we represent and use meaning 
– I am Italian 
• From lexical database (WordNet) 
• Italian =a native or inhabitant of Italy Italy = republic in southern 
Europe [..] 
– I am Italian 
• Who is “I”? 
– I know she is Italian/I think she is Italian 
• How do we represent “I know” and “I think” 
• Does this mean that I is Italian? What does it say about the “I” and 
about the person speaking? 
– I thought she was Italian 
• How do we represent tenses?
Today 
• Introductions 
• Administrivia 
• What is NLP 
• NLP Applications 
• Why is NLP difficult 
• Corpus-based statistical approaches 
• Course goals 
• What we’ll do in this course
Corpus-based statistical 
approaches to tackle NLP problem 
– How can a can a machine understand these 
differences? 
• Decorate the cake with the frosting 
• Decorate the cake with the kids 
– Rules based approaches, i.e. hand coded syntactic 
constraints and preference rules: 
• The verb decorate require an animate being as agent 
• The object cake is formed by any of the following, inanimate 
entities (cream, dough, frosting…..) 
– Such approaches have been showed to be time 
consuming to build, do not scale up well and are very 
brittle to new, unusual, metaphorical use of language 
• To swallow requires an animate being as agent/subject and a 
physical object as object 
– I swallowed his story 
– The supernova swallowed the planet
Corpus-based statistical 
approaches to tackle NLP problem 
• A Statistical NLP approach seeks to solve these 
problems by automatically learning lexical and 
structural preferences from text collections 
(corpora) 
• Statistical models are robust, generalize well 
and behave gracefully in the presence of errors 
and new data. 
• So: 
– Get large text collections 
– Compute statistics over those collections 
– (The bigger the collections, the better the statistics)
Corpus-based statistical 
approaches to tackle NLP problem 
• Decorate the cake with the frosting 
• Decorate the cake with the kids 
• From (labeled) corpora we can learn that: 
#(kids are subject/agent of decorate) > #(frosting is subject/agent of 
decorate) 
• From (UN-labeled) corpora we can learn that: 
#(“the kids decorate the cake”) >> #(“the frosting decorates the cake”) 
#(“cake with frosting”) >> #(“cake with kids”) 
etc.. 
• Given these “facts” we then need a statistical model 
for the attachment decision
Corpus-based statistical approaches 
to tackle NLP problem 
• Topic categorization: classify the document 
into semantics topics 
Document 1 
The U.S. swept into the Davis Cup final 
on Saturday when twins Bob and Mike 
Bryan defeated Belarus's Max Mirnyi 
and Vladimir Voltchkov to give the 
Americans an unsurmountable 3-0 lead 
in the best-of-five semi-final tie. 
Topic = sport 
Document 2 
One of the strangest, most relentless 
hurricane seasons on record reached 
new bizarre heights yesterday as the 
plodding approach of Hurricane 
Jeanne prompted evacuation orders 
for hundreds of thousands of 
Floridians and high wind warnings 
that stretched 350 miles from the 
swamp towns south of Miami to the 
historic city of St. Augustine. 
Topic = disaster
Corpus-based statistical approaches 
to tackle NLP problem 
• Topic categorization: classify the document 
into semantics topics 
Document 1 (sport) 
The U.S. swept into the Davis 
Cup final on Saturday when twins 
Bob and Mike Bryan … 
Document 2 (disasters) 
One of the strangest, most 
relentless hurricane seasons on 
record reached new bizarre heights 
yesterday as…. 
• From (labeled) corpora we can learn that: 
#(sport documents containing word Cup) > #(disaster documents 
containing word Cup) -- feature 
• We then need a statistical model for the topic 
assignment
Corpus-based statistical 
approaches to tackle NLP problem 
• Feature extractions (usually linguistics 
motivated) 
• Statistical models 
• Data (corpora, labels, linguistic 
resources)
Goals of this Course 
• Learn about the problems and possibilities of natural 
language analysis: 
– What are the major issues? 
– What are the major solutions? 
• At the end you should: 
– Agree that language is difficult, interesting and important 
– Be able to assess language problems 
• Know which solutions to apply when, and how 
• Feel some ownership over the algorithms 
– Be able to use software to tackle some NLP language tasks 
– Know language resources 
– Be able to read papers in the field
What We’ll Do in this Course 
• Linguistic Issues 
– What are the range of language phenomena? 
– What are the knowledge sources that let us 
disambiguate? 
– What representations are appropriate? 
• Applications 
• Software (Python and NLTK) 
• Statistical Modeling Methods
What We’ll Do in this Course 
• Read books, research papers and tutorials 
• Final project 
– Your own ideas or chose from some suggestions I will 
provide 
– We’ll talk later during the couse about ideas/methods 
etc. but come talk to me if you have already some 
ideas 
• Learn Python 
• Learn/use NLTK (Natural Language ToolKit) to 
try out various algorithms
Python - Simple yet powerful 
The zen of python : http://www.python.org/dev/peps/pep-0020/ 
• Very clear, readable syntax 
• Strong introspection capabilities 
– http://www.ibm.com/developerworks/linux/library/l-pyint.html 
(recommended) 
• Intuitive object orientation 
• Natural expression of procedural code 
• Full modularity, supporting hierarchical packages 
• Exception-based error handling 
• Very high level dynamic data types 
• Extensive standard libraries and third party modules for virtually every task 
– Excellent functionality for processing linguistic data. 
– NLTK is one such extensive third party module. 
Source : python.org 
Python
Language processing task NLTK modules Functionality 
Accessing corpora nltk.corpus standardized interfaces to corpora and lexicons 
String processing nltk.tokenize, nltk.stem tokenizers, sentence tokenizers, stemmers 
Collocation discovery nltk.collocations t-test, chi-squared, point-wise mutual information 
Part-of-speech tagging nltk.tag n-gram, backoff, Brill, HMM, TnT 
Classification nltk.classify, nltk.cluster decision tree, maximum entropy, naive Bayes, EM, k-means 
Chunking nltk.chunk regular expression, n-gram, named-entity 
Parsing nltk.parse chart, feature-based, unification, probabilistic, dependency 
Source : nltk.org 
This is not the complete list 
NLTK 
• NLTK defines an infrastructure that can be used to build NLP programs in Python. 
• It provides basic classes for representing data relevant to natural language 
processing. 
• Standard interfaces for performing tasks such as part-of-speech tagging, syntactic 
parsing, and text classification. 
• Standard implementations for each task which can be combined to solve complex 
problems. 
Resources: 
• Download at http://www.nltk.org/download 
• Getting started with NLTK Chapter 1 
• NLP and NLTK talk at google http://www.youtube.com/watch?v=keXW_5-llD0
Topics 
• Text corpora & other resources 
• Words (Morphology, tokenization, stemming, part-of-speech, 
WSD, collocations, lexical acquisition, language 
models) 
• Syntax: chunking, PCFG & parsing 
• Statistical models (esp. for classification) 
• Applications 
– Text classification 
– Information extraction 
– Machine translation 
– Semantic Interpretation 
– Sentiment Analysis 
– QA / Summarization 
– Information retrieval
Next Assignment 
• Due before next class Tue Sep 1 
– No turn-in 
• Download and install Python and NLTK 
• Download the NLTK Book Collection, as 
described at the beginning of chapter 1 of the 
book Natural Language Processing with Python 
• Readings: 
– Chapter 1 of the book Natural Language 
Processing with Python 
– Chapter 3 of Foundations of Statistical NLP 
• Next class: 
– Linguistic Essentials 
– Python Introduction

More Related Content

PDF
ChatGPT and the Future of Work - Clark Boyd
PDF
Machine Learning with PyCaret
PDF
Design Thinking vs. Lean Startup: Friends or Foes?
PDF
ChatGPT_Cheatsheet_Costa.pdf
PDF
Large Language Models Bootcamp
PPTX
Blueprint ChatGPT Lunch & Learn
PDF
Inspired Storytelling: Engaging People & Moving Them To Action
PDF
The Minimum Loveable Product
ChatGPT and the Future of Work - Clark Boyd
Machine Learning with PyCaret
Design Thinking vs. Lean Startup: Friends or Foes?
ChatGPT_Cheatsheet_Costa.pdf
Large Language Models Bootcamp
Blueprint ChatGPT Lunch & Learn
Inspired Storytelling: Engaging People & Moving Them To Action
The Minimum Loveable Product

What's hot (20)

PDF
Trends In Paid Search: Navigating The Digital Landscape In 2024
PDF
Deep Learning for Natural Language Processing: Word Embeddings
PPTX
Beyond Agile with Team Topologies
PDF
Exploring the Lean Canvas
PDF
Productivity Facts Every Employee Should Know
PDF
Large Language Models - Chat AI.pdf
PDF
GPT and other Text Transformers: Black Swans and Stochastic Parrots
PDF
Random Life Hacks
PDF
Neural Language Generation Head to Toe
PDF
Natural Language Processing (NLP) & Text Mining Tutorial Using NLTK | NLP Tra...
PDF
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
PDF
11 Ways to be Seen as a Leader at Work (Even if it's not in Your Title)
PDF
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
PDF
[Product Camp 2020] - Product operations: o que é e como começar? - Marcela S...
PPTX
Learn Prompting with ChatGPT
PDF
People Don't Care About Your Brand
PPTX
Fine tuning large LMs
PDF
Analysis of KinectFusion
PDF
Chat GPT Prompt
Trends In Paid Search: Navigating The Digital Landscape In 2024
Deep Learning for Natural Language Processing: Word Embeddings
Beyond Agile with Team Topologies
Exploring the Lean Canvas
Productivity Facts Every Employee Should Know
Large Language Models - Chat AI.pdf
GPT and other Text Transformers: Black Swans and Stochastic Parrots
Random Life Hacks
Neural Language Generation Head to Toe
Natural Language Processing (NLP) & Text Mining Tutorial Using NLTK | NLP Tra...
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
11 Ways to be Seen as a Leader at Work (Even if it's not in Your Title)
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
[Product Camp 2020] - Product operations: o que é e como começar? - Marcela S...
Learn Prompting with ChatGPT
People Don't Care About Your Brand
Fine tuning large LMs
Analysis of KinectFusion
Chat GPT Prompt
Ad

Viewers also liked (13)

PDF
Intro to NLP. Lecture 2
PDF
Natural Language Processing Crash Course
PPTX
Jarrar: Introduction to Natural Language Processing
PDF
Introduction to Natural Language Processing
PDF
Natural language processing
PPT
Natural language processing
PPTX
PDF
Natural Language Processing: L01 introduction
PPTX
NLTK - Natural Language Processing in Python
PPTX
Natural language processing
PPT
Introduction to Natural Language Processing
PDF
Natural Language Processing
Intro to NLP. Lecture 2
Natural Language Processing Crash Course
Jarrar: Introduction to Natural Language Processing
Introduction to Natural Language Processing
Natural language processing
Natural language processing
Natural Language Processing: L01 introduction
NLTK - Natural Language Processing in Python
Natural language processing
Introduction to Natural Language Processing
Natural Language Processing
Ad

Similar to Introduction to nlp (20)

PPTX
Introduction to NLP.pptx
PPT
PPT
PPT
Intro 2 document
PDF
NOVA Data Science Meetup 1/19/2017 - Presentation 2
PPT
SLoSP-2007-1statisticalstatisticalstatistical.ppt
PPT
SLoSP-2007-1 natural language processing.ppt
PPT
1 Introduction.ppt
PPT
Experiences from Two Latin American PhD Students in Ireland
PPTX
Language as social sensor - Marko Grobelnik - Dubrovnik - HrTAL2016 - 30 Sep ...
PPT
Natural_Language_Processing_1.ppt
PDF
Nlp presentation
PPTX
Beyond document retrieval using semantic annotations
PPTX
Introduction to natural language processing (NLP)
PDF
Natural language processing (nlp)
PDF
Natural Language Processing, Techniques, Current Trends and Applications in I...
PPTX
Chapter #1 Introduction to NConfigure and administer Server LP.pptx
PDF
Natural language processing module 1 chapter 1
PPTX
nlp-01.pptxvvvffffffvvvvvfeddeeddffffffffff
PPTX
AI prompting skills to make teaching materials for deep learning.ETA ROC.work...
Introduction to NLP.pptx
Intro 2 document
NOVA Data Science Meetup 1/19/2017 - Presentation 2
SLoSP-2007-1statisticalstatisticalstatistical.ppt
SLoSP-2007-1 natural language processing.ppt
1 Introduction.ppt
Experiences from Two Latin American PhD Students in Ireland
Language as social sensor - Marko Grobelnik - Dubrovnik - HrTAL2016 - 30 Sep ...
Natural_Language_Processing_1.ppt
Nlp presentation
Beyond document retrieval using semantic annotations
Introduction to natural language processing (NLP)
Natural language processing (nlp)
Natural Language Processing, Techniques, Current Trends and Applications in I...
Chapter #1 Introduction to NConfigure and administer Server LP.pptx
Natural language processing module 1 chapter 1
nlp-01.pptxvvvffffffvvvvvfeddeeddffffffffff
AI prompting skills to make teaching materials for deep learning.ETA ROC.work...

Recently uploaded (20)

PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PPTX
web development for engineering and engineering
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PPTX
UNIT 4 Total Quality Management .pptx
PPTX
additive manufacturing of ss316l using mig welding
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PPTX
Lecture Notes Electrical Wiring System Components
PPTX
bas. eng. economics group 4 presentation 1.pptx
DOCX
573137875-Attendance-Management-System-original
PPT
Mechanical Engineering MATERIALS Selection
PPTX
Construction Project Organization Group 2.pptx
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PPTX
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PPTX
Internet of Things (IOT) - A guide to understanding
PPTX
Lesson 3_Tessellation.pptx finite Mathematics
PDF
Well-logging-methods_new................
PPTX
Welding lecture in detail for understanding
UNIT-1 - COAL BASED THERMAL POWER PLANTS
web development for engineering and engineering
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
CYBER-CRIMES AND SECURITY A guide to understanding
UNIT 4 Total Quality Management .pptx
additive manufacturing of ss316l using mig welding
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
Lecture Notes Electrical Wiring System Components
bas. eng. economics group 4 presentation 1.pptx
573137875-Attendance-Management-System-original
Mechanical Engineering MATERIALS Selection
Construction Project Organization Group 2.pptx
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
Internet of Things (IOT) - A guide to understanding
Lesson 3_Tessellation.pptx finite Mathematics
Well-logging-methods_new................
Welding lecture in detail for understanding

Introduction to nlp

  • 1. I256 Applied Natural Language Processing Fall 2009 Lecture 1 Introduction Barbara Rosario
  • 2. Introductions • Barbara Rosario – iSchool alumni (class 2005) – Intel Labs • Gopal Vaswani – iSchool master student (class 2010) • You?
  • 3. Today • Introductions • Administrivia • What is NLP • NLP Applications • Why is NLP difficult • Corpus-based statistical approaches • Course goals • What we’ll do in this course
  • 4. Administrivia • http://courses.ischool.berkeley.edu/i256/f09/index.html • Books: – Foundations of Statistical NLP, Manning and Schuetze, MIT press – Natural Language Processing with Python, Bird, Klein & Loper, O'Reilly. (also on line) – See Web site for additional resources • Work: – Individual coding assignments (Python & NLTK-Natural Language Toolkit) (4 or 5) – Final group project – Participation • Office hours: – Barbara: Thursday 2:00-3:00 in Room 6 – Gopal: Tuesday 2:00-3:00 in Room 6 (to be confirmed)
  • 5. Administrivia • Communication: – My email: barbara.rosario@intel.com – Gopal : gopal.vaswani@gmail.com – Mailing list: i256@ischool.berkeley.edu • Send an email to majordomo@ischool.berkeley.edu with subscribe i256 in the body • Through intranet – Announcements: webpage and/or mailing list and/or Bspace (TBA) – Public discussion: Bspace(?) • Related course: Statistical Natural Language Processing, Spring 2009, CS 288 – http://www.cs.berkeley.edu/~klein/cs288/sp09/ – Instructor: Dan Klein – Much more emphasis on statistical algorithms • Questions?
  • 6. Natural Language Processing • Fundamental goal: deep understand of broad language – Not just string processing or keyword matching! • End systems that we want to build: – Ambitious: speech recognition, machine translation, question answering… – Modest: spelling correction, text categorization… Slide taken from Klein’s course: UCB CS 288 spring 09
  • 8. NLP applications • Text Categorization – Classify documents by topics, language, author, spam filtering, information retrieval (relevant, not relevant), sentiment classification (positive, negative) • Spelling & Grammar Corrections • Information Extraction • Speech Recognition • Information Retrieval – Synonym Generation • Summarization • Machine Translation • Question Answering • Dialog Systems – Language generation
  • 9. Why NLP is difficult • A NLP system needs to answer the question “who did what to whom” • Language is ambiguous – At all levels: lexical, phrase, semantic – Iraqi Head Seeks Arms • Word sense is ambiguous (head, arms) – Stolen Painting Found by Tree • Thematic role is ambiguous: tree is agent or location? – Ban on Nude Dancing on Governor’s Desk • Syntactic structure (attachment) is ambiguous: is the ban or the dancing on the desk? – Hospitals Are Sued by 7 Foot Doctors • Semantics is ambiguous : what is 7 foot?
  • 10. Why NLP is difficult • Language is flexible – New words, new meanings – Different meanings in different contexts • Language is subtle – He arrived at the lecture – He chuckled at the lecture – He chuckled his way through the lecture – **He arrived his way through the lecture • Language is complex!
  • 11. Why NLP is difficult • MANY hidden variables – Knowledge about the world – Knowledge about the context – Knowledge about human communication techniques • Can you tell me the time? • Problem of scale – Many (infinite?) possible words, meanings, context • Problem of sparsity – Very difficult to do statistical analysis, most things (words, concepts) are never seen before • Long range correlations
  • 12. Why NLP is difficult • Key problems: – Representation of meaning – Language presupposes knowledge about the world – Language only reflects the surface of meaning – Language presupposes communication between people
  • 13. Meaning • What is meaning? – Physical referent in the real world – Semantic concepts, characterized also by relations. • How do we represent and use meaning – I am Italian • From lexical database (WordNet) • Italian =a native or inhabitant of Italy Italy = republic in southern Europe [..] – I am Italian • Who is “I”? – I know she is Italian/I think she is Italian • How do we represent “I know” and “I think” • Does this mean that I is Italian? What does it say about the “I” and about the person speaking? – I thought she was Italian • How do we represent tenses?
  • 14. Today • Introductions • Administrivia • What is NLP • NLP Applications • Why is NLP difficult • Corpus-based statistical approaches • Course goals • What we’ll do in this course
  • 15. Corpus-based statistical approaches to tackle NLP problem – How can a can a machine understand these differences? • Decorate the cake with the frosting • Decorate the cake with the kids – Rules based approaches, i.e. hand coded syntactic constraints and preference rules: • The verb decorate require an animate being as agent • The object cake is formed by any of the following, inanimate entities (cream, dough, frosting…..) – Such approaches have been showed to be time consuming to build, do not scale up well and are very brittle to new, unusual, metaphorical use of language • To swallow requires an animate being as agent/subject and a physical object as object – I swallowed his story – The supernova swallowed the planet
  • 16. Corpus-based statistical approaches to tackle NLP problem • A Statistical NLP approach seeks to solve these problems by automatically learning lexical and structural preferences from text collections (corpora) • Statistical models are robust, generalize well and behave gracefully in the presence of errors and new data. • So: – Get large text collections – Compute statistics over those collections – (The bigger the collections, the better the statistics)
  • 17. Corpus-based statistical approaches to tackle NLP problem • Decorate the cake with the frosting • Decorate the cake with the kids • From (labeled) corpora we can learn that: #(kids are subject/agent of decorate) > #(frosting is subject/agent of decorate) • From (UN-labeled) corpora we can learn that: #(“the kids decorate the cake”) >> #(“the frosting decorates the cake”) #(“cake with frosting”) >> #(“cake with kids”) etc.. • Given these “facts” we then need a statistical model for the attachment decision
  • 18. Corpus-based statistical approaches to tackle NLP problem • Topic categorization: classify the document into semantics topics Document 1 The U.S. swept into the Davis Cup final on Saturday when twins Bob and Mike Bryan defeated Belarus's Max Mirnyi and Vladimir Voltchkov to give the Americans an unsurmountable 3-0 lead in the best-of-five semi-final tie. Topic = sport Document 2 One of the strangest, most relentless hurricane seasons on record reached new bizarre heights yesterday as the plodding approach of Hurricane Jeanne prompted evacuation orders for hundreds of thousands of Floridians and high wind warnings that stretched 350 miles from the swamp towns south of Miami to the historic city of St. Augustine. Topic = disaster
  • 19. Corpus-based statistical approaches to tackle NLP problem • Topic categorization: classify the document into semantics topics Document 1 (sport) The U.S. swept into the Davis Cup final on Saturday when twins Bob and Mike Bryan … Document 2 (disasters) One of the strangest, most relentless hurricane seasons on record reached new bizarre heights yesterday as…. • From (labeled) corpora we can learn that: #(sport documents containing word Cup) > #(disaster documents containing word Cup) -- feature • We then need a statistical model for the topic assignment
  • 20. Corpus-based statistical approaches to tackle NLP problem • Feature extractions (usually linguistics motivated) • Statistical models • Data (corpora, labels, linguistic resources)
  • 21. Goals of this Course • Learn about the problems and possibilities of natural language analysis: – What are the major issues? – What are the major solutions? • At the end you should: – Agree that language is difficult, interesting and important – Be able to assess language problems • Know which solutions to apply when, and how • Feel some ownership over the algorithms – Be able to use software to tackle some NLP language tasks – Know language resources – Be able to read papers in the field
  • 22. What We’ll Do in this Course • Linguistic Issues – What are the range of language phenomena? – What are the knowledge sources that let us disambiguate? – What representations are appropriate? • Applications • Software (Python and NLTK) • Statistical Modeling Methods
  • 23. What We’ll Do in this Course • Read books, research papers and tutorials • Final project – Your own ideas or chose from some suggestions I will provide – We’ll talk later during the couse about ideas/methods etc. but come talk to me if you have already some ideas • Learn Python • Learn/use NLTK (Natural Language ToolKit) to try out various algorithms
  • 24. Python - Simple yet powerful The zen of python : http://www.python.org/dev/peps/pep-0020/ • Very clear, readable syntax • Strong introspection capabilities – http://www.ibm.com/developerworks/linux/library/l-pyint.html (recommended) • Intuitive object orientation • Natural expression of procedural code • Full modularity, supporting hierarchical packages • Exception-based error handling • Very high level dynamic data types • Extensive standard libraries and third party modules for virtually every task – Excellent functionality for processing linguistic data. – NLTK is one such extensive third party module. Source : python.org Python
  • 25. Language processing task NLTK modules Functionality Accessing corpora nltk.corpus standardized interfaces to corpora and lexicons String processing nltk.tokenize, nltk.stem tokenizers, sentence tokenizers, stemmers Collocation discovery nltk.collocations t-test, chi-squared, point-wise mutual information Part-of-speech tagging nltk.tag n-gram, backoff, Brill, HMM, TnT Classification nltk.classify, nltk.cluster decision tree, maximum entropy, naive Bayes, EM, k-means Chunking nltk.chunk regular expression, n-gram, named-entity Parsing nltk.parse chart, feature-based, unification, probabilistic, dependency Source : nltk.org This is not the complete list NLTK • NLTK defines an infrastructure that can be used to build NLP programs in Python. • It provides basic classes for representing data relevant to natural language processing. • Standard interfaces for performing tasks such as part-of-speech tagging, syntactic parsing, and text classification. • Standard implementations for each task which can be combined to solve complex problems. Resources: • Download at http://www.nltk.org/download • Getting started with NLTK Chapter 1 • NLP and NLTK talk at google http://www.youtube.com/watch?v=keXW_5-llD0
  • 26. Topics • Text corpora & other resources • Words (Morphology, tokenization, stemming, part-of-speech, WSD, collocations, lexical acquisition, language models) • Syntax: chunking, PCFG & parsing • Statistical models (esp. for classification) • Applications – Text classification – Information extraction – Machine translation – Semantic Interpretation – Sentiment Analysis – QA / Summarization – Information retrieval
  • 27. Next Assignment • Due before next class Tue Sep 1 – No turn-in • Download and install Python and NLTK • Download the NLTK Book Collection, as described at the beginning of chapter 1 of the book Natural Language Processing with Python • Readings: – Chapter 1 of the book Natural Language Processing with Python – Chapter 3 of Foundations of Statistical NLP • Next class: – Linguistic Essentials – Python Introduction