Sha256: eecd77d2edf2a42a92f8ebb41ecc6e51a698f4badf7b68d4f7015c2aa6c82390

Contents?: true

Size: 513 Bytes

Versions: 2

Compression:

Stored size: 513 Bytes

Contents

# frozen_string_literal: true

# add path to ruby-spacy lib to load path
$LOAD_PATH.unshift(File.expand_path("../../lib", __dir__))

require "ruby-spacy"

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

sentence = "When Sebastian Thrun started working on self-driving cars at Google in 2007, few people outside of the company took him seriously."
doc = nlp.read(sentence)

ent_html = doc.displacy(style: "ent")

File.open(File.join(File.dirname(__FILE__), "test_ent.html"), "w") do |file|
  file.write(ent_html)
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ruby-spacy-0.2.3 examples/get_started/visualizing_named_entities.rb
ruby-spacy-0.2.2 examples/get_started/visualizing_named_entities.rb