Sha256: e5bdd47fb4d5c0081553eb15cb847e45bb47b38a32ceee867f1c5c665736f834

Contents?: true

Size: 371 Bytes

Versions: 3

Compression:

Stored size: 371 Bytes

Contents

require "ruby-spacy"

nlp = Spacy::Language.new("en_core_web_lg")
doc1 = nlp.read("I like salty fries and hamburgers.")
doc2 = nlp.read("Fast food tastes very good.")

puts "Doc 1: " + doc1
puts "Doc 2: " + doc2
puts "Similarity: #{doc1.similarity(doc2)}"

# Doc 1: I like salty fries and hamburgers.
# Doc 2: Fast food tastes very good.
# Similarity: 0.7687607012190486

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ruby-spacy-0.1.2 examples/get_started/similarity.rb
ruby-spacy-0.1.1 examples/get_started/similarity.rb
ruby-spacy-0.1.0 examples/get_started/similarity.rb