ruby-spacy 0.1.0 → 0.1.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +23 -0
  3. data/Gemfile.lock +3 -1
  4. data/README.md +123 -77
  5. data/examples/get_started/lexeme.rb +2 -2
  6. data/examples/get_started/linguistic_annotations.rb +1 -1
  7. data/examples/get_started/morphology.rb +45 -0
  8. data/examples/get_started/most_similar.rb +28 -27
  9. data/examples/get_started/named_entities.rb +1 -1
  10. data/examples/get_started/pos_tags_and_dependencies.rb +18 -18
  11. data/examples/get_started/similarity.rb +2 -2
  12. data/examples/japanese/ancestors.rb +9 -11
  13. data/examples/japanese/entity_annotations_and_labels.rb +1 -1
  14. data/examples/japanese/lemmatization.rb +1 -1
  15. data/examples/japanese/most_similar.rb +28 -27
  16. data/examples/japanese/named_entity_recognition.rb +1 -1
  17. data/examples/japanese/navigating_parse_tree.rb +18 -18
  18. data/examples/japanese/noun_chunks.rb +1 -1
  19. data/examples/japanese/pos_tagging.rb +20 -20
  20. data/examples/japanese/visualizing_dependencies.rb +2 -2
  21. data/examples/japanese/visualizing_named_entities.rb +1 -1
  22. data/examples/linguistic_features/ancestors.rb +13 -10
  23. data/examples/linguistic_features/entity_annotations_and_labels.rb +1 -1
  24. data/examples/linguistic_features/finding_a_verb_with_a_subject.rb +2 -2
  25. data/examples/linguistic_features/information_extraction.rb +2 -2
  26. data/examples/linguistic_features/iterating_children.rb +2 -2
  27. data/examples/linguistic_features/iterating_lefts_and_rights.rb +5 -5
  28. data/examples/linguistic_features/lemmatization.rb +1 -1
  29. data/examples/linguistic_features/named_entity_recognition.rb +1 -1
  30. data/examples/linguistic_features/navigating_parse_tree.rb +12 -12
  31. data/examples/linguistic_features/noun_chunks.rb +1 -1
  32. data/examples/linguistic_features/pos_tagging.rb +1 -1
  33. data/examples/linguistic_features/retokenize_1.rb +1 -1
  34. data/examples/linguistic_features/retokenize_2.rb +2 -2
  35. data/examples/linguistic_features/rule_based_morphology.rb +1 -1
  36. data/examples/linguistic_features/similarity.rb +2 -2
  37. data/examples/linguistic_features/similarity_between_lexemes.rb +18 -0
  38. data/examples/linguistic_features/similarity_between_spans.rb +2 -2
  39. data/examples/rule_based_matching/creating_spans_from_matches.rb +1 -1
  40. data/lib/ruby-spacy.rb +493 -300
  41. data/lib/ruby-spacy/version.rb +1 -1
  42. data/ruby-spacy.gemspec +1 -1
  43. metadata +6 -5
  44. data/examples/linguistic_features/morphology.rb +0 -17
  45. data/examples/linguistic_features/special_case_tokenization_rules.rb +0 -19
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Spacy
4
4
  # The version number of the module
5
- VERSION = "0.1.0"
5
+ VERSION = "0.1.4.1"
6
6
  end
data/ruby-spacy.gemspec CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
 
11
11
  spec.summary = "A wrapper module for using spaCy natural language processing library from the Ruby programming language using PyCall"
12
12
  spec.description =<<EOD
13
- ruby-spacy** is a wrapper module for using spaCy from the Ruby programming language via PyCall. This module aims to make it easy and natural for Ruby programmers to use spaCy. This module covers the areas of spaCy functionality for using many varieties of its language models, not for building ones.
13
+ ruby-spacy is a wrapper module for using spaCy from the Ruby programming language via PyCall. This module aims to make it easy and natural for Ruby programmers to use spaCy. This module covers the areas of spaCy functionality for using many varieties of its language models, not for building ones.
14
14
  EOD
15
15
 
16
16
  spec.homepage = "https://github.com/yohasebe/ruby-spacy"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-spacy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yoichiro Hasebe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-26 00:00:00.000000000 Z
11
+ date: 2021-07-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pycall
@@ -52,7 +52,7 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: 3.0.1
55
- description: 'ruby-spacy** is a wrapper module for using spaCy from the Ruby programming
55
+ description: 'ruby-spacy is a wrapper module for using spaCy from the Ruby programming
56
56
  language via PyCall. This module aims to make it easy and natural for Ruby programmers
57
57
  to use spaCy. This module covers the areas of spaCy functionality for using many
58
58
  varieties of its language models, not for building ones.
@@ -66,6 +66,7 @@ extra_rdoc_files: []
66
66
  files:
67
67
  - ".gitignore"
68
68
  - ".yardopts"
69
+ - CHANGELOG.md
69
70
  - Gemfile
70
71
  - Gemfile.lock
71
72
  - LICENSE.txt
@@ -75,6 +76,7 @@ files:
75
76
  - bin/setup
76
77
  - examples/get_started/lexeme.rb
77
78
  - examples/get_started/linguistic_annotations.rb
79
+ - examples/get_started/morphology.rb
78
80
  - examples/get_started/most_similar.rb
79
81
  - examples/get_started/named_entities.rb
80
82
  - examples/get_started/outputs/test_dep.svg
@@ -111,7 +113,6 @@ files:
111
113
  - examples/linguistic_features/iterating_children.rb
112
114
  - examples/linguistic_features/iterating_lefts_and_rights.rb
113
115
  - examples/linguistic_features/lemmatization.rb
114
- - examples/linguistic_features/morphology.rb
115
116
  - examples/linguistic_features/named_entity_recognition.rb
116
117
  - examples/linguistic_features/navigating_parse_tree.rb
117
118
  - examples/linguistic_features/noun_chunks.rb
@@ -122,8 +123,8 @@ files:
122
123
  - examples/linguistic_features/rule_based_morphology.rb
123
124
  - examples/linguistic_features/sentence_segmentation.rb
124
125
  - examples/linguistic_features/similarity.rb
126
+ - examples/linguistic_features/similarity_between_lexemes.rb
125
127
  - examples/linguistic_features/similarity_between_spans.rb
126
- - examples/linguistic_features/special_case_tokenization_rules.rb
127
128
  - examples/linguistic_features/tokenization.rb
128
129
  - examples/rule_based_matching/creating_spans_from_matches.rb
129
130
  - examples/rule_based_matching/matcher.rb
@@ -1,17 +0,0 @@
1
- require "ruby-spacy"
2
- require "terminal-table"
3
-
4
- nlp = Spacy::Language.new("en_core_web_sm")
5
-
6
- puts "Pipeline: " + nlp.pipe_names.to_s
7
-
8
- doc = nlp.read("I was reading the paper.")
9
-
10
- token = doc[0]
11
-
12
- puts "Morph features of the first word: " + token.morph.to_s
13
- puts "PronType of the word: " + token.morph.get("PronType").to_s
14
-
15
- # Pipeline: ["tok2vec", "tagger", "parser", "ner", "attribute_ruler", "lemmatizer"]
16
- # Morph features of the first word: Case=Nom|Number=Sing|Person=1|PronType=Prs
17
- # PronType of the word: ['Prs']
@@ -1,19 +0,0 @@
1
- require "ruby-spacy"
2
- require "terminal-table"
3
-
4
- nlp = Spacy::Language.new("en_core_web_sm")
5
-
6
- doc = nlp.read("gimme that")
7
-
8
- puts doc.tokens.join(" ")
9
-
10
- # Add special case rule
11
- special_case = [{ORTH: "gim"}, {ORTH: "me"}]
12
- tokenizer = nlp.tokenizer
13
- tokenizer.add_special_case("gimme", special_case)
14
-
15
- # Check new tokenization
16
- puts nlp.read("gimme that").tokens.join(" ")
17
-
18
- # gimme that
19
- # gim me that