DATA MINING COURSE
LECTURE 6: TEXT MINING & NLP
(PART 1)
Prof. Chiraz Ben Abdelkader
Ecole Nationale des Sciences de l’Informatique
2015/2016
October 28, 2015
ROADMAP
1)
Introduction
2) Application: Language identification
3) Application: Sentiment analysis
4) Application: Document categorization
Part 2
11/4/2015
1
1) INTRODUCTION
OVERVIEW
In this lesson we discuss techniques that lie at
the intersection of two fields : text mining and
Natural Language Processing (NLP)
In the introduction section :
We will define these two fields
Then give examples of some of their applications
11/4/2015
2
NATURAL TEXT DATA
The common denominator among Text mining
and NLP is that they both analyze natural text
data
Natural text documents contain human-readable
text, i.e. written in some human (or natural)
language, such as Arabic, English, Spanish, etc.
NATURAL TEXT DATA (CONT.)
Natural text data is typically difficult to process
Publicité
and analyze because :
It is often ambiguous (fuzzy)
It is often noisy (contain mistakes in vocabulary or
grammar)
It can be informal (e.g. social media comments)
It can be multilingual
These challenges can often be alleviated by the
use of linguistic knowledge
11/4/2015
3
NATURAL TEXT DATA EXAMPLES
Web pages
Email messages
Social media
SMS
News articles
Scientific articles
Books
…
TEXT MINING
Text mining is a subfield of data mining in which
the input data consists of natural text documents
automated discovery of novel, hidden, and
useful patterns
11/4/2015
4
NATURAL LANGUAGE PROCESSING
Intelligent automated processing of natural
language text based on linguistic knowledge
Done by executing
computer programs
Text written in
some human
language
knowledge about phonetics,
Publicité
structure of words, syntax
of single sentences,
semantics
9
TEXT MINING NLP
Text mining =
automated
processing of
natural text data
to extract novel
useful patterns
Text mining NLP =
automated processing
of natural text data
based on linguistic
knowledge to extract
novel useful patterns
NLP = automated
processing of
natural text data
based on linguistic
knowledge
11/4/2015
5
TYPES OF LINGUISTIC KNOWLEDGE
There are several levels of linguistic knowledge :
Morphological : structure of words – how single words
are constructed from smaller units (called morphemes)
Lexical semantics : meaning of single words based on
their current context
Syntactic : grammatical structure of sentences
Sentential semantics : meaning of words and
sentences
Discourse semantics : meaning across many sentences
(e.g. a paragraph or an entire document)
Publicité
EXAMPLES (ENGLISH LANGUAGE)
Morphology:
going = go + ing
dogs = plural of dog; rated is past tense of rate
carried = carry + ed
aren’t = are not
Syntax:
simple sentence = noun + verb
Sentential semantics:
X killed Y : X is the killer and Y is the killed person
Discourse semantics:
George woke up. He went to the kitchen.
11/4/2015
6
DOG-NLP?
Can dogs process human language?
DOG-NLP?
In this caricature, the dog can only recognize its name
Dogs can recognize certain words, but cannot deduce
meaning of whole sentences
11/4/2015
7
NLP VS. NO-NLP
Consider the simple problem of counting words in
an English text documents
Non-NLP approach: find letter sequences separated
by whitespace or punctuation
For example, the wc command in Linux works like this
NLP approach:
1) Find letter sequences separated by whitespace characters;
however the letter sequence may contain 1-2 hyphens or one
apostrophe in the middle
2) Verify the extracted words against some electronic/online
English dictionary
Question: What type of linguistic
Publicité
knowledge does each step use ?
APPLICATION EXAMPLE: SEMANTIC SEARCH
Problem: given a user query, find all documents
that have similar meaning as the query
Semantic search ≠ Traditional “dumb” search
Traditional search = finding documents that contain all
(key) words of the user query
grep in Linux is an example of dumb search
Semantic search is difficult/challenging because :
Words can have different meanings ;
Meaning of words/sentences can vary with context ;
User query can contain mistakes ;
And of course because the repository is very large!
11/4/2015
8
11/4/2015
9
OTHER APPLICATIONS
Place email messages into different folders (e.g. gmail)
Analyze web sites of competitors to compare prices
Translate a Web page (Google chrome) or a user
comment (on Facebook)
Investigate public opinion on social media with regard
to some product, brand, company, political figure,
issue, etc. (called sentiment analysis)
Analyze user reviews/comments in order to extract
implicit ratings for a recommender system (i.e. to
initialize the ratings matrix)
11/4/2015
10