opener-pos-tagger 2.2.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.txt +13 -0
- data/README.md +38 -30
- data/bin/pos-tagger-daemon +5 -5
- data/bin/pos-tagger-server +6 -4
- data/exec/pos-tagger.rb +3 -3
- data/lib/opener/pos_tagger.rb +6 -11
- data/lib/opener/pos_tagger/server.rb +4 -5
- data/lib/opener/pos_tagger/version.rb +1 -1
- data/opener-pos-tagger.gemspec +6 -6
- metadata +14 -54
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 265d6d03c32e0facbfe14fb9e40b00ef400318a3
|
4
|
+
data.tar.gz: 744bf220b17323b4167286118d13c138d05a2cf3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 611d76b145ce73e77738a7fa27d4bcffeba2663a079c72762793c7d6aa7fb0b2c19bf2b57b0b3fc9bdfabc01cb9fc05a49b75c4434dfeac0ca25868ca292b993
|
7
|
+
data.tar.gz: 55e715455ea8bfd992c576ee71ab334bbff12d6499796eaadc9b98d8211a1dfb99a10559be8a438a41a4e91f1d81c1ff3cecdb495748d7a240e9dac8a3018712
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
Copyright 2014 OpeNER Project Consortium
|
2
|
+
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
you may not use this file except in compliance with the License.
|
5
|
+
You may obtain a copy of the License at
|
6
|
+
|
7
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
|
9
|
+
Unless required by applicable law or agreed to in writing, software
|
10
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
See the License for the specific language governing permissions and
|
13
|
+
limitations under the License.
|
data/README.md
CHANGED
@@ -1,31 +1,38 @@
|
|
1
|
-
POS-tagger
|
2
|
-
------------
|
1
|
+
# POS-tagger
|
3
2
|
|
4
3
|
Component that wraps the different existing POS Taggers.
|
5
4
|
|
6
5
|
### Confused by some terminology?
|
7
6
|
|
8
|
-
This software is part of a larger collection of natural language processing
|
7
|
+
This software is part of a larger collection of natural language processing
|
8
|
+
tools known as "the OpeNER project". You can find more information about the
|
9
|
+
project at [the OpeNER portal](http://opener-project.github.io). There you can
|
10
|
+
also find references to terms like KAF (an XML standard to represent linguistic
|
11
|
+
annotations in texts), component, cores, scenario's and pipelines.
|
9
12
|
|
10
|
-
Quick Use Example
|
11
|
-
-----------------
|
13
|
+
## Quick Use Example
|
12
14
|
|
13
15
|
Installing the pos-tagger can be done by executing:
|
14
16
|
|
15
17
|
gem install opener-pos-tagger
|
16
18
|
|
17
|
-
Please
|
19
|
+
Please keep in mind that all components in OpeNER take KAF as an input and
|
20
|
+
output KAF by default.
|
18
21
|
|
19
22
|
### Command line interface
|
20
23
|
|
21
|
-
You should now be able to call the POS tagger as a regular shell command: by its
|
24
|
+
You should now be able to call the POS tagger as a regular shell command: by its
|
25
|
+
name. Once installed the gem normalyl sits in your path so you can call it
|
26
|
+
directly from anywhere.
|
22
27
|
|
23
|
-
This aplication reads a text from standard input in order to identify the
|
28
|
+
This aplication reads a text from standard input in order to identify the
|
29
|
+
language.
|
24
30
|
|
25
|
-
POS Tagging some text (assuming that the above text is in a file called
|
31
|
+
POS Tagging some text (assuming that the above text is in a file called
|
32
|
+
`english.kaf`):
|
26
33
|
|
27
34
|
cat english.kaf | pos-tagger
|
28
|
-
|
35
|
+
|
29
36
|
Will result in
|
30
37
|
|
31
38
|
<?xml version='1.0' encoding='UTF-8'?>
|
@@ -80,7 +87,8 @@ You can launch a language identification webservice by executing:
|
|
80
87
|
|
81
88
|
pos-tagger-server
|
82
89
|
|
83
|
-
This will launch a mini webserver with the webservice. It defaults to port 9292,
|
90
|
+
This will launch a mini webserver with the webservice. It defaults to port 9292,
|
91
|
+
so you can access it at <http://localhost:9292>.
|
84
92
|
|
85
93
|
To launch it on a different port provide the `-p [port-number]` option like this:
|
86
94
|
|
@@ -88,19 +96,23 @@ To launch it on a different port provide the `-p [port-number]` option like this
|
|
88
96
|
|
89
97
|
It then launches at <http://localhost:1234>
|
90
98
|
|
91
|
-
Documentation on the Webservice is provided by surfing to the urls provided
|
92
|
-
|
99
|
+
Documentation on the Webservice is provided by surfing to the urls provided
|
100
|
+
above. For more information on how to launch a webservice run the command with
|
101
|
+
the `--help` option.
|
93
102
|
|
94
103
|
### Daemon
|
95
104
|
|
96
|
-
Last but not least the POS tagger comes shipped with a daemon that can read jobs
|
105
|
+
Last but not least the POS tagger comes shipped with a daemon that can read jobs
|
106
|
+
(and write) jobs to and from Amazon SQS queues. For more information type:
|
97
107
|
|
98
108
|
pos-tagger-daemon -h
|
99
109
|
|
100
|
-
Description of dependencies
|
101
|
-
---------------------------
|
110
|
+
## Description of dependencies
|
102
111
|
|
103
|
-
This component runs best if you run it in an environment suited for OpeNER
|
112
|
+
This component runs best if you run it in an environment suited for OpeNER
|
113
|
+
components. You can find an installation guide and helper tools in the
|
114
|
+
[OpeNER installer](https://github.com/opener-project/opener-installer) and an
|
115
|
+
[installation guide on the Opener Website](http://opener-project.github.io/getting-started/how-to/local-installation.html)
|
104
116
|
|
105
117
|
At least you need the following system setup:
|
106
118
|
|
@@ -113,34 +125,30 @@ At least you need the following system setup:
|
|
113
125
|
|
114
126
|
* Maven (for building the Gem)
|
115
127
|
|
116
|
-
Language Extension
|
117
|
-
------------------
|
128
|
+
## Language Extension
|
118
129
|
|
119
130
|
TODO
|
120
131
|
|
121
|
-
The Core
|
122
|
-
--------
|
132
|
+
## The Core
|
123
133
|
|
124
|
-
The component is a fat wrapper around the actual language technology core. You
|
134
|
+
The component is a fat wrapper around the actual language technology core. You
|
135
|
+
can find the core technolies in the following repositories:
|
125
136
|
|
126
137
|
<https://github.com/opener-project/?query=pos>
|
127
138
|
<https://github.com/opener-project/?query=pos>
|
128
139
|
|
129
|
-
Where to go from here
|
130
|
-
---------------------
|
140
|
+
## Where to go from here
|
131
141
|
|
132
142
|
* [Check the project website](http://opener-project.github.io)
|
133
143
|
* [Checkout the webservice](http://opener.olery.com/pos-tagger)
|
134
144
|
|
135
|
-
Report problem/Get help
|
136
|
-
-----------------------
|
145
|
+
## Report problem/Get help
|
137
146
|
|
138
|
-
If you encounter problems, please email <support@opener-project.eu> or leave an
|
147
|
+
If you encounter problems, please email <support@opener-project.eu> or leave an
|
148
|
+
issue in the
|
139
149
|
[issue tracker](https://github.com/opener-project/pos-tagger/issues).
|
140
150
|
|
141
|
-
|
142
|
-
Contributing
|
143
|
-
------------
|
151
|
+
## Contributing
|
144
152
|
|
145
153
|
1. Fork it <http://github.com/opener-project/pos-tagger/fork>
|
146
154
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
data/bin/pos-tagger-daemon
CHANGED
@@ -2,9 +2,9 @@
|
|
2
2
|
|
3
3
|
require 'opener/daemons'
|
4
4
|
|
5
|
-
|
5
|
+
controller = Opener::Daemons::Controller.new(
|
6
|
+
:name => 'opener-pos-tagger',
|
7
|
+
:exec_path => File.expand_path('../../exec/pos-atgger.rb', __FILE__)
|
8
|
+
)
|
6
9
|
|
7
|
-
|
8
|
-
:name => 'pos-tagger',
|
9
|
-
:exec_path => exec_path
|
10
|
-
)
|
10
|
+
controller.run
|
data/bin/pos-tagger-server
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
require '
|
3
|
+
require 'opener/webservice'
|
4
4
|
|
5
|
-
|
5
|
+
parser = Opener::Webservice::OptionParser.new(
|
6
|
+
'opener-pos-tagger',
|
7
|
+
File.expand_path('../../config.ru', __FILE__)
|
8
|
+
)
|
6
9
|
|
7
|
-
|
8
|
-
cli.run
|
10
|
+
parser.run
|
data/exec/pos-tagger.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
require 'opener/daemons'
|
4
|
-
require_relative '../lib/opener/pos_tagger'
|
5
4
|
|
6
|
-
|
7
|
-
|
5
|
+
require_relative '../lib/opener/tokenizer'
|
6
|
+
|
7
|
+
daemon = Opener::Daemons::Daemon.new(Opener::POSTagger)
|
8
8
|
|
9
9
|
daemon.start
|
data/lib/opener/pos_tagger.rb
CHANGED
@@ -3,7 +3,6 @@ require 'opener/pos_taggers/en'
|
|
3
3
|
require 'nokogiri'
|
4
4
|
require 'open3'
|
5
5
|
require 'optparse'
|
6
|
-
require 'opener/core'
|
7
6
|
|
8
7
|
require_relative 'pos_tagger/version'
|
9
8
|
require_relative 'pos_tagger/cli'
|
@@ -46,19 +45,15 @@ module Opener
|
|
46
45
|
# @return [Array]
|
47
46
|
#
|
48
47
|
def run(input)
|
49
|
-
|
50
|
-
language = language_from_kaf(input)
|
48
|
+
language = language_from_kaf(input)
|
51
49
|
|
52
|
-
|
53
|
-
|
54
|
-
|
50
|
+
unless valid_language?(language)
|
51
|
+
raise ArgumentError, "The specified language (#{language}) is invalid"
|
52
|
+
end
|
55
53
|
|
56
|
-
|
54
|
+
kernel = language_constant(language).new(:args => options[:args])
|
57
55
|
|
58
|
-
|
59
|
-
rescue Exception => error
|
60
|
-
return Opener::Core::ErrorLayer.new(input, error.message, self.class).add
|
61
|
-
end
|
56
|
+
return kernel.run(input)
|
62
57
|
end
|
63
58
|
|
64
59
|
alias tag run
|
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'sinatra/base'
|
2
|
-
require 'httpclient'
|
3
1
|
require 'opener/webservice'
|
4
2
|
|
5
3
|
module Opener
|
@@ -7,10 +5,11 @@ module Opener
|
|
7
5
|
##
|
8
6
|
# POS Tagger server powered by Sinatra.
|
9
7
|
#
|
10
|
-
class Server < Webservice
|
8
|
+
class Server < Webservice::Server
|
11
9
|
set :views, File.expand_path('../views', __FILE__)
|
12
|
-
|
13
|
-
|
10
|
+
|
11
|
+
self.text_processor = POSTagger
|
12
|
+
self.accepted_params = [:input]
|
14
13
|
end # Server
|
15
14
|
end # POSTagger
|
16
15
|
end # Opener
|
data/opener-pos-tagger.gemspec
CHANGED
@@ -10,11 +10,14 @@ Gem::Specification.new do |gem|
|
|
10
10
|
gem.has_rdoc = "yard"
|
11
11
|
gem.required_ruby_version = ">= 1.9.2"
|
12
12
|
|
13
|
+
gem.license = 'Apache 2.0'
|
14
|
+
|
13
15
|
gem.files = Dir.glob([
|
14
16
|
'lib/**/*',
|
15
17
|
'config.ru',
|
16
18
|
'*.gemspec',
|
17
19
|
'README.md',
|
20
|
+
'LICENSE.txt',
|
18
21
|
'exec/**/*'
|
19
22
|
]).select { |file| File.file?(file) }
|
20
23
|
|
@@ -22,14 +25,11 @@ Gem::Specification.new do |gem|
|
|
22
25
|
|
23
26
|
gem.add_dependency 'opener-pos-tagger-base', ['~> 2.0', '>= 2.1.0']
|
24
27
|
gem.add_dependency 'opener-pos-tagger-en-es', ['~> 2.0', '>= 2.0.2']
|
25
|
-
gem.add_dependency 'opener-webservice'
|
26
28
|
|
27
29
|
gem.add_dependency 'nokogiri'
|
28
|
-
gem.add_dependency '
|
29
|
-
gem.add_dependency '
|
30
|
-
gem.add_dependency '
|
31
|
-
gem.add_dependency 'opener-daemons'
|
32
|
-
gem.add_dependency 'opener-core', '~>1.0'
|
30
|
+
gem.add_dependency 'opener-webservice', '~> 2.0'
|
31
|
+
gem.add_dependency 'opener-daemons', '~> 2.1'
|
32
|
+
gem.add_dependency 'opener-core', '~> 2.0'
|
33
33
|
|
34
34
|
gem.add_development_dependency 'rspec'
|
35
35
|
gem.add_development_dependency 'cucumber'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opener-pos-tagger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- development@olery.com
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-11-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opener-pos-tagger-base
|
@@ -50,20 +50,6 @@ dependencies:
|
|
50
50
|
version: 2.0.2
|
51
51
|
prerelease: false
|
52
52
|
type: :runtime
|
53
|
-
- !ruby/object:Gem::Dependency
|
54
|
-
name: opener-webservice
|
55
|
-
version_requirements: !ruby/object:Gem::Requirement
|
56
|
-
requirements:
|
57
|
-
- - '>='
|
58
|
-
- !ruby/object:Gem::Version
|
59
|
-
version: '0'
|
60
|
-
requirement: !ruby/object:Gem::Requirement
|
61
|
-
requirements:
|
62
|
-
- - '>='
|
63
|
-
- !ruby/object:Gem::Version
|
64
|
-
version: '0'
|
65
|
-
prerelease: false
|
66
|
-
type: :runtime
|
67
53
|
- !ruby/object:Gem::Dependency
|
68
54
|
name: nokogiri
|
69
55
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -79,59 +65,31 @@ dependencies:
|
|
79
65
|
prerelease: false
|
80
66
|
type: :runtime
|
81
67
|
- !ruby/object:Gem::Dependency
|
82
|
-
name:
|
68
|
+
name: opener-webservice
|
83
69
|
version_requirements: !ruby/object:Gem::Requirement
|
84
70
|
requirements:
|
85
71
|
- - ~>
|
86
72
|
- !ruby/object:Gem::Version
|
87
|
-
version:
|
73
|
+
version: '2.0'
|
88
74
|
requirement: !ruby/object:Gem::Requirement
|
89
75
|
requirements:
|
90
76
|
- - ~>
|
91
77
|
- !ruby/object:Gem::Version
|
92
|
-
version:
|
93
|
-
prerelease: false
|
94
|
-
type: :runtime
|
95
|
-
- !ruby/object:Gem::Dependency
|
96
|
-
name: httpclient
|
97
|
-
version_requirements: !ruby/object:Gem::Requirement
|
98
|
-
requirements:
|
99
|
-
- - '>='
|
100
|
-
- !ruby/object:Gem::Version
|
101
|
-
version: '0'
|
102
|
-
requirement: !ruby/object:Gem::Requirement
|
103
|
-
requirements:
|
104
|
-
- - '>='
|
105
|
-
- !ruby/object:Gem::Version
|
106
|
-
version: '0'
|
107
|
-
prerelease: false
|
108
|
-
type: :runtime
|
109
|
-
- !ruby/object:Gem::Dependency
|
110
|
-
name: puma
|
111
|
-
version_requirements: !ruby/object:Gem::Requirement
|
112
|
-
requirements:
|
113
|
-
- - '>='
|
114
|
-
- !ruby/object:Gem::Version
|
115
|
-
version: '0'
|
116
|
-
requirement: !ruby/object:Gem::Requirement
|
117
|
-
requirements:
|
118
|
-
- - '>='
|
119
|
-
- !ruby/object:Gem::Version
|
120
|
-
version: '0'
|
78
|
+
version: '2.0'
|
121
79
|
prerelease: false
|
122
80
|
type: :runtime
|
123
81
|
- !ruby/object:Gem::Dependency
|
124
82
|
name: opener-daemons
|
125
83
|
version_requirements: !ruby/object:Gem::Requirement
|
126
84
|
requirements:
|
127
|
-
- -
|
85
|
+
- - ~>
|
128
86
|
- !ruby/object:Gem::Version
|
129
|
-
version: '
|
87
|
+
version: '2.1'
|
130
88
|
requirement: !ruby/object:Gem::Requirement
|
131
89
|
requirements:
|
132
|
-
- -
|
90
|
+
- - ~>
|
133
91
|
- !ruby/object:Gem::Version
|
134
|
-
version: '
|
92
|
+
version: '2.1'
|
135
93
|
prerelease: false
|
136
94
|
type: :runtime
|
137
95
|
- !ruby/object:Gem::Dependency
|
@@ -140,12 +98,12 @@ dependencies:
|
|
140
98
|
requirements:
|
141
99
|
- - ~>
|
142
100
|
- !ruby/object:Gem::Version
|
143
|
-
version: '
|
101
|
+
version: '2.0'
|
144
102
|
requirement: !ruby/object:Gem::Requirement
|
145
103
|
requirements:
|
146
104
|
- - ~>
|
147
105
|
- !ruby/object:Gem::Version
|
148
|
-
version: '
|
106
|
+
version: '2.0'
|
149
107
|
prerelease: false
|
150
108
|
type: :runtime
|
151
109
|
- !ruby/object:Gem::Dependency
|
@@ -223,12 +181,14 @@ files:
|
|
223
181
|
- config.ru
|
224
182
|
- opener-pos-tagger.gemspec
|
225
183
|
- README.md
|
184
|
+
- LICENSE.txt
|
226
185
|
- exec/pos-tagger.rb
|
227
186
|
- bin/pos-tagger-server
|
228
187
|
- bin/pos-tagger
|
229
188
|
- bin/pos-tagger-daemon
|
230
189
|
homepage: http://opener-project.github.com/
|
231
|
-
licenses:
|
190
|
+
licenses:
|
191
|
+
- Apache 2.0
|
232
192
|
metadata: {}
|
233
193
|
post_install_message:
|
234
194
|
rdoc_options: []
|