Get startedGet started for free

Comparing similarities

In this exercise, you'll be using spaCy's similarity methods to compare Doc, Token and Span objects and get similarity scores. The medium English model is already available as the nlp object.

This exercise is part of the course

Advanced NLP with spaCy

View Course

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

doc1 = nlp("It's a warm summer day")
doc2 = nlp("It's sunny outside")

# Get the similarity of doc1 and doc2
similarity = ____.____(____)
print(similarity)
Edit and Run Code