Pycon2016- Applying Deep Learning in Information Retrieval System

28
Applying Deep Learning in Information Retrieval System ৼ聼牏ப虦

Transcript of Pycon2016- Applying Deep Learning in Information Retrieval System

Page 1: Pycon2016- Applying Deep Learning in Information Retrieval System

Applying Deep Learning in Information Retrieval System

Page 2: Pycon2016- Applying Deep Learning in Information Retrieval System

http://twchrislin.com/

Page 3: Pycon2016- Applying Deep Learning in Information Retrieval System

My projecthttp://twchrislin.com/project/

Tools: python numpy pandas scikit-learn xgboost theano lasagne

id LifeTime dira FlightDistance FlightDistanceError … signal

18453471 0.00157832377590239050.999999344348907614.0333347320556640.6814009547233582 … 0

5364094 0.00098804314620792870.99970477819442765.536156654357910.3023407459259033 … 0

11130990 0.00087667378829792140.99998414516448966.1173019409179690.27646270394325256… 0

15173787 0.0008541746647097170.99990290403366085.2280673980712890.22073912620544436… 0

1102544 0.00112933525815606140.999995291233062939.069534301757811.8981972932815552 … 0

https://youtu.be/_SjgCoR7e1s

Page 4: Pycon2016- Applying Deep Learning in Information Retrieval System

http://www.emotibot.com/

:

python numpy pandas

scikit-learn xgboost theano lasagne

Machine Learning Deep Learning

Page 5: Pycon2016- Applying Deep Learning in Information Retrieval System

Outline

1. Information Retrieval 2. Neural Networks and Convolutional Neural Networks 3. Feature Vector Representation 4. Sentence Retrieval 5. Image Retrieval 6. Conclusion

Page 6: Pycon2016- Applying Deep Learning in Information Retrieval System

Information Retrieval

Input Query

Encoding Database Matching

Ranking

Page 7: Pycon2016- Applying Deep Learning in Information Retrieval System

Neural Networks

http://speech.ee.ntu.edu.tw/~tlkagk/courses/MLDS_2015_2/Lecture/DNN%20(v4).pdf

Single Neuron, Logistic Regression

Sigmoid funciton

28 pixels

28 pixels

784 pixels

Page 8: Pycon2016- Applying Deep Learning in Information Retrieval System

Neural Networks

http://speech.ee.ntu.edu.tw/~tlkagk/courses/MLDS_2015_2/Lecture/DNN%20(v4).pdf

Multiclass 10

Page 9: Pycon2016- Applying Deep Learning in Information Retrieval System

Neural Networks

http://speech.ee.ntu.edu.tw/~tlkagk/courses/MLDS_2015_2/Lecture/DNN%20(v4).pdf

MLP Multiclass Z1xL1=X1x785 W785xL1

+f(Z1xL1)

Sigmoid funciton

Z1xL2=X1xL1 WL1xL2

+f(Z1xL2)

Page 10: Pycon2016- Applying Deep Learning in Information Retrieval System

Convolutional Neural Networks

http://www.slideshare.net/tw_dsconf/ss-62245351

translation invariance

subsampling

Conv + Pooling Conv + Pooling MLP

Page 11: Pycon2016- Applying Deep Learning in Information Retrieval System

Feature Vector Representation

Bengio, 2014, Representation Learning: A Review and New Perspectives

Feature Vector

Representation Learning

http://deeplearning4j.org/convolutionalnets

NN feature

extractor

Page 12: Pycon2016- Applying Deep Learning in Information Retrieval System

Feature Vector Representation

InputNeural Networks

including MLP, CNN, RNN

Feature Vector

[ 0.25, 0.33…, 0.78 ]

Encoding

Matching

Feature Vector 1

Feature Vector 2

Similarity Function Score

• cosine similarity • v1TM v2

Page 13: Pycon2016- Applying Deep Learning in Information Retrieval System

Outline

1. Information Retrieval 2. Neural Networks and Convolutional Neural Networks 3. Feature Vector Representation 4. Sentence Retrieval 5. Image Retrieval 6. Conclusion

Page 14: Pycon2016- Applying Deep Learning in Information Retrieval System

<Pad> <Pad> <Pad> <Pad>

Sentence Retrieval

http://emnlp2014.org/papers/pdf/EMNLP2014181.pdf

Yoon Kim, 2014, Convolutional Neural Networks for Sentence Classification

Neural Net Architecture

NN feature

extractor

1 of K (one-hot) +

word embedding

Conv + MaxPooling

Page 15: Pycon2016- Applying Deep Learning in Information Retrieval System

Sentence Retrieval

Results: • Training acc: 99% up • Validation acc: 99% up

Experiment: • 5 classes sentences • Training Set 80% • Validation Set 20%

Feature vector PCA tSNE

Page 16: Pycon2016- Applying Deep Learning in Information Retrieval System

Sentence Retrieval

Recurrent Neural Network

Kyunghyun Cho et. al., 2014, Learning Phrase Representations using RNN Encoder–Decoder for Statistical Machine Translation

https://devblogs.nvidia.com/parallelforall/introduction-neural-machine-translation-gpus-part-2/

Page 17: Pycon2016- Applying Deep Learning in Information Retrieval System

Skip-Thought Vectors

Skip-Thought Vectors http://arxiv.org/pdf/1506.06726v1.pdf

Encode a sentence into a thought vector hi by predicting its neighbor sentence.

Ryan Kiros et. al., 2015, Skip-Thought Vectors

… I just got back home. I could see the cat on the steps. This was strange. …

Page 18: Pycon2016- Applying Deep Learning in Information Retrieval System

Channel A

http://www.cherry123.com/data/book/14299/book14299_2.html

Skip-Thought Vectors

? ?

?

?

?

?

?

! ? !

?

, ,

Page 19: Pycon2016- Applying Deep Learning in Information Retrieval System

Semantic Similarity

Skip-Thought Vectors

query sen skt result skt score

… … 0.934

0.918

0.901

0.898

0.889

0.861

0.836

0.831

0.812

0.777

0.765

Page 20: Pycon2016- Applying Deep Learning in Information Retrieval System

Reference Relationship

Skip-Thought Vectors

query sen skt result skt score

0.898

0.916

0.836

… … 0.755

0.757

0.763

Page 21: Pycon2016- Applying Deep Learning in Information Retrieval System

LimitationsSkip-Thought Vectors

• Requiring huge size of corpus • … I just got back home. I could see the cat on the steps. This was strange. … • … I got back to office. I could see the cat on the steps. This was cool. …

11,051 novels with 17,515,150 sentences

• Scenario dependency

query sen skt result skt score

0.697

… … 0.697

0.697

Page 22: Pycon2016- Applying Deep Learning in Information Retrieval System

Something InterestingSkip-Thought Vectors

query sen skt result skt score

0.889

0.697

skip-thought knows: = I’m ?

skip-thought knows: = ?

Page 23: Pycon2016- Applying Deep Learning in Information Retrieval System

Image Retrieval

“A cat” Image Input

Expected Outcome:

Feature Vector Calculation

Matching Database

Page 24: Pycon2016- Applying Deep Learning in Information Retrieval System

Image Retrieval

Input Image

pre-processing

(2)

(1)

Hashing Vector Layer

FC + Softmax Layer

.

.

.

.

.

.

CNN network

1st: various targets

Step1 Training

copy

CNN network

Step2Training

Kevin Lin et. al, 2015, Deep Learning of Binary Hash Codes for Fast Image Retrieval

.

.

.

.

.

.

2nd: task specific targets

encoding application Hashing

Vector Layer

copy

CNN network

copy

Feature Vector

AlexNet VGG

Page 25: Pycon2016- Applying Deep Learning in Information Retrieval System

Image Retrieval Kevin Lin et. al, 2015, Deep Learning of Binary Hash Codes for Fast Image Retrieval

Demohttp://tweddielin.pythonanywhere.com/

https://github.com/tweddielin/flask-imsearchGithub

Page 26: Pycon2016- Applying Deep Learning in Information Retrieval System

Conclusion

1. Deep Learning => Trainable Feature Extractor 2. Type of Neural Nets: MLP, CNN, RNN 3.

• http://www.slideshare.net/tw_dsconf/ss-62245351

• http://speech.ee.ntu.edu.tw/~tlkagk/courses_MLSD15_2.html

Page 27: Pycon2016- Applying Deep Learning in Information Retrieval System

Backup

Page 28: Pycon2016- Applying Deep Learning in Information Retrieval System

Convolutional Neural Networks

http://cs231n.github.io/convolutional-networks/More Information

1 1 2 4

5 6 7 8

3 2 1 -2

1 2 3 4

ReLU

max(0,x)

Convolved Feature

MaxPooling