Sha256: 65345cba37d510ef45eb274c8d04c3bacc533bba3081b9432e6df39e34808a6c

Contents?: true

Size: 406 Bytes

Versions: 3

Compression:

Stored size: 406 Bytes

Contents

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

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.text
puts "Doc 2: " + doc2.text
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.4.1 examples/linguistic_features/similarity.rb
ruby-spacy-0.1.4 examples/linguistic_features/similarity.rb
ruby-spacy-0.1.3 examples/linguistic_features/similarity.rb