0% found this document useful (0 votes)
37 views20 pages

Speech Processing System

Uploaded by

pratik665123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views20 pages

Speech Processing System

Uploaded by

pratik665123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

LANGUAGE PROCESSING SYSTEM

Dr P. Mythili Sharan
Architect(Speech)

Nuronics Labs
Agenda • Natural language understanding
• Natural language generation for dialogue
systems
• Use of speech synthesizers in dialogue
systems
• Dialogue system evaluation
• Stochastic approach to dialogue
• Dialogue policy design and training
• MDP-POMDP Reinforcement learning
• Simulated users
• Microsoft SDK
• Case studies related to it
Natural language understanding (NLU) is a branch of artificial
intelligence that uses computer software to understand input in the
form of sentences using text or speech.

NLU enables human-computer interaction by analyzing language


versus just words.

Natural NLU enables computers to understand the sentiments expressed in a


natural language used by humans, such as English, French or
Mandarin, without the formalized syntax of computer languages.
language A basic form of NLU is called ‘parsing’, which takes written text and

understanding converts it into a structured format for computers to understand.

Instead of relying on computer language syntax, NLU enables a


computer to comprehend and respond to human-written text.

One of the main purposes of NLU is to create chat- and voice-enabled


bots that can interact with people without supervision.
Human language is typically difficult for
computers to grasp, as it's filled with
complex, subtle and ever-changing
meanings. Natural language understanding
systems let organizations create products or
Why is natural tools that can both understand words and
interpret their meaning.
language
understanding
NLU makes it possible to carry out a
important dialogue with a computer using a
human-based language. This is useful for
consumer products or device features, such
as voice assistants and speech to text.
How does natural language understanding work
NLU analyzes data to determine its meaning by using algorithms
to reduce human speech into a structured ontology -- a data
model consisting of semantics and pragmatics definitions.

Two fundamental concepts of NLU are intent and entity


recognition: When given a natural language input, NLU
splits that input into individual words --
Entity recognition
called tokens -- which include punctuation
Is a specific type of NLU that and other symbols. The tokens are run
focuses on identifying the entities in
Intent recognition
a message and then extracting the through a dictionary that can identify a
most important information about
Is the process of identifying the
those entities.
word and its part of speech.
user's sentiment in input text and
determining their objective. It's the a) Named entities are grouped into
categories, such as people's
first and most important part of
names, business names and The tokens are then analyzed for their
NLU, as it establishes the meaning of
the text. locations. grammatical structure, including the word's
b) Numeric entities are recognized role and different possible ambiguities in
as quantities, dates, currencies
and percentages.
meaning.
How does natural language understanding work

"I went to the bank." This is an example of lexical ambiguity, as


the word bank can either be in reference to a place where
money is kept, or the edge of a river. To understand what the
speaker is truly saying

Example
▪ The space that belongs to you has green ambient lighting;
▪ You are driving through a green traffic signal;
▪ You no longer have to wait to continue driving;
▪ You are permitted to proceed in a non-driving context;
You have a green light ▪ Your body is cast in a greenish glow;
▪ You possess a light source which radiates green; or
“it is difficult to infer meaning without
knowing the context, the identity of the ▪ You possess a light with a green surface.
speaker or the speaker's intent.”
How does natural language understanding work

Example

Typing a request into a search engine for


▪ In this case, the person's objective is to
purchase tickets, and the ferry is the most
island camping trip on Andaman Island Aug. 18 likely form of travel as the campground is on
an island.
might be broken down as follows:
▪ Search results using an NLU-enabled search
engine would likely show the ferry schedule
▪ Ferry tickets [intent] / need
and links for purchasing tickets, as the process
▪ Camping lot reservation [intent]
broke down the initial input into a need,
▪ Andaman Island [location]
location, intent and time for the program to
▪ Aug. 18 [date]
understand the input. Andaman Island is the
named entity, and Aug. 18 is the numeric
entity.
Natural language
understanding
applications

▪ Interactive voice response (IVR) and message


routing.
▪ Customer support and service through
intelligent personal assistants.
▪ User sentiment and intent.
▪ Machine translation.
▪ Conversational interfaces.
“Amazon Alexa and Google Home”
Natural language generation for dialogue systems
Techniques followed to build chat bot

Rule based Cloud based NLP services

With rule-based frameworks, the developer is Provide browser-based consoles which assist
responsible for implementing the core logic to developers in uploading and annotating training
interpret incoming messages and return helpful examples. They also streamline the task of
responses. This logic generally consists of a series of launching a cloud-based web service to handle and
rules that specify which scripted response to return parse natural language requests.
for a message that matches a specified pattern. NLP services currently available are Amazon Lex ,
Limitations: Narrow vocabulary of commands Google’s Dialogflow, Facebook’s wit.ai, Microsoft
and fails in handling many corner as it enters into LUIS and IBM Watson Assistant.
production Limitations: Cost of implementation and security
Natural language generation for dialogue systems
▪ NLG is conceptualized as a process leading from a
high-level communicative goal to a sequence of
communicative acts which accomplish this
communicative goal.

Architecture of a dialog system with natural language generation


Natural language generation for dialogue systems
Natural language generation process into three phases

▪ The first two of which are planning phases ▪ Third one is


1. Text planning 3. Realization phase
2. Sentence planning

TEXT PLANNER REALIZATION


implicit-confirm(orig-city:NEWARK) What time would you like to travel on
September the 1st to Dallas from Newark? (5.)
implicit-confirm(dest-city:DALLAS)
Leaving on September the 1st. What time would
implicit-confirm(month:9)
you like to travel from Newark to Dallas? (4.5)
implicit-confirm(day-number:1)
Leaving in September. Leaving on the 1st. What
request(depart-time) time would you, traveling from Newark to
Dallas, like to leave? (2)
Natural language generation for dialogue systems
Natural language generation for dialogue systems
Named Entity Recognition (NER)

Locate and classify named entities in text into pre-defined


categories such as the names of persons, organizations,
locations, expressions of times, quantities, monetary values,
Open-Source named entity recognition
percentages, etc.
▪ Stanford Named Entity Recognizer (SNER): This JAVA
NER is used in many fields in Natural Language Processing tool developed by Stanford University is considered the
(NLP), and it can help answering many real-world questions, standard library for entity extraction.
such as: ▪ SpaCy: a Python framework known for being fast and
very easy to use. It has an excellent statistical system
▪ Which companies were mentioned in the news article? that you can use to build customized NER extractors.
▪ Were specified products mentioned in complaints or ▪ Natural Language Toolkit (NLTK): this suite of libraries
reviews? for Python is widely used for NLP tasks. NLTK has its
own classifier to recognize named entities called
▪ Does the tweet contain the name of a person? Does the
ne_chunk.
tweet contain this person’s location?
Named Entity Recognition (NER) - NLTK
Information Extraction

import nltk def preprocess(sent):


from nltk.tokenize import word_tokenize sent = nltk.word_tokenize(sent)
from nltk.tag import pos_tag sent = nltk.pos_tag(sent)
return sent

I took a sentence from The New York


Times, Let’s see what we get:
“European authorities fined Google a record
$5.1 billion on Wednesday for abusing its sent = preprocess(ex)
power in the mobile phone market and sent
ordered the company to alter its practices.”

Then we apply word tokenization and


part-of-speech tagging to the sentence
Named Entity Recognition (NER) - NLTK

We get a list of tuples containing the individual words in


the sentence and their associated part-of-speech.
Now we’ll implement noun phrase chunking to identify
named entities using a regular expression consisting of
rules that indicate how sentences should be chunked.
Let’s see what we get: Our chunk pattern consists of one rule, that a noun
phrase, NP, should be formed whenever the chunker
sent = preprocess(ex) finds an optional determiner, DT, followed by any
sent number of adjectives, JJ, and then a noun, NN.

pattern = 'NP: {<DT>?<JJ>*<NN>}'


Named Entity Recognition (NER) - NLTK
Chunking
Using this pattern, we create a chunk
parser and test it on our sentence.

cp = nltk.RegexpParser(pattern)
cs = cp.parse(sent)
print(cs)

The output can be read as a tree or a


hierarchy with S as the first level, denoting
sentence. we can also display it graphically.
Named Entity Recognition (NER) - NLTK
Chunking . . .
IOB tags have become the standard way to represent chunk
structures in files, and we will also be using this format.

from nltk.chunk import conlltags2tree, tree2conlltags


from pprint import pprint

iob_tagged = tree2conlltags(cs)
pprint(iob_tagged)

In this representation, there is one token per line, each with


its part-of-speech tag and its named entity tag. Based on
this training corpus, we can construct a tagger that can be
used to label new sentences; and use the
nltk.chunk.conlltags2tree() function to convert the tag
sequences into a chunk tree.
Named Entity Recognition (NER) - NLTK
Chunking . . .

With the function nltk.ne_chunk(), we can recognize named


entities using a classifier, the classifier adds category labels
such as PERSON, ORGANIZATION, and GPE.

ne_tree = ne_chunk(pos_tag(word_tokenize(ex)))
print(ne_tree)

Google is recognized as a person. It’s


quite disappointing, don’t you think
so?
THANK YOU

You might also like