SlideShare a Scribd company logo
1 of 27
Download to read offline
Open Source
  Natural Language Processing
                  Francis Bond
       <www3.ntu.edu.sg/home/fcbond/>
Division of Linguistics and Multilingual Studies
          Nanyang Technological University

               <bond@ieee.org>



               2009-08-21 (GeekCamp)
Self Introduction

¢   BA in Japanese and Mathematics
¢   BEng in Power and Control
¢   PhD in “Machine Translation”
¢   1991-2006 NTT (Nippon Telegraph and Telephone)
 ­ Japanese - English/Malay Machine Translation
 ­ Japanese corpus, grammar and ontology (Hinoki)
¢ 2006-2009 NICT (National Inst. for Info. and Comm.
  Technology)
  ­ Japanese - English, Chinese Machine Translation
  ­ Japanese WordNet               (Released in March 2009)

2009-08-21 (GeekCamp)                                     1
Overview

¢ What is NLP (and Why do it)?

¢ Machine Translation Examples

¢ Why Open Source?

¢ Wrap Up

¢ State of the Art




2009-08-21 (GeekCamp)              2
The basic problem

                             We get words

                        People saw her duck.

                         We want meaning




2009-08-21 (GeekCamp)                          3
People saw her duck1




                    http://www.animaltalk.us/for/Animals/
              fw-cute-picture-of-your-daughter-with-duck/

2009-08-21 (GeekCamp)                                   4
People saw her duck2




                          http://www.nataliedee.com/012109/
                                 ducking-incoming-balls.jpg



2009-08-21 (GeekCamp)                                     5
People saw her duck3




                                        OpenClipArtLibrary




2009-08-21 (GeekCamp)                                    6
Syntax

         (1)                                   (2)                                 (3)
          S                                      S                                 S


 NP               VP                   NP                    VP            NP              VP

  N                                     N                                   N
              V          NP                            V           VP                  V          NP
  N                                     N                                   N
          V:see    DET         N                V          NP      V               V:saw    DET         N
  N                                     N                                   N
          saw      her         N               V:see       N       V               saw      her         N
People                                People                              People
                               N                saw        her     V                                    N

                              duck.                               duck.                                duck.




  2009-08-21 (GeekCamp)                                                                            7
Structural Semantics

     Who did what to whom, how, where, when and why?

    (1)      see(people, ducki: past) poss(ducki, pron:[3rd, sg,
             fem]: past)
    (2)      see(people, duckj ) duckj (pron:[3rd, sg, fem])
    (3)      saw(people, ducki) poss(ducki, pron:[3rd, sg, fem])




2009-08-21 (GeekCamp)                                          8
Lexical Semantics

     What are people? What’s a duck? What does sawing entail?

    (4)      people ⊂ entity
    (5)      see ⊂ perceive
    (6)      saw ⊂ cut
    (7)      ducki ⊂ bird
    (8)      duckj ⊂ move




2009-08-21 (GeekCamp)                                       9
Pragmatics

     The study of meaning in context.

¢ Which people?

¢ What duck?

¢ Why did you say that?

¢ What does it imply?




2009-08-21 (GeekCamp)                   10
The problem restated

¢ How can we model and resolve ambiguity?

¢ Two main approaches
  ­ Deduce implicit models
    ∗ bag of words, n-gram chunks, . . .
  ­ Define explicit models
    ∗ Grammars, lexicons and thesauri

¢ Then build a statistical language model (machine learning)



2009-08-21 (GeekCamp)                                          11
Not just algorithms

¢ The data is as important as the algorithm

¢ Two areas of development
  ­ Open (?) Content
    ∗ The Web!, Text Corpora, WordNet,        Wikipedia,
      dictionaries, . . .
  ­ Open Software
    ∗ NLTK (python), Gate, DELPH-IN, . . .

¢ Copyright issues are always with us (;_;)


2009-08-21 (GeekCamp)                                 12
Some Examples

¢ Speech Recognition
¢ Text-to-speech
¢ Segmentation: split strings into words
¢ Part-of-Speech (nouns or verbs)
¢ Named Entity Recognition
¢ Syntactic Parsing: syntactic trees and dependencies
¢ Word Sense Disambiguation: lexical semantics
¢ Semantic Parsing: structural semantics

2009-08-21 (GeekCamp)                                   13
Two Examples of Open Source MT

¢ MOSES (http://www.statmt.org/moses/)
  ­ Open Source Statistical MT tool kit
                                  Just add bilingual corpus!

¢ LOGON (www.delph-in.net/)
  ­ Open Source Knowledge-based MT tool kit
                                  Just add transfer rules!




2009-08-21 (GeekCamp)                                     14
Statistical Machine Translation?

     Basic Idea (Brown et al 1990)


                                 ˆ
                                 E = argmax P (E|J )
                                         E




  Japanese                Translation Model     English   Language Model
     J                        P (J |E)            E           P (E)


                              Decoder             ˆ
       J                argmaxE P (E)P (J |E)
                                                  E



2009-08-21 (GeekCamp)                                                      15
Translation Model (IBM Model 4)
P (J, A|E)
       Fertility Model       could you recommend another hotel
   n(φi|Ei)
      NULL Generation Model could could recommend another another hotel
  m−φ0
   φ0
       p0 2φ0 pφ0
        m−
               1

      Lexicon Model          could could recommend NULL another another hotel NU
    t(Jj |EAj )

              Distortion Model ていただけ ます 紹介し を 他 の ホテル か
      d1(j − k|A(Ei)B(Jj ))
      d1>(j − j ′|B(Jj ))
                             他 の ホテル を 紹介し ていただけ ます か


Now with chunks (another hotel ↔ 他 の ホテル)!
2009-08-21 (GeekCamp)                                             16
Knowledge-based MT

 Source            Source             Semantic         Target     Target
  Text             Analysis   MRS S            MRS T Generation    Text
                   (JACY)             Transfer         (ERG)

                                Stochastic Model(s)


¢ From text to meaning and back again
  ­ Grammars for Japanese and English
  ­ Stochastic models to choose interpretations
  ­ Brittle but powerful



2009-08-21 (GeekCamp)                                                 17
Some Examples
  Source          私はいやいやその仕事をした 。
  Ref             I did the work against my will.
  Moses           I did the work against his will.
  JaEn            I did that work unwillingly.
  Source          バイオリンの音色はとても美しい。
  Ref             The sound of the violin is very sweet.
  Moses           The violin 音色 is very beautiful .
  JaEn            Really, the violin timbers are beautiful.
  Source          メイドはテーブルにナイフとフォークを並べた。
  Ref             The maid arranged the knives and forks on the table.
  Moses           The maid on the table arranged the knives and forks.
  JaEn            The maid set up the fork with the knife in the table.
2009-08-21 (GeekCamp)                                               18
Source          その銀行はここから遠いですか。
  Ref             Is there bank far from here?
  Moses           The bank is a long way from here?
  JaEn            Is that bank distant from here?
  Source          シェークスピアに匹敵する劇作家はいない。
  Ref             No dramatist can compare with Shakespeare.
  Moses           Shakespeare is quite equal to a dramatist.      (no no)
  JaEn            A playwright, that matches in Shie-kusupia, doesn’t live.
  Source          彼はなぜそんなことをしたのか。
  Ref             Why did he do that?
  Moses           Why did he did such a thing?
  JaEn            Why did he do that business?
2009-08-21 (GeekCamp)                                                19
Why Open?

¢ NLP needs serious resources
  ­ They cannot be built and maintained by a single group
  ­ Open source is a very practical way of achieving flexible
    multi-group collaboration

¢ NLP needs standards and historically the successful ones
  have been created bottom-up.

¢ Seeing one’s work used by other groups is very rewarding.

¢ People are generally enthusiastic about contributing to widely
  used work.
Not just the warm inner glow                                  20
¢ Making resources open source removes difficulties in
  distributing work or in continuing work at another institution.

¢ Researchers are evaluated by the impact that their work has:
  Open Source work generally has more impact.

¢ Research should be open in principle:
        . . . the principle of openness in research - the principle
        of freedom of access by all interested persons to the
        underlying data, to the processes, and to the final
        results of research - is one of overriding importance.
        Openness in Research (Stanford, Research Policy Handbook 2.6)


Not just the warm inner glow                                            21
NLP by regexp

      Bilingual Dictionaries from mainly monolingual text!

¢ Fully Bracketed Examples
   ­ 「収穫逓減の法則(the law of diminishing return)」

¢ Partly Bracketed Examples
   ­ 図1に,明瞭性 (Clarity)・新奇性 (Novelty)

¢ Over a million pairs from the Japanese Web corpus
   ­ Not yet released                           (copyright again)

It’s fun                                                       22
The ultimate goal
¢ NLP is fairly wide in scope

¢   We want to know everything about everything and
    how it fits together
  ­ The best source of knowledge we have is still text
  ­ Replace human bandwidth with machine bandwidth
  ­ Process, refine, reprocess

¢ Need both technical and social approaches
  ­ Linguistic Analysis
  ­ Machine Learning
  ­ User Generated Content

Mad Scientists of the World Unite                        23
Closing

¢ There are many great open source NLP tools
   ­ the bleeding edge is mainly open source

 If you want to know more

Or even better want to play with them

Or best of all develop them

⇒ Say hello:                            (especially PhD candidates)

                            bond@ieee.org

 And now, the end is near                                        24
Another Example of the Problem

    (9)       Everyone gets a little of Cucumber’s ♥.

¢ Lexical gaps: Cucumber (name)

¢ Lexical gaps: ♥ (noun – we have it as verb: I ♥ NY)

¢ How to model ambiguity
  ­ Cucumber is deliberately ambiguous here
    ∗ research show rude jokes are funnier
    ∗ can we model this?


Topical Example                                         25
Solutions

¢ Morphological analysis should guess the POS
  ­ Based on two to three words of previous context
    and a large learned lexicon and model
  ­ This allows us to parse
  ­ Actually there are issues with ♥ (words are [a-z -]+)

¢ Recognizing “Cucumber” as software
  Cucumber is a tool that can execute . . .

¢ Linking ♥ to love: ♥n → ♥v (v2n derivational rule)

¢ Scaling is the problem

Feel free to use these slides or extracts from them for any purpose at all, Francis Bond 2009-08-22.   26

More Related Content

Similar to NLP Introduction: Open Source Natural Language Processing

Time Machine session @ ICME 2012 - DTW's New Youth
Time Machine session @ ICME 2012 - DTW's New YouthTime Machine session @ ICME 2012 - DTW's New Youth
Time Machine session @ ICME 2012 - DTW's New YouthXavier Anguera
 
"Automatic speech recognition for mobile applications in Yandex" — Fran Campi...
"Automatic speech recognition for mobile applications in Yandex" — Fran Campi..."Automatic speech recognition for mobile applications in Yandex" — Fran Campi...
"Automatic speech recognition for mobile applications in Yandex" — Fran Campi...Yandex
 
The Rise of Dynamic Languages
The Rise of Dynamic LanguagesThe Rise of Dynamic Languages
The Rise of Dynamic Languagesgreenwop
 
Fanizzi Ilp2008 Kernel
Fanizzi Ilp2008 KernelFanizzi Ilp2008 Kernel
Fanizzi Ilp2008 Kernelfanizzi
 
Music recommendations @ MLConf 2014
Music recommendations @ MLConf 2014Music recommendations @ MLConf 2014
Music recommendations @ MLConf 2014Erik Bernhardsson
 
Introduction of tango! (en)
Introduction of tango! (en)Introduction of tango! (en)
Introduction of tango! (en)Yohei Yasukawa
 
Grid: New Business Opportunities?
Grid: New Business Opportunities?Grid: New Business Opportunities?
Grid: New Business Opportunities?Cybera Inc.
 
Quines—Programming your way back to where you were
Quines—Programming your way back to where you wereQuines—Programming your way back to where you were
Quines—Programming your way back to where you wereJean-Baptiste Mazon
 
ICDM 2019 Tutorial: Speech and Language Processing: New Tools and Applications
ICDM 2019 Tutorial: Speech and Language Processing: New Tools and ApplicationsICDM 2019 Tutorial: Speech and Language Processing: New Tools and Applications
ICDM 2019 Tutorial: Speech and Language Processing: New Tools and ApplicationsForward Gradient
 
Tree-based Translation Models (『機械翻訳』§6.2-6.3)
Tree-based Translation Models (『機械翻訳』§6.2-6.3)Tree-based Translation Models (『機械翻訳』§6.2-6.3)
Tree-based Translation Models (『機械翻訳』§6.2-6.3)Yusuke Oda
 
Compiler Components and their Generators - Traditional Parsing Algorithms
Compiler Components and their Generators - Traditional Parsing AlgorithmsCompiler Components and their Generators - Traditional Parsing Algorithms
Compiler Components and their Generators - Traditional Parsing AlgorithmsGuido Wachsmuth
 
Lecture14 xing fei-fei
Lecture14 xing fei-feiLecture14 xing fei-fei
Lecture14 xing fei-feiTianlu Wang
 
Variational autoencoders for speech processing d.bielievtsov dataconf 21 04 18
Variational autoencoders for speech processing d.bielievtsov dataconf 21 04 18Variational autoencoders for speech processing d.bielievtsov dataconf 21 04 18
Variational autoencoders for speech processing d.bielievtsov dataconf 21 04 18Olga Zinkevych
 

Similar to NLP Introduction: Open Source Natural Language Processing (20)

The NERD project
The NERD projectThe NERD project
The NERD project
 
Time Machine session @ ICME 2012 - DTW's New Youth
Time Machine session @ ICME 2012 - DTW's New YouthTime Machine session @ ICME 2012 - DTW's New Youth
Time Machine session @ ICME 2012 - DTW's New Youth
 
"Automatic speech recognition for mobile applications in Yandex" — Fran Campi...
"Automatic speech recognition for mobile applications in Yandex" — Fran Campi..."Automatic speech recognition for mobile applications in Yandex" — Fran Campi...
"Automatic speech recognition for mobile applications in Yandex" — Fran Campi...
 
The Rise of Dynamic Languages
The Rise of Dynamic LanguagesThe Rise of Dynamic Languages
The Rise of Dynamic Languages
 
Fanizzi Ilp2008 Kernel
Fanizzi Ilp2008 KernelFanizzi Ilp2008 Kernel
Fanizzi Ilp2008 Kernel
 
Music recommendations @ MLConf 2014
Music recommendations @ MLConf 2014Music recommendations @ MLConf 2014
Music recommendations @ MLConf 2014
 
Introduction of tango! (en)
Introduction of tango! (en)Introduction of tango! (en)
Introduction of tango! (en)
 
Grid: New Business Opportunities?
Grid: New Business Opportunities?Grid: New Business Opportunities?
Grid: New Business Opportunities?
 
DL for molecules
DL for moleculesDL for molecules
DL for molecules
 
Integrated Learning
Integrated LearningIntegrated Learning
Integrated Learning
 
Quines—Programming your way back to where you were
Quines—Programming your way back to where you wereQuines—Programming your way back to where you were
Quines—Programming your way back to where you were
 
ICDM 2019 Tutorial: Speech and Language Processing: New Tools and Applications
ICDM 2019 Tutorial: Speech and Language Processing: New Tools and ApplicationsICDM 2019 Tutorial: Speech and Language Processing: New Tools and Applications
ICDM 2019 Tutorial: Speech and Language Processing: New Tools and Applications
 
Tree-based Translation Models (『機械翻訳』§6.2-6.3)
Tree-based Translation Models (『機械翻訳』§6.2-6.3)Tree-based Translation Models (『機械翻訳』§6.2-6.3)
Tree-based Translation Models (『機械翻訳』§6.2-6.3)
 
The NLP Muppets revolution!
The NLP Muppets revolution!The NLP Muppets revolution!
The NLP Muppets revolution!
 
Compiler Components and their Generators - Traditional Parsing Algorithms
Compiler Components and their Generators - Traditional Parsing AlgorithmsCompiler Components and their Generators - Traditional Parsing Algorithms
Compiler Components and their Generators - Traditional Parsing Algorithms
 
Jvm Language Summit Rose 20081016
Jvm Language Summit Rose 20081016Jvm Language Summit Rose 20081016
Jvm Language Summit Rose 20081016
 
Lecture14 xing fei-fei
Lecture14 xing fei-feiLecture14 xing fei-fei
Lecture14 xing fei-fei
 
Context Mapping In Action
Context Mapping In ActionContext Mapping In Action
Context Mapping In Action
 
Variational autoencoders for speech processing d.bielievtsov dataconf 21 04 18
Variational autoencoders for speech processing d.bielievtsov dataconf 21 04 18Variational autoencoders for speech processing d.bielievtsov dataconf 21 04 18
Variational autoencoders for speech processing d.bielievtsov dataconf 21 04 18
 
SEASR Text
SEASR TextSEASR Text
SEASR Text
 

Recently uploaded

Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 

Recently uploaded (20)

Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 

NLP Introduction: Open Source Natural Language Processing

  • 1. Open Source Natural Language Processing Francis Bond <www3.ntu.edu.sg/home/fcbond/> Division of Linguistics and Multilingual Studies Nanyang Technological University <bond@ieee.org> 2009-08-21 (GeekCamp)
  • 2. Self Introduction ¢ BA in Japanese and Mathematics ¢ BEng in Power and Control ¢ PhD in “Machine Translation” ¢ 1991-2006 NTT (Nippon Telegraph and Telephone) ­ Japanese - English/Malay Machine Translation ­ Japanese corpus, grammar and ontology (Hinoki) ¢ 2006-2009 NICT (National Inst. for Info. and Comm. Technology) ­ Japanese - English, Chinese Machine Translation ­ Japanese WordNet (Released in March 2009) 2009-08-21 (GeekCamp) 1
  • 3. Overview ¢ What is NLP (and Why do it)? ¢ Machine Translation Examples ¢ Why Open Source? ¢ Wrap Up ¢ State of the Art 2009-08-21 (GeekCamp) 2
  • 4. The basic problem We get words People saw her duck. We want meaning 2009-08-21 (GeekCamp) 3
  • 5. People saw her duck1 http://www.animaltalk.us/for/Animals/ fw-cute-picture-of-your-daughter-with-duck/ 2009-08-21 (GeekCamp) 4
  • 6. People saw her duck2 http://www.nataliedee.com/012109/ ducking-incoming-balls.jpg 2009-08-21 (GeekCamp) 5
  • 7. People saw her duck3 OpenClipArtLibrary 2009-08-21 (GeekCamp) 6
  • 8. Syntax (1) (2) (3) S S S NP VP NP VP NP VP N N N V NP V VP V NP N N N V:see DET N V NP V V:saw DET N N N N saw her N V:see N V saw her N People People People N saw her V N duck. duck. duck. 2009-08-21 (GeekCamp) 7
  • 9. Structural Semantics Who did what to whom, how, where, when and why? (1) see(people, ducki: past) poss(ducki, pron:[3rd, sg, fem]: past) (2) see(people, duckj ) duckj (pron:[3rd, sg, fem]) (3) saw(people, ducki) poss(ducki, pron:[3rd, sg, fem]) 2009-08-21 (GeekCamp) 8
  • 10. Lexical Semantics What are people? What’s a duck? What does sawing entail? (4) people ⊂ entity (5) see ⊂ perceive (6) saw ⊂ cut (7) ducki ⊂ bird (8) duckj ⊂ move 2009-08-21 (GeekCamp) 9
  • 11. Pragmatics The study of meaning in context. ¢ Which people? ¢ What duck? ¢ Why did you say that? ¢ What does it imply? 2009-08-21 (GeekCamp) 10
  • 12. The problem restated ¢ How can we model and resolve ambiguity? ¢ Two main approaches ­ Deduce implicit models ∗ bag of words, n-gram chunks, . . . ­ Define explicit models ∗ Grammars, lexicons and thesauri ¢ Then build a statistical language model (machine learning) 2009-08-21 (GeekCamp) 11
  • 13. Not just algorithms ¢ The data is as important as the algorithm ¢ Two areas of development ­ Open (?) Content ∗ The Web!, Text Corpora, WordNet, Wikipedia, dictionaries, . . . ­ Open Software ∗ NLTK (python), Gate, DELPH-IN, . . . ¢ Copyright issues are always with us (;_;) 2009-08-21 (GeekCamp) 12
  • 14. Some Examples ¢ Speech Recognition ¢ Text-to-speech ¢ Segmentation: split strings into words ¢ Part-of-Speech (nouns or verbs) ¢ Named Entity Recognition ¢ Syntactic Parsing: syntactic trees and dependencies ¢ Word Sense Disambiguation: lexical semantics ¢ Semantic Parsing: structural semantics 2009-08-21 (GeekCamp) 13
  • 15. Two Examples of Open Source MT ¢ MOSES (http://www.statmt.org/moses/) ­ Open Source Statistical MT tool kit Just add bilingual corpus! ¢ LOGON (www.delph-in.net/) ­ Open Source Knowledge-based MT tool kit Just add transfer rules! 2009-08-21 (GeekCamp) 14
  • 16. Statistical Machine Translation? Basic Idea (Brown et al 1990) ˆ E = argmax P (E|J ) E Japanese Translation Model English Language Model J P (J |E) E P (E) Decoder ˆ J argmaxE P (E)P (J |E) E 2009-08-21 (GeekCamp) 15
  • 17. Translation Model (IBM Model 4) P (J, A|E) Fertility Model could you recommend another hotel n(φi|Ei) NULL Generation Model could could recommend another another hotel m−φ0 φ0 p0 2φ0 pφ0 m− 1 Lexicon Model could could recommend NULL another another hotel NU t(Jj |EAj ) Distortion Model ていただけ ます 紹介し を 他 の ホテル か d1(j − k|A(Ei)B(Jj )) d1>(j − j ′|B(Jj )) 他 の ホテル を 紹介し ていただけ ます か Now with chunks (another hotel ↔ 他 の ホテル)! 2009-08-21 (GeekCamp) 16
  • 18. Knowledge-based MT Source Source Semantic Target Target Text Analysis MRS S MRS T Generation Text (JACY) Transfer (ERG) Stochastic Model(s) ¢ From text to meaning and back again ­ Grammars for Japanese and English ­ Stochastic models to choose interpretations ­ Brittle but powerful 2009-08-21 (GeekCamp) 17
  • 19. Some Examples Source 私はいやいやその仕事をした 。 Ref I did the work against my will. Moses I did the work against his will. JaEn I did that work unwillingly. Source バイオリンの音色はとても美しい。 Ref The sound of the violin is very sweet. Moses The violin 音色 is very beautiful . JaEn Really, the violin timbers are beautiful. Source メイドはテーブルにナイフとフォークを並べた。 Ref The maid arranged the knives and forks on the table. Moses The maid on the table arranged the knives and forks. JaEn The maid set up the fork with the knife in the table. 2009-08-21 (GeekCamp) 18
  • 20. Source その銀行はここから遠いですか。 Ref Is there bank far from here? Moses The bank is a long way from here? JaEn Is that bank distant from here? Source シェークスピアに匹敵する劇作家はいない。 Ref No dramatist can compare with Shakespeare. Moses Shakespeare is quite equal to a dramatist. (no no) JaEn A playwright, that matches in Shie-kusupia, doesn’t live. Source 彼はなぜそんなことをしたのか。 Ref Why did he do that? Moses Why did he did such a thing? JaEn Why did he do that business? 2009-08-21 (GeekCamp) 19
  • 21. Why Open? ¢ NLP needs serious resources ­ They cannot be built and maintained by a single group ­ Open source is a very practical way of achieving flexible multi-group collaboration ¢ NLP needs standards and historically the successful ones have been created bottom-up. ¢ Seeing one’s work used by other groups is very rewarding. ¢ People are generally enthusiastic about contributing to widely used work. Not just the warm inner glow 20
  • 22. ¢ Making resources open source removes difficulties in distributing work or in continuing work at another institution. ¢ Researchers are evaluated by the impact that their work has: Open Source work generally has more impact. ¢ Research should be open in principle: . . . the principle of openness in research - the principle of freedom of access by all interested persons to the underlying data, to the processes, and to the final results of research - is one of overriding importance. Openness in Research (Stanford, Research Policy Handbook 2.6) Not just the warm inner glow 21
  • 23. NLP by regexp Bilingual Dictionaries from mainly monolingual text! ¢ Fully Bracketed Examples ­ 「収穫逓減の法則(the law of diminishing return)」 ¢ Partly Bracketed Examples ­ 図1に,明瞭性 (Clarity)・新奇性 (Novelty) ¢ Over a million pairs from the Japanese Web corpus ­ Not yet released (copyright again) It’s fun 22
  • 24. The ultimate goal ¢ NLP is fairly wide in scope ¢ We want to know everything about everything and how it fits together ­ The best source of knowledge we have is still text ­ Replace human bandwidth with machine bandwidth ­ Process, refine, reprocess ¢ Need both technical and social approaches ­ Linguistic Analysis ­ Machine Learning ­ User Generated Content Mad Scientists of the World Unite 23
  • 25. Closing ¢ There are many great open source NLP tools ­ the bleeding edge is mainly open source If you want to know more Or even better want to play with them Or best of all develop them ⇒ Say hello: (especially PhD candidates) bond@ieee.org And now, the end is near 24
  • 26. Another Example of the Problem (9) Everyone gets a little of Cucumber’s ♥. ¢ Lexical gaps: Cucumber (name) ¢ Lexical gaps: ♥ (noun – we have it as verb: I ♥ NY) ¢ How to model ambiguity ­ Cucumber is deliberately ambiguous here ∗ research show rude jokes are funnier ∗ can we model this? Topical Example 25
  • 27. Solutions ¢ Morphological analysis should guess the POS ­ Based on two to three words of previous context and a large learned lexicon and model ­ This allows us to parse ­ Actually there are issues with ♥ (words are [a-z -]+) ¢ Recognizing “Cucumber” as software Cucumber is a tool that can execute . . . ¢ Linking ♥ to love: ♥n → ♥v (v2n derivational rule) ¢ Scaling is the problem Feel free to use these slides or extracts from them for any purpose at all, Francis Bond 2009-08-22. 26