Sha256: 751813688deafd0997ed1e3f9cd01bf5273f863308a297eb4786f0545c74a134

Contents?: true

Size: 477 Bytes

Versions: 6

Compression:

Stored size: 477 Bytes

Contents

require "ruby-spacy"

nlp = Spacy::Language.new("ja_core_news_lg")
ja_doc1 = nlp.read("今日は雨ばっかり降って、嫌な天気ですね。")
puts "doc1: #{ja_doc1.text}"
ja_doc2 = nlp.read("あいにくの悪天候で残念です。")
puts "doc2: #{ja_doc2.text}"
puts "Similarity: #{ja_doc1.similarity(ja_doc2)}"

# doc1: 今日は雨ばっかり降って、嫌な天気ですね。
# doc2: あいにくの悪天候で残念です。
# Similarity: 0.8684192637149641

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ruby-spacy-0.1.4.1 examples/japanese/similarity.rb
ruby-spacy-0.1.4 examples/japanese/similarity.rb
ruby-spacy-0.1.3 examples/japanese/similarity.rb
ruby-spacy-0.1.2 examples/japanese/similarity.rb
ruby-spacy-0.1.1 examples/japanese/similarity.rb
ruby-spacy-0.1.0 examples/japanese/similarity.rb