Bird
0
0

Given two texts converted to sets of words: text1 = {'apple', 'banana', 'cherry'} and text2 = {'banana', 'cherry', 'date'}, what is the Jaccard similarity between them?

medium📝 Predict Output Q13 of 15
NLP - Text Similarity and Search
Given two texts converted to sets of words: text1 = {'apple', 'banana', 'cherry'} and text2 = {'banana', 'cherry', 'date'}, what is the Jaccard similarity between them?
A0.25
B0.6
C0.75
D0.5
Step-by-Step Solution
Solution:
  1. Step 1: Calculate intersection and union of sets

    Intersection = {'banana', 'cherry'} (2 items), Union = {'apple', 'banana', 'cherry', 'date'} (4 items).
  2. Step 2: Compute Jaccard similarity

    Jaccard similarity = size of intersection ÷ size of union = 2 ÷ 4 = 0.5.
  3. Final Answer:

    0.5 -> Option D
  4. Quick Check:

    Jaccard = intersection/union = 0.5 [OK]
Quick Trick: Jaccard = common words ÷ total unique words [OK]
Common Mistakes:
MISTAKES
  • Counting union incorrectly
  • Using sum instead of division
  • Confusing intersection with union size

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More NLP Quizzes