Introduction To Text Mining and Natural Language Processing: Judith Risse
Introduction To Text Mining and Natural Language Processing: Judith Risse
Judith Risse
Outline
Definitions
the study of automated generation and understanding of natural human languages (Wikipedia)
Text Mining
extract high quality (previously unknown) information from large amounts of unstructured text
Biomedical Literature
communication of scientific discoveries peer-reviewed and community reviewed provides additional information of experimental results base for annotation of biological databases
Literature Databases
currently 19476540 citations (Jan 27, 2010) 5414 journals in Medline unique identifier PMID entries contain author, journal and title info more than 50% also abstracts links to full-text articles Medical Subject Headings (MeSH)
PubMed
21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1950 1953 1956 1959
PubMed growth
No of publications in millions
1962
1965
1968
1971
1974
1977
1980
1983
1986
1989
1992
1995
1998
2001
2004
2007
Pubmed (3)
NLM 2008
A scientific article
type of article
document format
Article content
Full-text
Biomedical Language
polysemic words
space
acronyms
Overexpression of FumRs and Frds1 resulted in the best citrate-producing strain in the presence of trace manganese concentrations. This strain gave a maximum yield of .
10
malic dehydrogenase L-malate dehydrogenase NAD-L-malate dehydrogenase malic acid dehydrogenase NAD-dependent malic dehydrogenase NAD-malate dehydrogenase NAD-malic dehydrogenase malate (NAD) dehydrogenase MDH L-malate-NAD+ oxidoreductase
11
information technology, linguistics, artificial intelligence, statistics . machine learning, rule-based, regular expressions
Grammatical Features
Grammar
rules governing a language syntax and morphology noun, verb, adjective, adverb, preposition depends on context in sentence http://www.cst.dk/online/pos_tagger/uk/index.html http://en.wikipedia.org/wiki/Brill_Tagger
13
Morphological Features
enzyme and enzymes (plural form) catalyse, catalyses, catalysing (verb inflection) earth, earthworm (compounding) dependent, independent (derivation) reduction of words to common base form
word-formation
Syntactic Features
15
(NNP Pain) (VBD vanished) (IN for) (IN at) (JJS least) (CD three) (NNS months) (IN in) (NNS rats) (WP who) (VBD were) (VBN injected) (IN in) (DT the) (NN spine) (IN with) (DT a) (NN gene) (IN that) (NNS triggers) (VBZ endorphins) (. .)
injected - Verb, past participle in - Preposition the - Determiner spine - Singular noun with - Preposition a - Determiner gene - Singular noun that - Preposition triggers - Plural noun endorphins - Verb, 3rd ps. sing.present . - Final punctuation
16
Pain - Proper singular noun vanished - Verb, past tense for - Preposition at - Preposition least - Superlative adjective three - Cardinal number months - Plural noun in - Preposition rats - Plural noun who - wh-pronoun were - Verb, past tense
Semantic Features
Gene Ontology
17
Contextual Analysis
Guilt by association
Word frequency
18
Exercise 1
take a gene/protein name of your interest query pubMed and retrieve 1 abstract
Take a look at what the Porter stemmer does using the abstract Describe what problems might occur from stemming Porter Stemmer
http://maya.cs.depaul.edu/~classes/ds575/porter.h tml
19
Coffee Break
Tasks of NLP
machine translation text proofing speech recognition optical character recognition (OCR)
21
Information Retrieval
Information retrieval (IR) is finding material (usually documents) of an unstructured nature (usually text) that satisfies an information need from within large collections (usually stored on computers). Introduction to IR (CambUnivPr,
2008)
Indexing
Tokenization Case Folding (TNFalpha, Tnfalpha tnfalpha Stemming Stop-word removal (e.g. at, be, from, this )
Zipfs Law
A small number of words occur very often Those high frequency words are often function words (e.g. prepositions) Most words with low frequency
23
Boolean Queries
AND OR NOT
term frequency (TF) inverse document frequency (IDF) corpus size (N)
the vector points in word space each dimension corresponds to a word or phrase
Nat Rev Gen(2002):3 pp 601-610 25
IR Evaluation
A document is relevant if it addresses the stated information need, not because it just happens to contain all the words in the query. Introduction to IR (CambUnivPr,
2008)
26
Evaluation (2)
Precision
What fraction of the returned results are relevant to the information need?
Recall
What fraction of the relevant documents in the collection were returned by the system? harmonic mean of precision and recall (2pr)/(p+r)
27
F-score
Exercise 2
Compare the retrieval of abstracts between PubMed and Phasar (www.bioinformatics.nl/biometa/applet.html or twoquid.cs.ru.nl/applet.html) given the question:
How many results do you get? Give examples of answers to the question. Give 5 pmids of papers you would read given the results in each search. Which of the systems was more helpful and why?
28
Coffee Break
Question Answering
question posed in human language answer extracted from unstructured text more developed in generic domain difficult in biomedical domain
30
extract structured information from unstructured text Named Entity Recognition identify relationships
31
Information Extraction
tagging of biological entities high precision in generic NLP (0.9 F-score) difficult in biology
complex terms, synonyms, disambiguation typographical variations no use of official symbols gene/protein names
33
gene symbols
Challenges of NLP
Abbreviation
punctuation can be confused with end of sentence Wash. (Washington) with wash.
34
Challenges (2)
hyphens
single or multiple words? data-base vs. data base vs. database carry-over?
simple stemming
case folding
Anaphora
36
Exercise 3
What are the differences in recognized entities? Do they miss any obvious entities?
37
Indexing
for each word in the collection (dictionary) list occurrence and frequency
size of index is proportional to size of corpus remove stopwords, use stemming for more efficient index classic version is a boolean index
sparse matrix
38
Example
document ids
total # of occurrences
deterministic 20 73 89 90 106 173 194 233 243 251 252 255 257 258 267 276 281 304 312 315 326 27 36822 44643 45285 53003 53061 86740 86743 97082 116618 121984 125750 125952 125968 126039 127633 128882 128978 129048 133781 133789 138493 140946 140947 152011 156191 157881 163490 deterrence 1 60 4 30309 30345 30444 30452 detonation 2 263 264 4 131781 131956 131995 132303
39
Suffix Array
A suffix array is an array that contains all the pointers to the text suffixes listed in lexicographical order.
Text is seen as one long string A text suffix is a substring from given position till end of string position refers to beginning of word return all occurrences of string W in large text A
40
Example:
the word: abracadabra 1. create all suffixes 2. sort suffixes on alphabet
Finding every occurrence of the substring is equivalent to finding every suffix that begins with the substring
41
Document Classification
42
training documents for each class supervised learning test data or new data training data and test data have to be similar
43
Nave Bayes
Nave: all words in text are considered independent Bayes: uses Bayes theorem
prior probability
posterior probability
P ( B | A) P ( A) P( A | B) P( B)
44
45
wikipedia.org
46
Coffee Break
Exercise 4
http://search.cpan.org/~kwilliams/AlgorithmNaiveBayes/ rugby.txt and tennis.txt as training and test data. If you have it implemented try using this in combination with the Porter Stemmer (http://bionlp.stanford.edu/bionlp.pl)
48
Added Challenge
retrieve UniprotID via BLAST (take best hit) retrieve gene name using getz (GeneName field) retrieve relevant abstracts from pubMed in Medline format using eSearch and eFetch with the gene name extract all protein/gene names from these abstracts
http://bionlp.stanford.edu/webservices.html
how do they relate to the original protein? compare to the output of ebiMed using the gene name (http://www.ebi.ac.uk/Rebholzsrv/ebimed/index.jsp)
49
Helpful resources
http://www-nlp.stanford.edu/links/statnlp.html http://nlp.stanford.edu/IRbook/html/htmledition/mybook.html www.biocreative.org Drosophila gene names:
http://www.curioustaxonomy.net/gene/fly.html
50
Further Reading
Cambridge University Press ISBN 987-0-521-86571-5 Cambridge University Press ISBN-13 978-0-521-83657-9
51