SlideShare a Scribd company logo
JEEVES - A NATURAL LANGUAGE
           PROCESSING APPLICATION FOR
                     ANDROID
                      Presented by,
                      Anshul Agarwal (IP108IS017)
                      Karan Harsh Wardhan(1PI08IS045)
                      Pavani Deepak Mehta(1PI08IS070)



Jan 2012 - May 2012                   Dept. of ISE      1
AGENDA
•    Project Overview
•    Relevance
•    Requirements
•    Introduction
•    Technologies Used
•    System Design



Jan 2012 - May 2012      Dept. of ISE   2
AGENDA
•    Software Development Strategy
•    Implementation
•    Difficulties
•    Screenshots
•    Conclusion
•    Future Enhancements
•    References

Jan 2012 - May 2012    Dept. of ISE   3
PROJECT OVERVIEW
• Goal of the Project:
      – To design a Natural Language Processing (NLP)
        Interface Application for Android Platform
• Scope of the Project
      – Input from user using Voice Recognition
      – Application should process input and recognize user
        commands spoken in natural English
      – Basic features should be to make calls and send
        messages to contacts
      – Advanced features such as showing weather, Google
        search and launching apps

Jan 2012 - May 2012          Dept. of ISE                     4
RELEVANCE
• Allows for more intuitive human-computer
  interaction
• More convenient if computer can automate
  tasks usually performed by humans
• Goal is to reduce keypad usage as much as
  possible, and allow user to speak naturally
• Can help the disabled to easily use phones
• Acts as a virtual assistant, enhancing
  productivity
Jan 2012 - May 2012      Dept. of ISE           5
REQUIREMENTS




Jan 2012 - May 2012       Dept. of ISE   6
INTRODUCTION
• NLP is a field of computer science and
  linguistics concerned with the interactions
  between computers and human languages
• Aim is to design software that will analyze,
  understand, and generate languages that
  humans use naturally
• Eventually user will be able to address the
  computer as they talk to another person

Jan 2012 - May 2012       Dept. of ISE           7
TECHNOLOGIES USED - ANDROID
WHY ANDROID?
• Android is an open-source linux-based
  operating system for mobile devices
• Requires developer license only to publish,
  not develop
• Google voice recognition inbuilt in most
  Android devices
• Layered architecture facilitates rapid
  development of applications
Jan 2012 - May 2012   Dept. of ISE              8
TECHNOLOGIES USED - ANDROID
• ANDROID SYSTEM ARCHITECTURE




Jan 2012 - May 2012   Dept. of ISE   9
TECHNOLOGIES USED - ANDROID
INTENTS
• Messaging facility for late run-time binding
  between components
• Intent object is a passive data structure
  holding description of operation to be
  performed
• Three core components of an application —
  activities, services, and broadcast receivers —
  are activated through intents
Jan 2012 - May 2012   Dept. of ISE                  10
TECHNOLOGIES USED - ANDROID
INTENTS
• Two types - Implicit And Explicit
• Intent filters are implemented help with intent
  resolution
• Used to turn apps into high-level libraries and
  make code modular and reusable
  Intent intent = new Intent (App Package name);
   startActivity(intent);
• Various additional info can be added
  intent.putExtra(“title”,”Hello codeandroid”);

Jan 2012 - May 2012    Dept. of ISE                 11
TECHNOLOGIES USED – HTTP POST
• POST request is used to send data to server
• The string detected by voice recognizer is
  passed to server using this method
• Accomplished using in-built HttpCore API i.e
  org.apache.http package
• The server performs processing and returns a
  JSON response


Jan 2012 - May 2012   Dept. of ISE               12
TECHNOLOGIES USED - JSON
• JavaScript Object Notation (JSON) is a
  lightweight data-interchange format
• Based on a subset of the JavaScript
  Programming Language
• Is completely language independent
• In java, org.json.JSONObject is used to parse
  these strings
  JSONObject responseJSON = new JSONObject(responseString);
  String workId = responseJSON.getString("id");

Jan 2012 - May 2012        Dept. of ISE                   13
TECHNOLOGIES USED - JSON
• Example:
{"menu": {
 "id": "file",
"value": "File",
"popup": {
"menuitem": [
{"value": "New", "onclick": "CreateNewDoc()"},
{"value": "Open", "onclick": "OpenDoc()"},
{"value": "Close", "onclick": "CloseDoc()"} ] } }}

Jan 2012 - May 2012    Dept. of ISE                  14
TECHNOLOGIES USED –
                       VOICE RECOGNITION
WHY GOOGLE VOICE RECOGNITION?
• Focus of project was not automatic speech recognition
• Pre-installed on most android phones, easy to access
• Requires no special permission/payment to be used
• Developed, optimized and maintained by Google since
  2007
• Occurs off-site i.e. on Google’s servers so no “weighty”
  voice recognition s/w needs to be installed on phone
• Only need “android.speech.RecognizerIntent” package


Jan 2012 - May 2012           Dept. of ISE               15
TECHNOLOGIES USED –
                       VOICE RECOGNITION
HOW DOES RECOGNITION WORK?
• Google uses artificial intelligence algorithms to
  recognize spoken sentences
• Stores voice data anonymously for analysis
  purposes
• Cross matches spoken data with written queries
  on server
• Key problems of computational power, data
  availability and managing large amounts of
  information are handled with ease

Jan 2012 - May 2012           Dept. of ISE            16
TECHNOLOGIES USED - NLTK
NATURAL LANGUAGE TOOLKIT
• Open-source suite of libraries for NLP for the
  Python language
• Includes graphical demonstrations and sample
  data
• Provides NLP API’s, such as for importing a
  corpus, loading grammar from a file, etc.


Jan 2012 - May 2012   Dept. of ISE             17
SYSTEM DESIGN
• DFD Level 0




Jan 2012 - May 2012        Dept. of ISE   18
SYSTEM DESIGN
• DFD Level 1




Jan 2012 - May 2012        Dept. of ISE   19
SYSTEM DESIGN
• DFD Level 2




Jan 2012 - May 2012        Dept. of ISE   20
SOFTWARE DEVELOPMENT STRATEGY
• Software Development Strategy used is
  Extreme Programming
• It is a type of agile software development
• Advocates frequent releases in multiple short
  development cycles rather than one long cycle
• Involves programming in groups and doing
  extensive code review
• Works best with smaller groups
Jan 2012 - May 2012   Dept. of ISE            21
SOFTWARE DEVELOPMENT STRATEGY




Jan 2012 - May 2012   Dept. of ISE   22
IMPLEMENTATION
WHAT WE HAVE IMPLEMENTED
• Corpus – modification of Brown
• Tokenizer
• Part-of-Speech tagger
• Grammar
• Syntactic and Semantic Analysis
• Client application on Android
      – Takes voice input from user, converts to text, passes
        text to NLP server, receives id from server and
        launches corresponding intent

Jan 2012 - May 2012           Dept. of ISE                      23
IMPLEMENTATION
• Client application starts up and prompts user
  to input using Google Voice Recognition
• Input data is sent to Google servers for
  processing and text is returned to client
• Input text is now passed to the NLP server for
  processing using HTTP POST
• Server performs Natural Language Processing


Jan 2012 - May 2012        Dept. of ISE            24
IMPLEMENTATION
• Steps involved in NLP:
      – Lexical Analysis: converts sequence of characters into
        a sequence of tokens
      – Morphological Analysis: identification, analysis and
        description of the structure of a given
        language's linguistic units
      – Syntactic Analysis: analyzing text, made up of a
        sequence of tokens, to determine its grammatical
        structure
      – Semantic Analysis: relating syntactic structures from
        the levels of phrases and sentences to their language-
        independent meanings

Jan 2012 - May 2012           Dept. of ISE                   25
IMPLEMENTATION
• A corpus is a large and structured set of texts
• Used in part-of-speech tagging to tag words as
  parts of a sentence
• Tags stored along with the words in the corpus
• We have modified the Brown corpus to include
  more relevant phrases and commands
• Contains data from books, news articles, journals,
  etc.
• TaggedCorpusReader needed to import the
  corpus

Jan 2012 - May 2012        Dept. of ISE            26
IMPLEMENTATION
• During lexical analysis, the string is split up into
  various tokens, the separator being space
• Tokens, which are words in this case, are passed
  to a part-of-speech(POS) tagger
• POS tagger assigns a tag to each word depending
  on what part of speech it is
• Eg of tags – adjective(ADJ), common noun(NN),
  proper noun(NP), verb(VB) etc.
• Custom tag for command(CMD) created to
  recognize commands for application, such as call,
  message, launch, etc.
Jan 2012 - May 2012        Dept. of ISE              27
IMPLEMENTATION
• Different POS taggers available
• Simplest is Default Tagger
      – Tagging Accuracy is 13%
• Unigram Tagger
      – Tagging Accuracy is 81%
• Bigram Tagger
      – Used alone, accuracy is 10%, but when used with
        Unigram Tagger as a backoff, accuracy is 85%
• Trigram Tagger
      – Accuracy when used with the prev Bigram Tagger as
        backoff is 91.3%
Jan 2012 - May 2012         Dept. of ISE                    28
IMPLEMENTATION
• As it gives the highest accuracy, a model for
  tagging is used as follows:
      – First, a Default Tagger is used, which assigns a
        default noun tag
      – Then, a Unigram Tagger is used, which uses
        Default Tagger as backoff
      – Then, a Bigram Tagger is used, which uses the
        above Unigram Tagger as backoff
      – Lastly, a Trigram Tagger is used, which uses the
        above Bigram Tagger as backoff

Jan 2012 - May 2012         Dept. of ISE                   29
IMPLEMENTATION
• Taggers need to be trained with the corpus so
  that they can recognize words and tag them
  accordingly
• Training needs time
• Taggers can be pre-trained with the data to
  save time
• PICKLE files in python are used to save such
  pre-trained taggers

Jan 2012 - May 2012        Dept. of ISE           30
IMPLEMENTATION
• Tagger uses technique of statistics and
  probability to assign tags
• Tagged tokens passed to parser
• Parser makes sure sentence conforms to rules
  of grammar, hence only grammatically valid
  sentences are accepted
• Predefined commands specify the
  functionality they represent

Jan 2012 - May 2012        Dept. of ISE          31
IMPLEMENTATION
• Word, tag tuples are parsed to recognize
  commands and entities to which those
  commands apply
• Command words and receivers are extracted
• A unique id is returned to the client along with
  the receiver
• The id represents the functionality required, and
  the receiver indicates the variable parameter to
  which the functionality is applied
• This id is used to launch intents which also take
  into account the parameters
Jan 2012 - May 2012        Dept. of ISE               32
DIFFICULTIES
• Modification of corpus to suit the application
  needs
• Choosing a POS tagger
• Advanced semantics – multiple meanings of
  the same sentence. Eg., call, make a call, make
  a phone call, message, send a message, etc.
• Separation of training of data and processing


Jan 2012 - May 2012       Dept. of ISE          33
SCREENSHOTS




Jan 2012 - May 2012       Dept. of ISE   34
SCREENSHOTS




Jan 2012 - May 2012       Dept. of ISE   35
SCREENSHOTS




Jan 2012 - May 2012       Dept. of ISE   36
SCREENSHOTS




Jan 2012 - May 2012       Dept. of ISE   37
SCREENSHOTS




Jan 2012 - May 2012       Dept. of ISE   38
CONCLUSION
• Aim is to create a Natural Language Interface
  application which acts as a virtual assistant
• App is able to perform basic functions such as
  calling and messaging
• Also performs advanced functions like search,
  showing the weather and launching apps
• Works for multiple semantics for the same
  command, spoken in natural English
• Does not require much time, only a few seconds

Jan 2012 - May 2012      Dept. of ISE              39
FUTURE ENHANCEMENTS
• Include more semantics for the same
  command
• Increasing accuracy for longer sentences
• Processing on mobile device for short basic
  commands such as ‘call smith’
• Providing custom settings to user



Jan 2012 - May 2012     Dept. of ISE            40
REFERENCES
[1] Steven Bird, Ewan Klein, and Edward Loper. Natural Language Processing with
Python. United States of America: O’Reilly Media, Inc. June 2009
[2] Edward Loper. “NLTK: Building a Pedagogical Toolkit in Python”, Department of
Computer and Information Science, University of Pennsylvania, Philadelphia, PA
19104-6389, USA
*3+ Cheng Juan. “Research and Implementation English Morphological Analysis and
Part-of-Speech Tagging”, Normal Education Department, Bohai Shipbuilding Vocational
College, Huludao,China
[4] W. Wang, J. Auer, R. Parasuraman, I. Zubarev, D. Brandyberry and M. P. Harper. “A
Question Answering System Developed as a Project in a Natural Language Processing
Course”, Purdue University, West Lafayette IN.
[5] Ivan Archeurov, “Architecture of an NLP engine” Internet:
https://sites.google.com/site/iakcheurov/my-articles/architecture-of-nlp-engine
*6+ World Weather Online, “How Free Local Weather API Works”, Internet:
http://www.worldweatheronline.com/weather-api.aspx
[7] Natural Language Toolkit, Internet: http://www.nltk.org/
[8] Andrew Montalenti. “Just Enough NLP With Python”, Internet:
http://pixelmonkey.org/pub/nlp-training/

Jan 2012 - May 2012                   Dept. of ISE                                 41
Jan 2012 - May 2012   Dept. of ISE   42

More Related Content

PDF
JelitaAsianCV
DOC
DheepthiResume
RTF
AMIT PATIL- Embedded OS Professional
PDF
Natural Language Processing
PPTX
Natural Language Processing: Definition and Application
PDF
Natural language processing (NLP) introduction
PDF
Practical Natural Language Processing
PPT
Natural language processing
JelitaAsianCV
DheepthiResume
AMIT PATIL- Embedded OS Professional
Natural Language Processing
Natural Language Processing: Definition and Application
Natural language processing (NLP) introduction
Practical Natural Language Processing
Natural language processing

Viewers also liked (20)

PPTX
PPT
Introduction to Natural Language Processing
PPT
Introduction to Natural Language Processing
PPTX
Natural language processing
DOCX
NLP and its applications
PPTX
Statistical machine translation
PPTX
Natural language processing 2
PDF
Smart Snap - Report
PDF
Statistical machine translation in a few slides
PPTX
Machine translation with statistical approach
PDF
Implicit Human-Computer Interaction - Lecture 11 - Next Generation User Inter...
PPTX
Natural Language Processing in Alternative and Augmentative Communication
PPTX
The Role of Natural Language Processing in Information Retrieval
PDF
Campus news information system - Android
PPT
Types of machine translation
PPT
HCI 3e - Ch 10: Universal design
DOCX
Project final
PPTX
Speech recognition final presentation
PPTX
human computer interface
PPT
Speech recognition
Introduction to Natural Language Processing
Introduction to Natural Language Processing
Natural language processing
NLP and its applications
Statistical machine translation
Natural language processing 2
Smart Snap - Report
Statistical machine translation in a few slides
Machine translation with statistical approach
Implicit Human-Computer Interaction - Lecture 11 - Next Generation User Inter...
Natural Language Processing in Alternative and Augmentative Communication
The Role of Natural Language Processing in Information Retrieval
Campus news information system - Android
Types of machine translation
HCI 3e - Ch 10: Universal design
Project final
Speech recognition final presentation
human computer interface
Speech recognition
Ad

Similar to Jeeves -natural language interface application (20)

DOCX
Huned_Hita_latest
DOC
Lakkakula Sunil Kumar
DOC
Nirdesh_Developer_2.0_Years_6_months_Exp
DOCX
Huned hita india l-atest
PPT
Ppt for engineering students PPL subject
DOC
Yogesh_Kadam
DOC
Amit_Resume
PDF
Best 5 Swift IDEs and Code Editors for Your Next iOS Project.pdf
DOC
CV_Gajalakshmi_K_2015
PDF
Resume
PDF
Resume_2016Aug
PPTX
Android Development: Approach for Agile Teams
DOC
DOC
balu_soa
DOC
spurthy_resume
DOCX
Vineet_Resume_Tech
PDF
Mohsin khan
DOC
Rameez_Khan
DOC
HemantKumarSharma_v1.1
DOC
Ravindra Prasad
Huned_Hita_latest
Lakkakula Sunil Kumar
Nirdesh_Developer_2.0_Years_6_months_Exp
Huned hita india l-atest
Ppt for engineering students PPL subject
Yogesh_Kadam
Amit_Resume
Best 5 Swift IDEs and Code Editors for Your Next iOS Project.pdf
CV_Gajalakshmi_K_2015
Resume
Resume_2016Aug
Android Development: Approach for Agile Teams
balu_soa
spurthy_resume
Vineet_Resume_Tech
Mohsin khan
Rameez_Khan
HemantKumarSharma_v1.1
Ravindra Prasad
Ad

Recently uploaded (20)

PPTX
Cloud computing and distributed systems.
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
cuic standard and advanced reporting.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
KodekX | Application Modernization Development
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Cloud computing and distributed systems.
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
sap open course for s4hana steps from ECC to s4
Per capita expenditure prediction using model stacking based on satellite ima...
Encapsulation_ Review paper, used for researhc scholars
The Rise and Fall of 3GPP – Time for a Sabbatical?
MIND Revenue Release Quarter 2 2025 Press Release
Chapter 3 Spatial Domain Image Processing.pdf
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Programs and apps: productivity, graphics, security and other tools
Digital-Transformation-Roadmap-for-Companies.pptx
cuic standard and advanced reporting.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
Network Security Unit 5.pdf for BCA BBA.
Unlocking AI with Model Context Protocol (MCP)
KodekX | Application Modernization Development
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf

Jeeves -natural language interface application

  • 1. JEEVES - A NATURAL LANGUAGE PROCESSING APPLICATION FOR ANDROID Presented by, Anshul Agarwal (IP108IS017) Karan Harsh Wardhan(1PI08IS045) Pavani Deepak Mehta(1PI08IS070) Jan 2012 - May 2012 Dept. of ISE 1
  • 2. AGENDA • Project Overview • Relevance • Requirements • Introduction • Technologies Used • System Design Jan 2012 - May 2012 Dept. of ISE 2
  • 3. AGENDA • Software Development Strategy • Implementation • Difficulties • Screenshots • Conclusion • Future Enhancements • References Jan 2012 - May 2012 Dept. of ISE 3
  • 4. PROJECT OVERVIEW • Goal of the Project: – To design a Natural Language Processing (NLP) Interface Application for Android Platform • Scope of the Project – Input from user using Voice Recognition – Application should process input and recognize user commands spoken in natural English – Basic features should be to make calls and send messages to contacts – Advanced features such as showing weather, Google search and launching apps Jan 2012 - May 2012 Dept. of ISE 4
  • 5. RELEVANCE • Allows for more intuitive human-computer interaction • More convenient if computer can automate tasks usually performed by humans • Goal is to reduce keypad usage as much as possible, and allow user to speak naturally • Can help the disabled to easily use phones • Acts as a virtual assistant, enhancing productivity Jan 2012 - May 2012 Dept. of ISE 5
  • 6. REQUIREMENTS Jan 2012 - May 2012 Dept. of ISE 6
  • 7. INTRODUCTION • NLP is a field of computer science and linguistics concerned with the interactions between computers and human languages • Aim is to design software that will analyze, understand, and generate languages that humans use naturally • Eventually user will be able to address the computer as they talk to another person Jan 2012 - May 2012 Dept. of ISE 7
  • 8. TECHNOLOGIES USED - ANDROID WHY ANDROID? • Android is an open-source linux-based operating system for mobile devices • Requires developer license only to publish, not develop • Google voice recognition inbuilt in most Android devices • Layered architecture facilitates rapid development of applications Jan 2012 - May 2012 Dept. of ISE 8
  • 9. TECHNOLOGIES USED - ANDROID • ANDROID SYSTEM ARCHITECTURE Jan 2012 - May 2012 Dept. of ISE 9
  • 10. TECHNOLOGIES USED - ANDROID INTENTS • Messaging facility for late run-time binding between components • Intent object is a passive data structure holding description of operation to be performed • Three core components of an application — activities, services, and broadcast receivers — are activated through intents Jan 2012 - May 2012 Dept. of ISE 10
  • 11. TECHNOLOGIES USED - ANDROID INTENTS • Two types - Implicit And Explicit • Intent filters are implemented help with intent resolution • Used to turn apps into high-level libraries and make code modular and reusable Intent intent = new Intent (App Package name); startActivity(intent); • Various additional info can be added intent.putExtra(“title”,”Hello codeandroid”); Jan 2012 - May 2012 Dept. of ISE 11
  • 12. TECHNOLOGIES USED – HTTP POST • POST request is used to send data to server • The string detected by voice recognizer is passed to server using this method • Accomplished using in-built HttpCore API i.e org.apache.http package • The server performs processing and returns a JSON response Jan 2012 - May 2012 Dept. of ISE 12
  • 13. TECHNOLOGIES USED - JSON • JavaScript Object Notation (JSON) is a lightweight data-interchange format • Based on a subset of the JavaScript Programming Language • Is completely language independent • In java, org.json.JSONObject is used to parse these strings JSONObject responseJSON = new JSONObject(responseString); String workId = responseJSON.getString("id"); Jan 2012 - May 2012 Dept. of ISE 13
  • 14. TECHNOLOGIES USED - JSON • Example: {"menu": { "id": "file", "value": "File", "popup": { "menuitem": [ {"value": "New", "onclick": "CreateNewDoc()"}, {"value": "Open", "onclick": "OpenDoc()"}, {"value": "Close", "onclick": "CloseDoc()"} ] } }} Jan 2012 - May 2012 Dept. of ISE 14
  • 15. TECHNOLOGIES USED – VOICE RECOGNITION WHY GOOGLE VOICE RECOGNITION? • Focus of project was not automatic speech recognition • Pre-installed on most android phones, easy to access • Requires no special permission/payment to be used • Developed, optimized and maintained by Google since 2007 • Occurs off-site i.e. on Google’s servers so no “weighty” voice recognition s/w needs to be installed on phone • Only need “android.speech.RecognizerIntent” package Jan 2012 - May 2012 Dept. of ISE 15
  • 16. TECHNOLOGIES USED – VOICE RECOGNITION HOW DOES RECOGNITION WORK? • Google uses artificial intelligence algorithms to recognize spoken sentences • Stores voice data anonymously for analysis purposes • Cross matches spoken data with written queries on server • Key problems of computational power, data availability and managing large amounts of information are handled with ease Jan 2012 - May 2012 Dept. of ISE 16
  • 17. TECHNOLOGIES USED - NLTK NATURAL LANGUAGE TOOLKIT • Open-source suite of libraries for NLP for the Python language • Includes graphical demonstrations and sample data • Provides NLP API’s, such as for importing a corpus, loading grammar from a file, etc. Jan 2012 - May 2012 Dept. of ISE 17
  • 18. SYSTEM DESIGN • DFD Level 0 Jan 2012 - May 2012 Dept. of ISE 18
  • 19. SYSTEM DESIGN • DFD Level 1 Jan 2012 - May 2012 Dept. of ISE 19
  • 20. SYSTEM DESIGN • DFD Level 2 Jan 2012 - May 2012 Dept. of ISE 20
  • 21. SOFTWARE DEVELOPMENT STRATEGY • Software Development Strategy used is Extreme Programming • It is a type of agile software development • Advocates frequent releases in multiple short development cycles rather than one long cycle • Involves programming in groups and doing extensive code review • Works best with smaller groups Jan 2012 - May 2012 Dept. of ISE 21
  • 22. SOFTWARE DEVELOPMENT STRATEGY Jan 2012 - May 2012 Dept. of ISE 22
  • 23. IMPLEMENTATION WHAT WE HAVE IMPLEMENTED • Corpus – modification of Brown • Tokenizer • Part-of-Speech tagger • Grammar • Syntactic and Semantic Analysis • Client application on Android – Takes voice input from user, converts to text, passes text to NLP server, receives id from server and launches corresponding intent Jan 2012 - May 2012 Dept. of ISE 23
  • 24. IMPLEMENTATION • Client application starts up and prompts user to input using Google Voice Recognition • Input data is sent to Google servers for processing and text is returned to client • Input text is now passed to the NLP server for processing using HTTP POST • Server performs Natural Language Processing Jan 2012 - May 2012 Dept. of ISE 24
  • 25. IMPLEMENTATION • Steps involved in NLP: – Lexical Analysis: converts sequence of characters into a sequence of tokens – Morphological Analysis: identification, analysis and description of the structure of a given language's linguistic units – Syntactic Analysis: analyzing text, made up of a sequence of tokens, to determine its grammatical structure – Semantic Analysis: relating syntactic structures from the levels of phrases and sentences to their language- independent meanings Jan 2012 - May 2012 Dept. of ISE 25
  • 26. IMPLEMENTATION • A corpus is a large and structured set of texts • Used in part-of-speech tagging to tag words as parts of a sentence • Tags stored along with the words in the corpus • We have modified the Brown corpus to include more relevant phrases and commands • Contains data from books, news articles, journals, etc. • TaggedCorpusReader needed to import the corpus Jan 2012 - May 2012 Dept. of ISE 26
  • 27. IMPLEMENTATION • During lexical analysis, the string is split up into various tokens, the separator being space • Tokens, which are words in this case, are passed to a part-of-speech(POS) tagger • POS tagger assigns a tag to each word depending on what part of speech it is • Eg of tags – adjective(ADJ), common noun(NN), proper noun(NP), verb(VB) etc. • Custom tag for command(CMD) created to recognize commands for application, such as call, message, launch, etc. Jan 2012 - May 2012 Dept. of ISE 27
  • 28. IMPLEMENTATION • Different POS taggers available • Simplest is Default Tagger – Tagging Accuracy is 13% • Unigram Tagger – Tagging Accuracy is 81% • Bigram Tagger – Used alone, accuracy is 10%, but when used with Unigram Tagger as a backoff, accuracy is 85% • Trigram Tagger – Accuracy when used with the prev Bigram Tagger as backoff is 91.3% Jan 2012 - May 2012 Dept. of ISE 28
  • 29. IMPLEMENTATION • As it gives the highest accuracy, a model for tagging is used as follows: – First, a Default Tagger is used, which assigns a default noun tag – Then, a Unigram Tagger is used, which uses Default Tagger as backoff – Then, a Bigram Tagger is used, which uses the above Unigram Tagger as backoff – Lastly, a Trigram Tagger is used, which uses the above Bigram Tagger as backoff Jan 2012 - May 2012 Dept. of ISE 29
  • 30. IMPLEMENTATION • Taggers need to be trained with the corpus so that they can recognize words and tag them accordingly • Training needs time • Taggers can be pre-trained with the data to save time • PICKLE files in python are used to save such pre-trained taggers Jan 2012 - May 2012 Dept. of ISE 30
  • 31. IMPLEMENTATION • Tagger uses technique of statistics and probability to assign tags • Tagged tokens passed to parser • Parser makes sure sentence conforms to rules of grammar, hence only grammatically valid sentences are accepted • Predefined commands specify the functionality they represent Jan 2012 - May 2012 Dept. of ISE 31
  • 32. IMPLEMENTATION • Word, tag tuples are parsed to recognize commands and entities to which those commands apply • Command words and receivers are extracted • A unique id is returned to the client along with the receiver • The id represents the functionality required, and the receiver indicates the variable parameter to which the functionality is applied • This id is used to launch intents which also take into account the parameters Jan 2012 - May 2012 Dept. of ISE 32
  • 33. DIFFICULTIES • Modification of corpus to suit the application needs • Choosing a POS tagger • Advanced semantics – multiple meanings of the same sentence. Eg., call, make a call, make a phone call, message, send a message, etc. • Separation of training of data and processing Jan 2012 - May 2012 Dept. of ISE 33
  • 34. SCREENSHOTS Jan 2012 - May 2012 Dept. of ISE 34
  • 35. SCREENSHOTS Jan 2012 - May 2012 Dept. of ISE 35
  • 36. SCREENSHOTS Jan 2012 - May 2012 Dept. of ISE 36
  • 37. SCREENSHOTS Jan 2012 - May 2012 Dept. of ISE 37
  • 38. SCREENSHOTS Jan 2012 - May 2012 Dept. of ISE 38
  • 39. CONCLUSION • Aim is to create a Natural Language Interface application which acts as a virtual assistant • App is able to perform basic functions such as calling and messaging • Also performs advanced functions like search, showing the weather and launching apps • Works for multiple semantics for the same command, spoken in natural English • Does not require much time, only a few seconds Jan 2012 - May 2012 Dept. of ISE 39
  • 40. FUTURE ENHANCEMENTS • Include more semantics for the same command • Increasing accuracy for longer sentences • Processing on mobile device for short basic commands such as ‘call smith’ • Providing custom settings to user Jan 2012 - May 2012 Dept. of ISE 40
  • 41. REFERENCES [1] Steven Bird, Ewan Klein, and Edward Loper. Natural Language Processing with Python. United States of America: O’Reilly Media, Inc. June 2009 [2] Edward Loper. “NLTK: Building a Pedagogical Toolkit in Python”, Department of Computer and Information Science, University of Pennsylvania, Philadelphia, PA 19104-6389, USA *3+ Cheng Juan. “Research and Implementation English Morphological Analysis and Part-of-Speech Tagging”, Normal Education Department, Bohai Shipbuilding Vocational College, Huludao,China [4] W. Wang, J. Auer, R. Parasuraman, I. Zubarev, D. Brandyberry and M. P. Harper. “A Question Answering System Developed as a Project in a Natural Language Processing Course”, Purdue University, West Lafayette IN. [5] Ivan Archeurov, “Architecture of an NLP engine” Internet: https://sites.google.com/site/iakcheurov/my-articles/architecture-of-nlp-engine *6+ World Weather Online, “How Free Local Weather API Works”, Internet: http://www.worldweatheronline.com/weather-api.aspx [7] Natural Language Toolkit, Internet: http://www.nltk.org/ [8] Andrew Montalenti. “Just Enough NLP With Python”, Internet: http://pixelmonkey.org/pub/nlp-training/ Jan 2012 - May 2012 Dept. of ISE 41
  • 42. Jan 2012 - May 2012 Dept. of ISE 42

Editor's Notes

  • #5: Application includes Android client and Xampp server running a python script
  • #6: Example, rather than opening phonebook and searching contacts and then pressing call, user just has to say ‘call john’
  • #12: http://developer.android.com/resources/articles/can-i-use-this-intent.html
  • #14: http://json.org/Json is based on subset of javascript defined in:http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf
  • #16: http://java.sun.com/products/java-media/speech/forDevelopers/jsapi-guide/Recognition.html//to demo complexity of idea and why abandonedhttp://developer.android.com/resources/articles/speech-input.html
  • #17: http://www.slate.com/articles/technology/technology/2011/04/now_youre_talking.single.htmlCohen says that building just one part of the speech-recognition system required "roughly 70 CPU-years" of computer time.whichgoogle did in a day!http://googleblog.blogspot.in/2010/10/goodbye-to-old-friend-1-800-goog-411.html note the date when it was started
  • #27: Brown – nearly 1million words
  • #33: Eg. Parameter may specify contact to be called or messaged or app to be launched