Module: Spacy
- Defined in:
- lib/ruby-spacy.rb,
lib/ruby-spacy/version.rb
Overview
This module covers the areas of spaCy functionality for using many varieties of its language models, not for building ones.
Defined Under Namespace
Classes: Doc, Language, Lexeme, Matcher, Span, Token
Constant Summary collapse
- MAX_RETRIAL =
5
- SpacyVersion =
spacy.__version__
- PyLanguage =
Python ‘Language` class
spacy.language.Language
- PyDoc =
Python ‘Doc` class object
spacy.tokens.Doc
- PySpan =
Python ‘Span` class object
spacy.tokens.Span
- PyToken =
Python ‘Token` class object
spacy.tokens.Token
- PyMatcher =
Python ‘Matcher` class object
spacy.matcher.Matcher
- PyDisplacy =
Python ‘displacy` object
PyCall.import_module('spacy.displacy')
- VERSION =
The version number of the module
"0.2.3"
Class Method Summary collapse
-
.client ⇒ Object
Provide an accessor method to get the client (optional).
-
.generator_to_array(py_generator) ⇒ Object
A utility module method to convert Python’s generator object to a Ruby array, mainly used on the items inside the array returned from dependency-related methods such as Span#rights, Span#lefts and Span#subtree.
- .openai_client(access_token:) ⇒ Object
Class Method Details
.client ⇒ Object
Provide an accessor method to get the client (optional)
60 61 62 |
# File 'lib/ruby-spacy.rb', line 60 def self.client @openai_client end |
.generator_to_array(py_generator) ⇒ Object
A utility module method to convert Python’s generator object to a Ruby array, mainly used on the items inside the array returned from dependency-related methods such as Spacy::Span#rights, Spacy::Span#lefts and Spacy::Span#subtree.
48 49 50 |
# File 'lib/ruby-spacy.rb', line 48 def self.generator_to_array(py_generator) PyCall::List.call(py_generator) end |
.openai_client(access_token:) ⇒ Object
54 55 56 57 |
# File 'lib/ruby-spacy.rb', line 54 def self.openai_client(access_token:) # If @client is already set, just return it. Otherwise, create a new instance. @openai_client ||= OpenAI::Client.new(access_token: access_token) end |