SlideShare a Scribd company logo
Pip install driven
deep learning
Denis Sergienko
Rails Reactor
ML includes
ML Engineer
Data Scientist
Training data
Training infrastructure
Data preparation
Models training
Experiments
Evaluation
Deployment
Neural networks
https://commons.wikimedia.org/wiki/File:Artificial_neural_network.svg
Neural networks
Neural networks
COMPUTER VISION
Face detection
Photo from Open Images dataset
Face detection with OpenCV
import cv2
face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
img = cv2.imread("test_image.jpg")
img = cv2.resize(img, (1024, 768))
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
gray = cv2.cvtColor(img, cv2.COLOR_RGB2GRAY)
faces = face_cascade.detectMultiScale(gray, 1.1, 4)
for (x, y, w, h) in faces:
cv2.rectangle(img, (x, y), (x+w, y+h), (255, 255, 255), 5)
pip install opencv-python
Face detection with OpenCV
~230ms for 1024x768 image on Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz
Face processing with face_recognition
https://github.com/ageitgey/face_recognition
Face processing with face_recognition
import face_recognition
img = face_recognition.load_image_file("test_image.jpg")
face_locations = face_recognition.face_locations(img)
face_encodings = face_recognition.face_encodings(img, face_locations)
print(face_encodings[0])
for (y1, x1, y2, x2) in face_locations:
cv2.rectangle(img, (x1, y1), (x2, y2), (255, 255, 255), 5)
Face processing with face_recognition
~500ms for 1024x768 image on Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz
face_recognition face encodings
[-1.53406277e-01, 7.34197125e-02, 6.22343011e-02, 2.74792314e-03,
-1.57757625e-01, -3.44386743e-03, -3.86646464e-02, 3.81346559e-03,
1.34139627e-01, -2.37786956e-02, 1.50458574e-01, -1.82383899e-02,
-2.00692132e-01, 2.54428945e-02, -8.35503787e-02, 8.91055465e-02,
-1.34999692e-01, -1.38403967e-01, -1.94509141e-03, -2.76396908e-02,
7.65011981e-02, 5.99545725e-02, -2.67361160e-02, 8.64139497e-02,
-1.05263099e-01, -2.57028311e-01, -6.59355745e-02, -6.60505146e-02,
2.00792030e-03, -9.47101340e-02, -4.30351272e-02, 1.61789767e-02,
-1.93842828e-01, -1.88902766e-03, -5.59503213e-03, 5.93306050e-02,
3.08027603e-02, 4.00841236e-06, 1.81151792e-01, 4.04844396e-02,
-1.94502324e-01, 4.00878489e-02, 3.23042385e-02, 3.15126538e-01,
1.87466532e-01, 2.70547774e-02, -2.12351028e-02, -5.77141233e-02,
1.13720685e-01, -2.84361243e-01, 6.61392957e-02, 2.05567792e-01,
1.19581595e-01, 5.21309301e-03, 3.98933841e-03, -1.06219955e-01,
-4.64719236e-02, 1.17458284e-01, -1.06732622e-01, 8.52644444e-02,
5.99832870e-02, 2.44516134e-03, -1.12115061e-02, -1.13738239e-01,
1.81140810e-01, 7.71739632e-02, -8.50351304e-02, -1.69618860e-01,
9.19920430e-02, -1.70908883e-01, -9.62008089e-02, 1.39822483e-01,
-1.24618910e-01, -1.88907489e-01, -2.39977300e-01, 9.80893075e-02,
4.42225605e-01, 1.22307248e-01, -1.32055923e-01, 7.27334693e-02,
-8.66499916e-02, -1.79484040e-02, 3.45968269e-02, 2.60131024e-02,
-8.96709561e-02, 3.88366021e-02, -1.12767063e-01, 1.01631664e-01,
2.66246736e-01, -3.26854028e-02, -5.24140056e-03, 1.77416772e-01,
4.87578101e-02, 4.56356853e-02, 8.57064780e-03, 3.35841253e-02,
2.69737486e-02, 2.23426335e-02, -1.39297083e-01, 2.52203364e-02,
1.91986673e-02, -5.72529212e-02, 9.17259324e-03, 7.66231045e-02,
-2.18871102e-01, 8.93882960e-02, 3.31270974e-04, -5.46076559e-02,
-5.42774051e-02, 1.48810530e-02, -1.42202020e-01, 2.89437734e-02,
1.72604963e-01, -2.54900217e-01, 1.95765272e-01, 1.25853226e-01,
5.95723726e-02, 9.47328135e-02, 4.61505465e-02, 3.43371816e-02,
3.79003584e-04, -4.46776785e-02, -9.75686088e-02, -4.58939746e-02,
1.02416836e-01, -5.21236807e-02, 6.40562549e-02, 3.29996943e-02]
Embedding
https://towardsdatascience.com/a-comprehensive-guide-to-convolutional-neural-networks-the-eli5-way-3bd2b1164a53
Face distance
import face_recognition
def encoding(photo):
img = face_recognition.load_image_file(photo)
face_locations = face_recognition.face_locations(img)
return face_recognition.face_encodings(img, face_locations)[0]
print(face_recognition.face_distance([encoding("keanu_1.jpg")], encoding("keanu_2.jpg")))
print(face_recognition.face_distance([encoding("keanu_2.jpg")], encoding("adam_driver.jpeg")))
0.373 0.658
Object detection with Keras
https://keras.io/applications/
Object detection with Keras
from keras.applications.resnet50 import ResNet50
from keras.preprocessing import image
from keras.applications.resnet50 import preprocess_input, decode_predictions
import numpy as np
model = ResNet50(weights="imagenet")
img = image.load_img("mycat.jpg", target_size=(224, 224))
x = image.img_to_array(img)
x = np.expand_dims(x, axis=0)
x = preprocess_input(x)
predictions = model.predict(x)
decoded_predictions = decode_predictions(predictions, top=5)[0]
for label_id, label_name, probability in decoded_predictions:
print(label_id, label_name, probability)
Object detection with Keras
n02124075 Egyptian_cat 0.28732845
n02123159 tiger_cat 0.23341466
n02123045 tabby 0.08286285
n02971356 carton 0.04206756
n02808304 bath_towel 0.028219415
YOLO
https://pjreddie.com/darknet/yolo/
YOLO
https://arxiv.org/abs/1804.02767
NATURAL LANGUAGE
PROCESSING
Spacy
pip install spacy
python -m spacy download en_core_web_lg
https://spacy.io/
Spacy
import spacy
import en_core_web_lg
nlp = en_core_web_lg.load()
document = nlp("Kyiv is the capital and most populous city of Ukraine.")
pprint([(token.text, token.pos_, token.dep_, token.head.text) for token in document])
[('Kyiv', 'PROPN', 'nsubj', 'is'),
('is', 'AUX', 'ROOT', 'is'),
('the', 'DET', 'det', 'capital'),
('capital', 'NOUN', 'attr', 'is'),
('and', 'CCONJ', 'cc', 'capital'),
('most', 'ADV', 'advmod', 'populous'),
('populous', 'ADJ', 'amod', 'city'),
('city', 'NOUN', 'conj', 'capital'),
('of', 'ADP', 'prep', 'city'),
('Ukraine', 'PROPN', 'pobj', 'of'),
('.', 'PUNCT', 'punct', 'is')]
Spacy
test_text = "Kyiv is the capital and most populous city of Ukraine. It is in
north-central Ukraine along the Dnieper River. Its population in July 2015 was 2,887,974,
making Kiev the 7th most populous city in Europe."
document = nlp(test_text)
pprint([(ent.text, ent.label_) for ent in document.ents])
[('Kyiv', 'GPE'),
('Ukraine', 'GPE'),
('Ukraine', 'GPE'),
('the Dnieper River', 'LOC'),
('July 2015', 'DATE'),
('2,887,974', 'CARDINAL'),
('Kiev', 'GPE'),
('7th', 'ORDINAL'),
('Europe', 'LOC')]
spacy.explain("GPE")
'Countries, cities, states'
Spacy
vector = nlp("hello").vector
vector[:10]
array([0.25233, 0.10176, -0.67485, 0.21117, 0.43492, 0.16542, 0.48261, -0.81222,
0.041321, 0.78502], dtype=float32)
nlp("I like pizza").similarity(nlp("I like burgers")) # 0.924
nlp("I like pizza").similarity(nlp("Kyiv is the capital of Ukraine")) # 0.27
nlp("cat").similarity(nlp("dog")) # 0.80
nlp("cat").similarity(nlp("car")) # 0.31
Thank you!
@zxftr45Twitter: Company: RailsReactor

More Related Content

Similar to Denis Sergienko "Pip install driven deep learning"

This face recognition attendance system code for face recogn.pdf
This face recognition attendance system code for face recogn.pdfThis face recognition attendance system code for face recogn.pdf
This face recognition attendance system code for face recogn.pdf
adislifestyle
 
Heroku pop-behind-the-sense
Heroku pop-behind-the-senseHeroku pop-behind-the-sense
Heroku pop-behind-the-sense
Ben Lin
 
Can someone please explain what the code below is doing and comment on.pdf
Can someone please explain what the code below is doing and comment on.pdfCan someone please explain what the code below is doing and comment on.pdf
Can someone please explain what the code below is doing and comment on.pdf
kuldeepkumarapgsi
 
Python program to build deep learning algorithm using a CNNs model to.docx
Python program to build deep learning algorithm using a CNNs model to.docxPython program to build deep learning algorithm using a CNNs model to.docx
Python program to build deep learning algorithm using a CNNs model to.docx
LukeQVdGrantg
 
Using the code below- I need help with the following 3 things- 1) Writ.pdf
Using the code below- I need help with the following 3 things- 1) Writ.pdfUsing the code below- I need help with the following 3 things- 1) Writ.pdf
Using the code below- I need help with the following 3 things- 1) Writ.pdf
acteleshoppe
 
Machine Learning - Introduction
Machine Learning - IntroductionMachine Learning - Introduction
Machine Learning - Introduction
Empatika
 
Viktor Tsykunov: Azure Machine Learning Service
Viktor Tsykunov: Azure Machine Learning ServiceViktor Tsykunov: Azure Machine Learning Service
Viktor Tsykunov: Azure Machine Learning Service
Lviv Startup Club
 
Need helping adding to the code below to plot the images from the firs.pdf
Need helping adding to the code below to plot the images from the firs.pdfNeed helping adding to the code below to plot the images from the firs.pdf
Need helping adding to the code below to plot the images from the firs.pdf
actexerode
 
Using the code below- I need help with creating code for the following.pdf
Using the code below- I need help with creating code for the following.pdfUsing the code below- I need help with creating code for the following.pdf
Using the code below- I need help with creating code for the following.pdf
acteleshoppe
 
Hello- I hope you are doing well- I am doing my project- which is Rans (1).pdf
Hello- I hope you are doing well- I am doing my project- which is Rans (1).pdfHello- I hope you are doing well- I am doing my project- which is Rans (1).pdf
Hello- I hope you are doing well- I am doing my project- which is Rans (1).pdf
Ian0J2Bondo
 
Eugene Khvedchenya. State of the art Image Augmentations with Albumentations.
Eugene Khvedchenya. State of the art Image Augmentations with Albumentations.Eugene Khvedchenya. State of the art Image Augmentations with Albumentations.
Eugene Khvedchenya. State of the art Image Augmentations with Albumentations.
Lviv Startup Club
 
What is the UML Class diagram for accident detection using CNN- i have.pdf
What is the UML Class diagram for accident detection using CNN- i have.pdfWhat is the UML Class diagram for accident detection using CNN- i have.pdf
What is the UML Class diagram for accident detection using CNN- i have.pdf
anilagarwal8880432
 
A basic introduction to open cv for image processing
A basic introduction to open cv for image processingA basic introduction to open cv for image processing
A basic introduction to open cv for image processingChu Lam
 
Python OpenCV Real Time projects
Python OpenCV Real Time projectsPython OpenCV Real Time projects
Python OpenCV Real Time projects
Amarjeetsingh Thakur
 
Viktor Tsykunov "Microsoft AI platform for every Developer"
Viktor Tsykunov "Microsoft AI platform for every Developer"Viktor Tsykunov "Microsoft AI platform for every Developer"
Viktor Tsykunov "Microsoft AI platform for every Developer"
Lviv Startup Club
 
I have tried running this code below- and it is working- but the accur.pdf
I have tried running this code below- and it is working- but the accur.pdfI have tried running this code below- and it is working- but the accur.pdf
I have tried running this code below- and it is working- but the accur.pdf
GordonF2XPatersonh
 
You are task to add a yawning detection to the programme below;i.pdf
You are task to add a yawning detection to the programme below;i.pdfYou are task to add a yawning detection to the programme below;i.pdf
You are task to add a yawning detection to the programme below;i.pdf
sales223546
 
Pydata DC 2018 (Skorch - A Union of Scikit-learn and PyTorch)
Pydata DC 2018 (Skorch - A Union of Scikit-learn and PyTorch)Pydata DC 2018 (Skorch - A Union of Scikit-learn and PyTorch)
Pydata DC 2018 (Skorch - A Union of Scikit-learn and PyTorch)
Thomas Fan
 
Learning Predictive Modeling with TSA and Kaggle
Learning Predictive Modeling with TSA and KaggleLearning Predictive Modeling with TSA and Kaggle
Learning Predictive Modeling with TSA and Kaggle
Yvonne K. Matos
 
Need an detailed analysis of what this code-model is doing- Thanks #St.pdf
Need an detailed analysis of what this code-model is doing- Thanks #St.pdfNeed an detailed analysis of what this code-model is doing- Thanks #St.pdf
Need an detailed analysis of what this code-model is doing- Thanks #St.pdf
actexerode
 

Similar to Denis Sergienko "Pip install driven deep learning" (20)

This face recognition attendance system code for face recogn.pdf
This face recognition attendance system code for face recogn.pdfThis face recognition attendance system code for face recogn.pdf
This face recognition attendance system code for face recogn.pdf
 
Heroku pop-behind-the-sense
Heroku pop-behind-the-senseHeroku pop-behind-the-sense
Heroku pop-behind-the-sense
 
Can someone please explain what the code below is doing and comment on.pdf
Can someone please explain what the code below is doing and comment on.pdfCan someone please explain what the code below is doing and comment on.pdf
Can someone please explain what the code below is doing and comment on.pdf
 
Python program to build deep learning algorithm using a CNNs model to.docx
Python program to build deep learning algorithm using a CNNs model to.docxPython program to build deep learning algorithm using a CNNs model to.docx
Python program to build deep learning algorithm using a CNNs model to.docx
 
Using the code below- I need help with the following 3 things- 1) Writ.pdf
Using the code below- I need help with the following 3 things- 1) Writ.pdfUsing the code below- I need help with the following 3 things- 1) Writ.pdf
Using the code below- I need help with the following 3 things- 1) Writ.pdf
 
Machine Learning - Introduction
Machine Learning - IntroductionMachine Learning - Introduction
Machine Learning - Introduction
 
Viktor Tsykunov: Azure Machine Learning Service
Viktor Tsykunov: Azure Machine Learning ServiceViktor Tsykunov: Azure Machine Learning Service
Viktor Tsykunov: Azure Machine Learning Service
 
Need helping adding to the code below to plot the images from the firs.pdf
Need helping adding to the code below to plot the images from the firs.pdfNeed helping adding to the code below to plot the images from the firs.pdf
Need helping adding to the code below to plot the images from the firs.pdf
 
Using the code below- I need help with creating code for the following.pdf
Using the code below- I need help with creating code for the following.pdfUsing the code below- I need help with creating code for the following.pdf
Using the code below- I need help with creating code for the following.pdf
 
Hello- I hope you are doing well- I am doing my project- which is Rans (1).pdf
Hello- I hope you are doing well- I am doing my project- which is Rans (1).pdfHello- I hope you are doing well- I am doing my project- which is Rans (1).pdf
Hello- I hope you are doing well- I am doing my project- which is Rans (1).pdf
 
Eugene Khvedchenya. State of the art Image Augmentations with Albumentations.
Eugene Khvedchenya. State of the art Image Augmentations with Albumentations.Eugene Khvedchenya. State of the art Image Augmentations with Albumentations.
Eugene Khvedchenya. State of the art Image Augmentations with Albumentations.
 
What is the UML Class diagram for accident detection using CNN- i have.pdf
What is the UML Class diagram for accident detection using CNN- i have.pdfWhat is the UML Class diagram for accident detection using CNN- i have.pdf
What is the UML Class diagram for accident detection using CNN- i have.pdf
 
A basic introduction to open cv for image processing
A basic introduction to open cv for image processingA basic introduction to open cv for image processing
A basic introduction to open cv for image processing
 
Python OpenCV Real Time projects
Python OpenCV Real Time projectsPython OpenCV Real Time projects
Python OpenCV Real Time projects
 
Viktor Tsykunov "Microsoft AI platform for every Developer"
Viktor Tsykunov "Microsoft AI platform for every Developer"Viktor Tsykunov "Microsoft AI platform for every Developer"
Viktor Tsykunov "Microsoft AI platform for every Developer"
 
I have tried running this code below- and it is working- but the accur.pdf
I have tried running this code below- and it is working- but the accur.pdfI have tried running this code below- and it is working- but the accur.pdf
I have tried running this code below- and it is working- but the accur.pdf
 
You are task to add a yawning detection to the programme below;i.pdf
You are task to add a yawning detection to the programme below;i.pdfYou are task to add a yawning detection to the programme below;i.pdf
You are task to add a yawning detection to the programme below;i.pdf
 
Pydata DC 2018 (Skorch - A Union of Scikit-learn and PyTorch)
Pydata DC 2018 (Skorch - A Union of Scikit-learn and PyTorch)Pydata DC 2018 (Skorch - A Union of Scikit-learn and PyTorch)
Pydata DC 2018 (Skorch - A Union of Scikit-learn and PyTorch)
 
Learning Predictive Modeling with TSA and Kaggle
Learning Predictive Modeling with TSA and KaggleLearning Predictive Modeling with TSA and Kaggle
Learning Predictive Modeling with TSA and Kaggle
 
Need an detailed analysis of what this code-model is doing- Thanks #St.pdf
Need an detailed analysis of what this code-model is doing- Thanks #St.pdfNeed an detailed analysis of what this code-model is doing- Thanks #St.pdf
Need an detailed analysis of what this code-model is doing- Thanks #St.pdf
 

More from Fwdays

"What I learned through reverse engineering", Yuri Artiukh
"What I learned through reverse engineering", Yuri Artiukh"What I learned through reverse engineering", Yuri Artiukh
"What I learned through reverse engineering", Yuri Artiukh
Fwdays
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
Fwdays
 
"Micro frontends: Unbelievably true life story", Dmytro Pavlov
"Micro frontends: Unbelievably true life story", Dmytro Pavlov"Micro frontends: Unbelievably true life story", Dmytro Pavlov
"Micro frontends: Unbelievably true life story", Dmytro Pavlov
Fwdays
 
"Objects validation and comparison using runtime types (io-ts)", Oleksandr Suhak
"Objects validation and comparison using runtime types (io-ts)", Oleksandr Suhak"Objects validation and comparison using runtime types (io-ts)", Oleksandr Suhak
"Objects validation and comparison using runtime types (io-ts)", Oleksandr Suhak
Fwdays
 
"JavaScript. Standard evolution, when nobody cares", Roman Savitskyi
"JavaScript. Standard evolution, when nobody cares", Roman Savitskyi"JavaScript. Standard evolution, when nobody cares", Roman Savitskyi
"JavaScript. Standard evolution, when nobody cares", Roman Savitskyi
Fwdays
 
"How Preply reduced ML model development time from 1 month to 1 day",Yevhen Y...
"How Preply reduced ML model development time from 1 month to 1 day",Yevhen Y..."How Preply reduced ML model development time from 1 month to 1 day",Yevhen Y...
"How Preply reduced ML model development time from 1 month to 1 day",Yevhen Y...
Fwdays
 
"GenAI Apps: Our Journey from Ideas to Production Excellence",Danil Topchii
"GenAI Apps: Our Journey from Ideas to Production Excellence",Danil Topchii"GenAI Apps: Our Journey from Ideas to Production Excellence",Danil Topchii
"GenAI Apps: Our Journey from Ideas to Production Excellence",Danil Topchii
Fwdays
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
Fwdays
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
Fwdays
 
"What is a RAG system and how to build it",Dmytro Spodarets
"What is a RAG system and how to build it",Dmytro Spodarets"What is a RAG system and how to build it",Dmytro Spodarets
"What is a RAG system and how to build it",Dmytro Spodarets
Fwdays
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
Fwdays
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
Fwdays
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
Fwdays
 
"Distributed graphs and microservices in Prom.ua", Maksym Kindritskyi
"Distributed graphs and microservices in Prom.ua",  Maksym Kindritskyi"Distributed graphs and microservices in Prom.ua",  Maksym Kindritskyi
"Distributed graphs and microservices in Prom.ua", Maksym Kindritskyi
Fwdays
 
"Rethinking the existing data loading and processing process as an ETL exampl...
"Rethinking the existing data loading and processing process as an ETL exampl..."Rethinking the existing data loading and processing process as an ETL exampl...
"Rethinking the existing data loading and processing process as an ETL exampl...
Fwdays
 
"How Ukrainian IT specialist can go on vacation abroad without crossing the T...
"How Ukrainian IT specialist can go on vacation abroad without crossing the T..."How Ukrainian IT specialist can go on vacation abroad without crossing the T...
"How Ukrainian IT specialist can go on vacation abroad without crossing the T...
Fwdays
 
"The Strength of Being Vulnerable: the experience from CIA, Tesla and Uber", ...
"The Strength of Being Vulnerable: the experience from CIA, Tesla and Uber", ..."The Strength of Being Vulnerable: the experience from CIA, Tesla and Uber", ...
"The Strength of Being Vulnerable: the experience from CIA, Tesla and Uber", ...
Fwdays
 
"[QUICK TALK] Radical candor: how to achieve results faster thanks to a cultu...
"[QUICK TALK] Radical candor: how to achieve results faster thanks to a cultu..."[QUICK TALK] Radical candor: how to achieve results faster thanks to a cultu...
"[QUICK TALK] Radical candor: how to achieve results faster thanks to a cultu...
Fwdays
 
"[QUICK TALK] PDP Plan, the only one door to raise your salary and boost care...
"[QUICK TALK] PDP Plan, the only one door to raise your salary and boost care..."[QUICK TALK] PDP Plan, the only one door to raise your salary and boost care...
"[QUICK TALK] PDP Plan, the only one door to raise your salary and boost care...
Fwdays
 
"4 horsemen of the apocalypse of working relationships (+ antidotes to them)"...
"4 horsemen of the apocalypse of working relationships (+ antidotes to them)"..."4 horsemen of the apocalypse of working relationships (+ antidotes to them)"...
"4 horsemen of the apocalypse of working relationships (+ antidotes to them)"...
Fwdays
 

More from Fwdays (20)

"What I learned through reverse engineering", Yuri Artiukh
"What I learned through reverse engineering", Yuri Artiukh"What I learned through reverse engineering", Yuri Artiukh
"What I learned through reverse engineering", Yuri Artiukh
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
"Micro frontends: Unbelievably true life story", Dmytro Pavlov
"Micro frontends: Unbelievably true life story", Dmytro Pavlov"Micro frontends: Unbelievably true life story", Dmytro Pavlov
"Micro frontends: Unbelievably true life story", Dmytro Pavlov
 
"Objects validation and comparison using runtime types (io-ts)", Oleksandr Suhak
"Objects validation and comparison using runtime types (io-ts)", Oleksandr Suhak"Objects validation and comparison using runtime types (io-ts)", Oleksandr Suhak
"Objects validation and comparison using runtime types (io-ts)", Oleksandr Suhak
 
"JavaScript. Standard evolution, when nobody cares", Roman Savitskyi
"JavaScript. Standard evolution, when nobody cares", Roman Savitskyi"JavaScript. Standard evolution, when nobody cares", Roman Savitskyi
"JavaScript. Standard evolution, when nobody cares", Roman Savitskyi
 
"How Preply reduced ML model development time from 1 month to 1 day",Yevhen Y...
"How Preply reduced ML model development time from 1 month to 1 day",Yevhen Y..."How Preply reduced ML model development time from 1 month to 1 day",Yevhen Y...
"How Preply reduced ML model development time from 1 month to 1 day",Yevhen Y...
 
"GenAI Apps: Our Journey from Ideas to Production Excellence",Danil Topchii
"GenAI Apps: Our Journey from Ideas to Production Excellence",Danil Topchii"GenAI Apps: Our Journey from Ideas to Production Excellence",Danil Topchii
"GenAI Apps: Our Journey from Ideas to Production Excellence",Danil Topchii
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
"What is a RAG system and how to build it",Dmytro Spodarets
"What is a RAG system and how to build it",Dmytro Spodarets"What is a RAG system and how to build it",Dmytro Spodarets
"What is a RAG system and how to build it",Dmytro Spodarets
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
"Distributed graphs and microservices in Prom.ua", Maksym Kindritskyi
"Distributed graphs and microservices in Prom.ua",  Maksym Kindritskyi"Distributed graphs and microservices in Prom.ua",  Maksym Kindritskyi
"Distributed graphs and microservices in Prom.ua", Maksym Kindritskyi
 
"Rethinking the existing data loading and processing process as an ETL exampl...
"Rethinking the existing data loading and processing process as an ETL exampl..."Rethinking the existing data loading and processing process as an ETL exampl...
"Rethinking the existing data loading and processing process as an ETL exampl...
 
"How Ukrainian IT specialist can go on vacation abroad without crossing the T...
"How Ukrainian IT specialist can go on vacation abroad without crossing the T..."How Ukrainian IT specialist can go on vacation abroad without crossing the T...
"How Ukrainian IT specialist can go on vacation abroad without crossing the T...
 
"The Strength of Being Vulnerable: the experience from CIA, Tesla and Uber", ...
"The Strength of Being Vulnerable: the experience from CIA, Tesla and Uber", ..."The Strength of Being Vulnerable: the experience from CIA, Tesla and Uber", ...
"The Strength of Being Vulnerable: the experience from CIA, Tesla and Uber", ...
 
"[QUICK TALK] Radical candor: how to achieve results faster thanks to a cultu...
"[QUICK TALK] Radical candor: how to achieve results faster thanks to a cultu..."[QUICK TALK] Radical candor: how to achieve results faster thanks to a cultu...
"[QUICK TALK] Radical candor: how to achieve results faster thanks to a cultu...
 
"[QUICK TALK] PDP Plan, the only one door to raise your salary and boost care...
"[QUICK TALK] PDP Plan, the only one door to raise your salary and boost care..."[QUICK TALK] PDP Plan, the only one door to raise your salary and boost care...
"[QUICK TALK] PDP Plan, the only one door to raise your salary and boost care...
 
"4 horsemen of the apocalypse of working relationships (+ antidotes to them)"...
"4 horsemen of the apocalypse of working relationships (+ antidotes to them)"..."4 horsemen of the apocalypse of working relationships (+ antidotes to them)"...
"4 horsemen of the apocalypse of working relationships (+ antidotes to them)"...
 

Recently uploaded

Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 

Recently uploaded (20)

Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 

Denis Sergienko "Pip install driven deep learning"

  • 1. Pip install driven deep learning Denis Sergienko Rails Reactor
  • 2. ML includes ML Engineer Data Scientist Training data Training infrastructure Data preparation Models training Experiments Evaluation Deployment
  • 7. Face detection Photo from Open Images dataset
  • 8. Face detection with OpenCV import cv2 face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml') img = cv2.imread("test_image.jpg") img = cv2.resize(img, (1024, 768)) img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) gray = cv2.cvtColor(img, cv2.COLOR_RGB2GRAY) faces = face_cascade.detectMultiScale(gray, 1.1, 4) for (x, y, w, h) in faces: cv2.rectangle(img, (x, y), (x+w, y+h), (255, 255, 255), 5) pip install opencv-python
  • 9. Face detection with OpenCV ~230ms for 1024x768 image on Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz
  • 10. Face processing with face_recognition https://github.com/ageitgey/face_recognition
  • 11. Face processing with face_recognition import face_recognition img = face_recognition.load_image_file("test_image.jpg") face_locations = face_recognition.face_locations(img) face_encodings = face_recognition.face_encodings(img, face_locations) print(face_encodings[0]) for (y1, x1, y2, x2) in face_locations: cv2.rectangle(img, (x1, y1), (x2, y2), (255, 255, 255), 5)
  • 12. Face processing with face_recognition ~500ms for 1024x768 image on Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz
  • 13. face_recognition face encodings [-1.53406277e-01, 7.34197125e-02, 6.22343011e-02, 2.74792314e-03, -1.57757625e-01, -3.44386743e-03, -3.86646464e-02, 3.81346559e-03, 1.34139627e-01, -2.37786956e-02, 1.50458574e-01, -1.82383899e-02, -2.00692132e-01, 2.54428945e-02, -8.35503787e-02, 8.91055465e-02, -1.34999692e-01, -1.38403967e-01, -1.94509141e-03, -2.76396908e-02, 7.65011981e-02, 5.99545725e-02, -2.67361160e-02, 8.64139497e-02, -1.05263099e-01, -2.57028311e-01, -6.59355745e-02, -6.60505146e-02, 2.00792030e-03, -9.47101340e-02, -4.30351272e-02, 1.61789767e-02, -1.93842828e-01, -1.88902766e-03, -5.59503213e-03, 5.93306050e-02, 3.08027603e-02, 4.00841236e-06, 1.81151792e-01, 4.04844396e-02, -1.94502324e-01, 4.00878489e-02, 3.23042385e-02, 3.15126538e-01, 1.87466532e-01, 2.70547774e-02, -2.12351028e-02, -5.77141233e-02, 1.13720685e-01, -2.84361243e-01, 6.61392957e-02, 2.05567792e-01, 1.19581595e-01, 5.21309301e-03, 3.98933841e-03, -1.06219955e-01, -4.64719236e-02, 1.17458284e-01, -1.06732622e-01, 8.52644444e-02, 5.99832870e-02, 2.44516134e-03, -1.12115061e-02, -1.13738239e-01, 1.81140810e-01, 7.71739632e-02, -8.50351304e-02, -1.69618860e-01, 9.19920430e-02, -1.70908883e-01, -9.62008089e-02, 1.39822483e-01, -1.24618910e-01, -1.88907489e-01, -2.39977300e-01, 9.80893075e-02, 4.42225605e-01, 1.22307248e-01, -1.32055923e-01, 7.27334693e-02, -8.66499916e-02, -1.79484040e-02, 3.45968269e-02, 2.60131024e-02, -8.96709561e-02, 3.88366021e-02, -1.12767063e-01, 1.01631664e-01, 2.66246736e-01, -3.26854028e-02, -5.24140056e-03, 1.77416772e-01, 4.87578101e-02, 4.56356853e-02, 8.57064780e-03, 3.35841253e-02, 2.69737486e-02, 2.23426335e-02, -1.39297083e-01, 2.52203364e-02, 1.91986673e-02, -5.72529212e-02, 9.17259324e-03, 7.66231045e-02, -2.18871102e-01, 8.93882960e-02, 3.31270974e-04, -5.46076559e-02, -5.42774051e-02, 1.48810530e-02, -1.42202020e-01, 2.89437734e-02, 1.72604963e-01, -2.54900217e-01, 1.95765272e-01, 1.25853226e-01, 5.95723726e-02, 9.47328135e-02, 4.61505465e-02, 3.43371816e-02, 3.79003584e-04, -4.46776785e-02, -9.75686088e-02, -4.58939746e-02, 1.02416836e-01, -5.21236807e-02, 6.40562549e-02, 3.29996943e-02]
  • 15. Face distance import face_recognition def encoding(photo): img = face_recognition.load_image_file(photo) face_locations = face_recognition.face_locations(img) return face_recognition.face_encodings(img, face_locations)[0] print(face_recognition.face_distance([encoding("keanu_1.jpg")], encoding("keanu_2.jpg"))) print(face_recognition.face_distance([encoding("keanu_2.jpg")], encoding("adam_driver.jpeg"))) 0.373 0.658
  • 16. Object detection with Keras https://keras.io/applications/
  • 17. Object detection with Keras from keras.applications.resnet50 import ResNet50 from keras.preprocessing import image from keras.applications.resnet50 import preprocess_input, decode_predictions import numpy as np model = ResNet50(weights="imagenet") img = image.load_img("mycat.jpg", target_size=(224, 224)) x = image.img_to_array(img) x = np.expand_dims(x, axis=0) x = preprocess_input(x) predictions = model.predict(x) decoded_predictions = decode_predictions(predictions, top=5)[0] for label_id, label_name, probability in decoded_predictions: print(label_id, label_name, probability)
  • 18. Object detection with Keras n02124075 Egyptian_cat 0.28732845 n02123159 tiger_cat 0.23341466 n02123045 tabby 0.08286285 n02971356 carton 0.04206756 n02808304 bath_towel 0.028219415
  • 22. Spacy pip install spacy python -m spacy download en_core_web_lg https://spacy.io/
  • 23. Spacy import spacy import en_core_web_lg nlp = en_core_web_lg.load() document = nlp("Kyiv is the capital and most populous city of Ukraine.") pprint([(token.text, token.pos_, token.dep_, token.head.text) for token in document]) [('Kyiv', 'PROPN', 'nsubj', 'is'), ('is', 'AUX', 'ROOT', 'is'), ('the', 'DET', 'det', 'capital'), ('capital', 'NOUN', 'attr', 'is'), ('and', 'CCONJ', 'cc', 'capital'), ('most', 'ADV', 'advmod', 'populous'), ('populous', 'ADJ', 'amod', 'city'), ('city', 'NOUN', 'conj', 'capital'), ('of', 'ADP', 'prep', 'city'), ('Ukraine', 'PROPN', 'pobj', 'of'), ('.', 'PUNCT', 'punct', 'is')]
  • 24. Spacy test_text = "Kyiv is the capital and most populous city of Ukraine. It is in north-central Ukraine along the Dnieper River. Its population in July 2015 was 2,887,974, making Kiev the 7th most populous city in Europe." document = nlp(test_text) pprint([(ent.text, ent.label_) for ent in document.ents]) [('Kyiv', 'GPE'), ('Ukraine', 'GPE'), ('Ukraine', 'GPE'), ('the Dnieper River', 'LOC'), ('July 2015', 'DATE'), ('2,887,974', 'CARDINAL'), ('Kiev', 'GPE'), ('7th', 'ORDINAL'), ('Europe', 'LOC')] spacy.explain("GPE") 'Countries, cities, states'
  • 25. Spacy vector = nlp("hello").vector vector[:10] array([0.25233, 0.10176, -0.67485, 0.21117, 0.43492, 0.16542, 0.48261, -0.81222, 0.041321, 0.78502], dtype=float32) nlp("I like pizza").similarity(nlp("I like burgers")) # 0.924 nlp("I like pizza").similarity(nlp("Kyiv is the capital of Ukraine")) # 0.27 nlp("cat").similarity(nlp("dog")) # 0.80 nlp("cat").similarity(nlp("car")) # 0.31