Sha256: 4d5af37a567e200b5008ae2ca2dfee3701c7c0680bc1d364dc87e515515befbd

Contents?: true

Size: 303 Bytes

Versions: 6

Compression:

Stored size: 303 Bytes

Contents

require "ruby-spacy"

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

sentence = "Autonomous cars shift insurance liability toward manufacturers"
doc = nlp.read(sentence)

dep_svg = doc.displacy(style: "dep", compact: false)

File.open(File.join("test_dep.svg"), "w") do |file|
  file.write(dep_svg)
end


Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ruby-spacy-0.1.4.1 examples/get_started/visualizing_dependencies.rb
ruby-spacy-0.1.4 examples/get_started/visualizing_dependencies.rb
ruby-spacy-0.1.3 examples/get_started/visualizing_dependencies.rb
ruby-spacy-0.1.2 examples/get_started/visualizing_dependencies.rb
ruby-spacy-0.1.1 examples/get_started/visualizing_dependencies.rb
ruby-spacy-0.1.0 examples/get_started/visualizing_dependencies.rb