Sha256: df95054f1ecc91540f52a42050592d615fbc6bd4e83b783475eaf45c9dafa8aa

Contents?: true

Size: 494 Bytes

Versions: 2

Compression:

Stored size: 494 Bytes

Contents

require "ruby-spacy"
require "terminal-table"

nlp = Spacy::Language.new("en_core_web_lg")

orange = nlp.vocab("orange")
lemon = nlp.vocab("lemon")

book = nlp.vocab("book")
magazine = nlp.vocab("magazine")

puts "orange <=> lemon:   #{orange.similarity(lemon)}"
puts "book   <=> magazine: #{book.similarity(magazine)}"
puts "orange <=> book: #{orange.similarity(book)}"

# orange <=> lemon:   0.7080526351928711
# book   <=> magazine: 0.4355940818786621
# orange <=> book: 0.12197211384773254

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ruby-spacy-0.1.4.1 examples/linguistic_features/similarity_between_lexemes.rb
ruby-spacy-0.1.4 examples/linguistic_features/similarity_between_lexemes.rb