Cosine Similarity ← Natural Language Processing ← Socratica @Socratica
Cosine Similarity ← Natural Language Processing ← Socratica  @Socratica
Uploaded February 2024 | Updated September 2026, 2 weeks ago
𝙄𝙣𝙩𝙧𝙀𝙙𝙪𝙘𝙞𝙣𝙜 𝙎𝙀𝙘𝙧𝙖𝙩𝙞𝙘𝙖 𝘟𝙊𝙐𝙍𝙎𝙀𝙎
socratica.com/collections

Cosine Similarity is a way to compare two pieces of text (docs) to see how similar they are stylistically. This is a useful technique from Natural Language Processing, a growing subfield of AI & Machine Learning. In this lesson, we review how to use the bag of words technique to turn a piece of text into a vector, then show how the 'cosine similarity' measure is a useful way to compare two docs. As a concrete application, we compare 10 different classic novels from different authors and time periods to see how well the cosine similarity measure performs.

𝙔𝙀𝙪 𝙘𝙖𝙣 𝙟𝙪𝙢𝙥 𝙩𝙀 𝙚𝙚𝙘𝙩𝙞𝙀𝙣𝙚 𝙀𝙛 𝙩𝙝𝙚 𝙫𝙞𝙙𝙚𝙀 𝙝𝙚𝙧𝙚:
0:00 Intro
0:48 Prerequisites
1:43 The Big Idea
3:39 Cosine Similarity
4:42 Example setup
5:47 The Books
6:51 Building a Feature Vector
8:56 Writing the Functions
10:08 Computing Cosine similarities
11:30 No Stop Words
12:50 Analysis
14:00 No Nouns

𝙒𝘌𝙏𝘟𝙃 𝙉𝙀𝙓𝙏:
Bag of Words
youtu.be/kLMhePA3BiY

Use Mathematica for Free
youtu.be/rGzmG1uXklM

BTW—Socratica offers a pro course, 'Mathematica Essentials,' providing key concepts for mastering Wolfram products:
socratica.com/courses/mathematica-essentials

Thank you to our VIP Patreon Members who helped make this video possible!
José Juan Francisco Castillo Rivera
KW
M Andrews
Jim Woodworth
Marcos Silveira
Christopher Kemsley
Eric Eccleston
Jeremy Shimanek
Michael Shebanow
Alvin Khaled
Kevin B
John Krawiec
Umar Khan
Tracy Karin Prell
— Thank you kind friends! 💜🊉

✷✷✷
We recommend the following (affiliate links):
The Wolfram Language
amzn.to/3D4jqvz

The Mythical Man Month - Essays on Software Engineering & Project Management
amzn.to/2tYdNeP

Innumeracy: Mathematical Illiteracy and Its Consequences
amzn.to/2ri1nf7

Mindset by Carol Dweck
amzn.to/2q9y8Nj

How to Be a Great Student (our first book!)
ebook: amzn.to/2Lh3XSP
Paperback: amzn.to/3t5jeH3
Kindle Unlimited: amzn.to/3atr8TJ

✷✷✷
If you find our work at Socratica valuable, please consider becoming our Patron on Patreon!
patreon.com/socratica

If you would prefer to make a one-time donation, you can also use
Socratica Paypal
paypal.me/socratica

✷✷✷
Written & Produced by Michael Harrison & Kimberly Hatch Harrison
Edited by Megi Shuke

About our Instructors:

Michael earned his BS in Math from Caltech, and did his graduate work in Math at UC Berkeley and University of Washington, specializing in Number Theory. A self-taught programmer, Michael taught both Math and Computer Programming at the college level. He applied this knowledge as a financial analyst (quant) and as a programmer at Google.

Kimberly earned her BS in Biology and another BS in English at Caltech. She did her graduate work in Molecular Biology at Princeton, specializing in Immunology and Neurobiology. Kimberly spent 16+ years as a research scientist and a dozen years as a biology and chemistry instructor.

Michael and Kimberly Harrison co-founded Socratica.
Their mission? To create the education of the future.

✷✷✷
Welcome to Socratica! We make SMART videos focusing on STEM - science, math, programming. Subscribe here: bit.ly/SocraticaSubscribe

PLAYLISTS
Study Tips bit.ly/StudyTipsPlaylist
Python programming bit.ly/PythonSocratica
SQL programming bit.ly/SQL_Socratica
Chemistry bit.ly/Chemistry_Playlist
Abstract Algebra bit.ly/AbstractAlgebra
Astronomy bit.ly/AstronomySocratica
Biology bit.ly/BiologySocratica
Calculus bit.ly/CalculusSocratica
Geometry bit.ly/GeometrySocratica
Mathematica bit.ly/SocraticaMathematica

#cosinesimilarity #AI #naturallanguageprocessing
Cosine Similarity ← Natural Language Processing ← SocraticaSOCRATICA + MATHEMATICA = PROPython & Socratica - #ShortsBe a MATH HERO with Mathematica & SocraticaNormal Subgroups and Quotient Groups (aka Factor Groups) - Abstract AlgebraIntro to Spreads with Stock Options — Finance Lessons for QuantsWhat is Chemistry? 5 Branches of ChemistryTAKE NOTE — Active Reading — Study Tips #shortsCan You Read Faster? - Study Tips - Speed Reading TechniquesCOOKIES and CybersecurityGive better gifts guide 🎁 12 gifts for GREAT studentsSciPy - A Scientific Extension of NumPy | Python
Socratica |

Cosine Similarity ← Natural Language Processing ← Socratica

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER