opener-opinion-detector-base 2.0.1 → 2.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/core/python-scripts/README.md +78 -3
- data/core/python-scripts/classify_kaf_naf_file.py +94 -94
- data/core/python-scripts/models.cfg +1 -0
- data/core/python-scripts/scripts/config_manager.py +3 -0
- data/core/python-scripts/scripts/extract_features.py +0 -3
- data/core/python-scripts/scripts/relation_classifier.py +1 -1
- data/core/vendor/src/crfsuite/crfsuite.sln +42 -42
- data/core/vendor/src/liblbfgs/lbfgs.sln +26 -26
- data/ext/hack/Rakefile +5 -2
- data/lib/opener/opinion_detectors/base.rb +19 -15
- data/lib/opener/opinion_detectors/base/version.rb +1 -1
- data/lib/opener/opinion_detectors/configuration_creator.rb +6 -8
- data/lib/opener/opinion_detectors/de.rb +1 -1
- data/lib/opener/opinion_detectors/es.rb +7 -0
- data/lib/opener/opinion_detectors/fr.rb +7 -0
- data/opener-opinion-detector-base.gemspec +0 -1
- data/pre_install_requirements.txt +3 -0
- metadata +41 -85
- data/core/packages/KafNafParser-1.4.tar.gz +0 -0
- data/core/packages/VUA_pylib-1.5.tar.gz +0 -0
- data/core/site-packages/pre_build/KafNafParser-1.4-py2.7.egg-info/PKG-INFO +0 -10
- data/core/site-packages/pre_build/KafNafParser-1.4-py2.7.egg-info/SOURCES.txt +0 -22
- data/core/site-packages/pre_build/KafNafParser-1.4-py2.7.egg-info/dependency_links.txt +0 -1
- data/core/site-packages/pre_build/KafNafParser-1.4-py2.7.egg-info/installed-files.txt +0 -47
- data/core/site-packages/pre_build/KafNafParser-1.4-py2.7.egg-info/top_level.txt +0 -1
- data/core/site-packages/pre_build/KafNafParser/KafNafParserMod.py +0 -390
- data/core/site-packages/pre_build/KafNafParser/__init__.py +0 -14
- data/core/site-packages/pre_build/KafNafParser/constituency_data.py +0 -125
- data/core/site-packages/pre_build/KafNafParser/coreference_data.py +0 -52
- data/core/site-packages/pre_build/KafNafParser/dependency_data.py +0 -78
- data/core/site-packages/pre_build/KafNafParser/entity_data.py +0 -59
- data/core/site-packages/pre_build/KafNafParser/external_references_data.py +0 -41
- data/core/site-packages/pre_build/KafNafParser/feature_extractor/__init__.py +0 -2
- data/core/site-packages/pre_build/KafNafParser/feature_extractor/constituency.py +0 -205
- data/core/site-packages/pre_build/KafNafParser/feature_extractor/dependency.py +0 -309
- data/core/site-packages/pre_build/KafNafParser/features_data.py +0 -131
- data/core/site-packages/pre_build/KafNafParser/header_data.py +0 -127
- data/core/site-packages/pre_build/KafNafParser/opinion_data.py +0 -211
- data/core/site-packages/pre_build/KafNafParser/references_data.py +0 -23
- data/core/site-packages/pre_build/KafNafParser/span_data.py +0 -63
- data/core/site-packages/pre_build/KafNafParser/term_data.py +0 -111
- data/core/site-packages/pre_build/KafNafParser/term_sentiment_data.py +0 -42
- data/core/site-packages/pre_build/KafNafParser/text_data.py +0 -99
- data/core/site-packages/pre_build/VUA_pylib-1.5-py2.7.egg-info/PKG-INFO +0 -10
- data/core/site-packages/pre_build/VUA_pylib-1.5-py2.7.egg-info/SOURCES.txt +0 -14
- data/core/site-packages/pre_build/VUA_pylib-1.5-py2.7.egg-info/dependency_links.txt +0 -1
- data/core/site-packages/pre_build/VUA_pylib-1.5-py2.7.egg-info/installed-files.txt +0 -23
- data/core/site-packages/pre_build/VUA_pylib-1.5-py2.7.egg-info/top_level.txt +0 -1
- data/core/site-packages/pre_build/VUA_pylib/__init__.py +0 -1
- data/core/site-packages/pre_build/VUA_pylib/common/__init__.py +0 -1
- data/core/site-packages/pre_build/VUA_pylib/common/common.py +0 -28
- data/core/site-packages/pre_build/VUA_pylib/corpus_reader/__init__.py +0 -1
- data/core/site-packages/pre_build/VUA_pylib/corpus_reader/google_web_nl.py +0 -156
- data/core/site-packages/pre_build/VUA_pylib/io_utils/__init__.py +0 -1
- data/core/site-packages/pre_build/VUA_pylib/io_utils/feature_file.py +0 -121
- data/core/site-packages/pre_build/VUA_pylib/lexicon/__init__.py +0 -1
- data/core/site-packages/pre_build/VUA_pylib/lexicon/lexicon.py +0 -72
- data/core/site-packages/pre_build/VUKafParserPy-1.0-py2.7.egg-info/PKG-INFO +0 -10
- data/core/site-packages/pre_build/VUKafParserPy-1.0-py2.7.egg-info/SOURCES.txt +0 -7
- data/core/site-packages/pre_build/VUKafParserPy-1.0-py2.7.egg-info/dependency_links.txt +0 -1
- data/core/site-packages/pre_build/VUKafParserPy-1.0-py2.7.egg-info/installed-files.txt +0 -11
- data/core/site-packages/pre_build/VUKafParserPy-1.0-py2.7.egg-info/top_level.txt +0 -1
- data/core/site-packages/pre_build/VUKafParserPy/KafDataObjectsMod.py +0 -165
- data/core/site-packages/pre_build/VUKafParserPy/KafParserMod.py +0 -439
- data/core/site-packages/pre_build/VUKafParserPy/__init__.py +0 -7
- data/pre_build_requirements.txt +0 -3
@@ -1,6 +1,7 @@
|
|
1
1
|
#LANG|domain|pathtomodel|description
|
2
2
|
en|hotel|final_models/en/hotel_cfg1|Trained with config1 in the last version of hotel annotations
|
3
3
|
en|news|final_models/en/news_cfg1|Trained with config1 using only the sentences annotated with news
|
4
|
+
en|mpqa|final_models/en/mpqa/|Trained on the MPQA corpus
|
4
5
|
nl|hotel|final_models/nl/hotel_cfg1|Trained with config1 in the last version of hotel annotations
|
5
6
|
nl|news|final_models/nl/news_cfg1|Trained with config1 using only the sentences annotated with news
|
6
7
|
de|hotel|final_models/de/hotel_cfg1|Trained with config1 in the last version of hotel annotations
|
@@ -1,42 +1,42 @@
|
|
1
|
-
|
2
|
-
Microsoft Visual Studio Solution File, Format Version 11.00
|
3
|
-
# Visual Studio 2010
|
4
|
-
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "crf", "lib\crf\crf.vcxproj", "{D6B16F2E-DA86-4591-8B50-348AB7E3432E}"
|
5
|
-
EndProject
|
6
|
-
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "frontend", "frontend\frontend.vcxproj", "{CEC83336-7B18-408B-9F3C-D11225609540}"
|
7
|
-
EndProject
|
8
|
-
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cqdb", "lib\cqdb\cqdb.vcxproj", "{46A23DE6-7E34-4429-8F15-FCC3C083FC5B}"
|
9
|
-
EndProject
|
10
|
-
Global
|
11
|
-
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
12
|
-
Debug|Win32 = Debug|Win32
|
13
|
-
Debug|x64 = Debug|x64
|
14
|
-
Release|Win32 = Release|Win32
|
15
|
-
Release|x64 = Release|x64
|
16
|
-
EndGlobalSection
|
17
|
-
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
18
|
-
{D6B16F2E-DA86-4591-8B50-348AB7E3432E}.Debug|Win32.ActiveCfg = Debug|Win32
|
19
|
-
{D6B16F2E-DA86-4591-8B50-348AB7E3432E}.Debug|Win32.Build.0 = Debug|Win32
|
20
|
-
{D6B16F2E-DA86-4591-8B50-348AB7E3432E}.Debug|x64.ActiveCfg = Debug|Win32
|
21
|
-
{D6B16F2E-DA86-4591-8B50-348AB7E3432E}.Debug|x64.Build.0 = Debug|Win32
|
22
|
-
{D6B16F2E-DA86-4591-8B50-348AB7E3432E}.Release|Win32.ActiveCfg = Release|Win32
|
23
|
-
{D6B16F2E-DA86-4591-8B50-348AB7E3432E}.Release|Win32.Build.0 = Release|Win32
|
24
|
-
{D6B16F2E-DA86-4591-8B50-348AB7E3432E}.Release|x64.ActiveCfg = Release|x64
|
25
|
-
{D6B16F2E-DA86-4591-8B50-348AB7E3432E}.Release|x64.Build.0 = Release|x64
|
26
|
-
{CEC83336-7B18-408B-9F3C-D11225609540}.Debug|Win32.ActiveCfg = Debug|Win32
|
27
|
-
{CEC83336-7B18-408B-9F3C-D11225609540}.Debug|Win32.Build.0 = Debug|Win32
|
28
|
-
{CEC83336-7B18-408B-9F3C-D11225609540}.Debug|x64.ActiveCfg = Debug|Win32
|
29
|
-
{CEC83336-7B18-408B-9F3C-D11225609540}.Release|Win32.ActiveCfg = Release|Win32
|
30
|
-
{CEC83336-7B18-408B-9F3C-D11225609540}.Release|Win32.Build.0 = Release|Win32
|
31
|
-
{CEC83336-7B18-408B-9F3C-D11225609540}.Release|x64.ActiveCfg = Release|Win32
|
32
|
-
{46A23DE6-7E34-4429-8F15-FCC3C083FC5B}.Debug|Win32.ActiveCfg = Debug|Win32
|
33
|
-
{46A23DE6-7E34-4429-8F15-FCC3C083FC5B}.Debug|Win32.Build.0 = Debug|Win32
|
34
|
-
{46A23DE6-7E34-4429-8F15-FCC3C083FC5B}.Debug|x64.ActiveCfg = Debug|Win32
|
35
|
-
{46A23DE6-7E34-4429-8F15-FCC3C083FC5B}.Release|Win32.ActiveCfg = Release|Win32
|
36
|
-
{46A23DE6-7E34-4429-8F15-FCC3C083FC5B}.Release|Win32.Build.0 = Release|Win32
|
37
|
-
{46A23DE6-7E34-4429-8F15-FCC3C083FC5B}.Release|x64.ActiveCfg = Release|Win32
|
38
|
-
EndGlobalSection
|
39
|
-
GlobalSection(SolutionProperties) = preSolution
|
40
|
-
HideSolutionNode = FALSE
|
41
|
-
EndGlobalSection
|
42
|
-
EndGlobal
|
1
|
+
|
2
|
+
Microsoft Visual Studio Solution File, Format Version 11.00
|
3
|
+
# Visual Studio 2010
|
4
|
+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "crf", "lib\crf\crf.vcxproj", "{D6B16F2E-DA86-4591-8B50-348AB7E3432E}"
|
5
|
+
EndProject
|
6
|
+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "frontend", "frontend\frontend.vcxproj", "{CEC83336-7B18-408B-9F3C-D11225609540}"
|
7
|
+
EndProject
|
8
|
+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cqdb", "lib\cqdb\cqdb.vcxproj", "{46A23DE6-7E34-4429-8F15-FCC3C083FC5B}"
|
9
|
+
EndProject
|
10
|
+
Global
|
11
|
+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
12
|
+
Debug|Win32 = Debug|Win32
|
13
|
+
Debug|x64 = Debug|x64
|
14
|
+
Release|Win32 = Release|Win32
|
15
|
+
Release|x64 = Release|x64
|
16
|
+
EndGlobalSection
|
17
|
+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
18
|
+
{D6B16F2E-DA86-4591-8B50-348AB7E3432E}.Debug|Win32.ActiveCfg = Debug|Win32
|
19
|
+
{D6B16F2E-DA86-4591-8B50-348AB7E3432E}.Debug|Win32.Build.0 = Debug|Win32
|
20
|
+
{D6B16F2E-DA86-4591-8B50-348AB7E3432E}.Debug|x64.ActiveCfg = Debug|Win32
|
21
|
+
{D6B16F2E-DA86-4591-8B50-348AB7E3432E}.Debug|x64.Build.0 = Debug|Win32
|
22
|
+
{D6B16F2E-DA86-4591-8B50-348AB7E3432E}.Release|Win32.ActiveCfg = Release|Win32
|
23
|
+
{D6B16F2E-DA86-4591-8B50-348AB7E3432E}.Release|Win32.Build.0 = Release|Win32
|
24
|
+
{D6B16F2E-DA86-4591-8B50-348AB7E3432E}.Release|x64.ActiveCfg = Release|x64
|
25
|
+
{D6B16F2E-DA86-4591-8B50-348AB7E3432E}.Release|x64.Build.0 = Release|x64
|
26
|
+
{CEC83336-7B18-408B-9F3C-D11225609540}.Debug|Win32.ActiveCfg = Debug|Win32
|
27
|
+
{CEC83336-7B18-408B-9F3C-D11225609540}.Debug|Win32.Build.0 = Debug|Win32
|
28
|
+
{CEC83336-7B18-408B-9F3C-D11225609540}.Debug|x64.ActiveCfg = Debug|Win32
|
29
|
+
{CEC83336-7B18-408B-9F3C-D11225609540}.Release|Win32.ActiveCfg = Release|Win32
|
30
|
+
{CEC83336-7B18-408B-9F3C-D11225609540}.Release|Win32.Build.0 = Release|Win32
|
31
|
+
{CEC83336-7B18-408B-9F3C-D11225609540}.Release|x64.ActiveCfg = Release|Win32
|
32
|
+
{46A23DE6-7E34-4429-8F15-FCC3C083FC5B}.Debug|Win32.ActiveCfg = Debug|Win32
|
33
|
+
{46A23DE6-7E34-4429-8F15-FCC3C083FC5B}.Debug|Win32.Build.0 = Debug|Win32
|
34
|
+
{46A23DE6-7E34-4429-8F15-FCC3C083FC5B}.Debug|x64.ActiveCfg = Debug|Win32
|
35
|
+
{46A23DE6-7E34-4429-8F15-FCC3C083FC5B}.Release|Win32.ActiveCfg = Release|Win32
|
36
|
+
{46A23DE6-7E34-4429-8F15-FCC3C083FC5B}.Release|Win32.Build.0 = Release|Win32
|
37
|
+
{46A23DE6-7E34-4429-8F15-FCC3C083FC5B}.Release|x64.ActiveCfg = Release|Win32
|
38
|
+
EndGlobalSection
|
39
|
+
GlobalSection(SolutionProperties) = preSolution
|
40
|
+
HideSolutionNode = FALSE
|
41
|
+
EndGlobalSection
|
42
|
+
EndGlobal
|
@@ -1,26 +1,26 @@
|
|
1
|
-
|
2
|
-
Microsoft Visual Studio Solution File, Format Version 11.00
|
3
|
-
# Visual Studio 2010
|
4
|
-
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lib", "lib\lib.vcxproj", "{C4405B73-A899-44BF-8681-04CE040B6705}"
|
5
|
-
EndProject
|
6
|
-
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sample", "sample\sample.vcxproj", "{B4D7D5F5-4A4E-49D5-B38A-E5673520DE66}"
|
7
|
-
EndProject
|
8
|
-
Global
|
9
|
-
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
10
|
-
Debug|Win32 = Debug|Win32
|
11
|
-
Release|Win32 = Release|Win32
|
12
|
-
EndGlobalSection
|
13
|
-
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
14
|
-
{C4405B73-A899-44BF-8681-04CE040B6705}.Debug|Win32.ActiveCfg = Debug|Win32
|
15
|
-
{C4405B73-A899-44BF-8681-04CE040B6705}.Debug|Win32.Build.0 = Debug|Win32
|
16
|
-
{C4405B73-A899-44BF-8681-04CE040B6705}.Release|Win32.ActiveCfg = Release|Win32
|
17
|
-
{C4405B73-A899-44BF-8681-04CE040B6705}.Release|Win32.Build.0 = Release|Win32
|
18
|
-
{B4D7D5F5-4A4E-49D5-B38A-E5673520DE66}.Debug|Win32.ActiveCfg = Debug|Win32
|
19
|
-
{B4D7D5F5-4A4E-49D5-B38A-E5673520DE66}.Debug|Win32.Build.0 = Debug|Win32
|
20
|
-
{B4D7D5F5-4A4E-49D5-B38A-E5673520DE66}.Release|Win32.ActiveCfg = Release|Win32
|
21
|
-
{B4D7D5F5-4A4E-49D5-B38A-E5673520DE66}.Release|Win32.Build.0 = Release|Win32
|
22
|
-
EndGlobalSection
|
23
|
-
GlobalSection(SolutionProperties) = preSolution
|
24
|
-
HideSolutionNode = FALSE
|
25
|
-
EndGlobalSection
|
26
|
-
EndGlobal
|
1
|
+
|
2
|
+
Microsoft Visual Studio Solution File, Format Version 11.00
|
3
|
+
# Visual Studio 2010
|
4
|
+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lib", "lib\lib.vcxproj", "{C4405B73-A899-44BF-8681-04CE040B6705}"
|
5
|
+
EndProject
|
6
|
+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sample", "sample\sample.vcxproj", "{B4D7D5F5-4A4E-49D5-B38A-E5673520DE66}"
|
7
|
+
EndProject
|
8
|
+
Global
|
9
|
+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
10
|
+
Debug|Win32 = Debug|Win32
|
11
|
+
Release|Win32 = Release|Win32
|
12
|
+
EndGlobalSection
|
13
|
+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
14
|
+
{C4405B73-A899-44BF-8681-04CE040B6705}.Debug|Win32.ActiveCfg = Debug|Win32
|
15
|
+
{C4405B73-A899-44BF-8681-04CE040B6705}.Debug|Win32.Build.0 = Debug|Win32
|
16
|
+
{C4405B73-A899-44BF-8681-04CE040B6705}.Release|Win32.ActiveCfg = Release|Win32
|
17
|
+
{C4405B73-A899-44BF-8681-04CE040B6705}.Release|Win32.Build.0 = Release|Win32
|
18
|
+
{B4D7D5F5-4A4E-49D5-B38A-E5673520DE66}.Debug|Win32.ActiveCfg = Debug|Win32
|
19
|
+
{B4D7D5F5-4A4E-49D5-B38A-E5673520DE66}.Debug|Win32.Build.0 = Debug|Win32
|
20
|
+
{B4D7D5F5-4A4E-49D5-B38A-E5673520DE66}.Release|Win32.ActiveCfg = Release|Win32
|
21
|
+
{B4D7D5F5-4A4E-49D5-B38A-E5673520DE66}.Release|Win32.Build.0 = Release|Win32
|
22
|
+
EndGlobalSection
|
23
|
+
GlobalSection(SolutionProperties) = preSolution
|
24
|
+
HideSolutionNode = FALSE
|
25
|
+
EndGlobalSection
|
26
|
+
EndGlobal
|
data/ext/hack/Rakefile
CHANGED
@@ -12,6 +12,9 @@ task :compile => :requirements do
|
|
12
12
|
end
|
13
13
|
|
14
14
|
task :default => [:compile] do
|
15
|
-
|
16
|
-
|
15
|
+
cd "../../" do
|
16
|
+
path = File.join(PYTHON_SITE_PACKAGES, 'pre_install')
|
17
|
+
|
18
|
+
pip_install(PRE_INSTALL_REQUIREMENTS, path)
|
19
|
+
end
|
17
20
|
end
|
@@ -7,6 +7,8 @@ require_relative 'en'
|
|
7
7
|
require_relative 'nl'
|
8
8
|
require_relative 'de'
|
9
9
|
require_relative 'it'
|
10
|
+
require_relative 'fr'
|
11
|
+
require_relative 'es'
|
10
12
|
|
11
13
|
module Opener
|
12
14
|
module OpinionDetectors
|
@@ -22,8 +24,8 @@ module Opener
|
|
22
24
|
# @return [Hash]
|
23
25
|
#
|
24
26
|
class Base
|
25
|
-
attr_reader :args, :options
|
26
|
-
|
27
|
+
attr_reader :args, :options
|
28
|
+
|
27
29
|
##
|
28
30
|
# Hash containing the default options to use.
|
29
31
|
#
|
@@ -39,8 +41,8 @@ module Opener
|
|
39
41
|
# @option options [Array] :args Extra commandline arguments to use.
|
40
42
|
#
|
41
43
|
def initialize(options = {})
|
42
|
-
@args
|
43
|
-
@options
|
44
|
+
@args = options.delete(:args) || []
|
45
|
+
@options = DEFAULT_OPTIONS.merge(options)
|
44
46
|
end
|
45
47
|
|
46
48
|
##
|
@@ -48,8 +50,8 @@ module Opener
|
|
48
50
|
#
|
49
51
|
# @param [Array] args Commandline arguments passed to the command.
|
50
52
|
#
|
51
|
-
def command
|
52
|
-
return "#{adjust_python_path} python -
|
53
|
+
def command(config_file)
|
54
|
+
return "#{adjust_python_path} python -OO #{kernel} -m #{config_file} #{args.join(' ')}"
|
53
55
|
end
|
54
56
|
|
55
57
|
##
|
@@ -61,11 +63,13 @@ module Opener
|
|
61
63
|
#
|
62
64
|
def run(input)
|
63
65
|
language = language(input)
|
64
|
-
conf
|
65
|
-
|
66
|
-
|
66
|
+
conf = ConfigurationCreator.new(
|
67
|
+
language,
|
68
|
+
options[:domain],
|
69
|
+
options[:resource_path]
|
70
|
+
)
|
67
71
|
|
68
|
-
return capture(input)
|
72
|
+
return capture(conf.config_file_path, input)
|
69
73
|
end
|
70
74
|
|
71
75
|
protected
|
@@ -74,17 +78,17 @@ module Opener
|
|
74
78
|
# @return [String]
|
75
79
|
#
|
76
80
|
def adjust_python_path
|
77
|
-
site_packages = File.join(core_dir, 'site-packages')
|
81
|
+
site_packages = File.join(core_dir, 'site-packages/pre_install')
|
78
82
|
|
79
83
|
return "env PYTHONPATH=#{site_packages}:$PYTHONPATH"
|
80
84
|
end
|
81
85
|
|
82
86
|
##
|
83
|
-
# capture3 method doesn't work properly with Jruby, so
|
84
|
-
#
|
87
|
+
# capture3 method doesn't work properly with Jruby, so this is a
|
88
|
+
# workaround
|
85
89
|
#
|
86
|
-
def capture(input)
|
87
|
-
return Open3.popen3(*command.split(" ")) {|i, o, e, t|
|
90
|
+
def capture(config_file, input)
|
91
|
+
return Open3.popen3(*command(config_file).split(" ")) {|i, o, e, t|
|
88
92
|
out_reader = Thread.new { o.read }
|
89
93
|
err_reader = Thread.new { e.read }
|
90
94
|
i.write input
|
@@ -8,9 +8,10 @@ module Opener
|
|
8
8
|
|
9
9
|
include ERB::Util
|
10
10
|
|
11
|
-
def initialize(language, domain)
|
11
|
+
def initialize(language, domain, models_path)
|
12
12
|
@language = language
|
13
13
|
@domain = domain
|
14
|
+
@models_path = models_path ||= ENV["OPINION_DETECTOR_MODELS_PATH"]
|
14
15
|
end
|
15
16
|
|
16
17
|
def config_file_path
|
@@ -18,7 +19,7 @@ module Opener
|
|
18
19
|
file.write(render)
|
19
20
|
file.close
|
20
21
|
|
21
|
-
return file
|
22
|
+
return file.path
|
22
23
|
end
|
23
24
|
|
24
25
|
def render
|
@@ -26,13 +27,10 @@ module Opener
|
|
26
27
|
end
|
27
28
|
|
28
29
|
def models_path
|
29
|
-
|
30
|
-
|
31
|
-
raise ModelsMissing, "Please provide an environment variable named
|
32
|
-
OPINION_DETECTOR_MODELS_PATH that contains the path to the models"
|
30
|
+
if @models_path.nil?
|
31
|
+
raise ArgumentError, "Can't find a models path, please set the OPINION_DETECTOR_MODELS_PATH env variable"
|
33
32
|
end
|
34
|
-
|
35
|
-
path = File.expand_path(language, env_path)
|
33
|
+
path = File.expand_path(language, @models_path)
|
36
34
|
return path
|
37
35
|
end
|
38
36
|
|
metadata
CHANGED
@@ -1,87 +1,87 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opener-opinion-detector-base
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- development@olery.com
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opener-build-tools
|
15
|
-
version_requirements: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - '>='
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: 0.2.7
|
20
15
|
requirement: !ruby/object:Gem::Requirement
|
21
16
|
requirements:
|
22
|
-
- -
|
17
|
+
- - ">="
|
23
18
|
- !ruby/object:Gem::Version
|
24
19
|
version: 0.2.7
|
25
|
-
prerelease: false
|
26
20
|
type: :runtime
|
27
|
-
|
28
|
-
name: rake
|
21
|
+
prerelease: false
|
29
22
|
version_requirements: !ruby/object:Gem::Requirement
|
30
23
|
requirements:
|
31
|
-
- -
|
24
|
+
- - ">="
|
32
25
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
26
|
+
version: 0.2.7
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
34
29
|
requirement: !ruby/object:Gem::Requirement
|
35
30
|
requirements:
|
36
|
-
- -
|
31
|
+
- - ">="
|
37
32
|
- !ruby/object:Gem::Version
|
38
33
|
version: '0'
|
39
|
-
prerelease: false
|
40
34
|
type: :runtime
|
41
|
-
|
42
|
-
name: nokogiri
|
35
|
+
prerelease: false
|
43
36
|
version_requirements: !ruby/object:Gem::Requirement
|
44
37
|
requirements:
|
45
|
-
- -
|
38
|
+
- - ">="
|
46
39
|
- !ruby/object:Gem::Version
|
47
40
|
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: nokogiri
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
44
|
requirements:
|
50
|
-
- -
|
45
|
+
- - ">="
|
51
46
|
- !ruby/object:Gem::Version
|
52
47
|
version: '0'
|
53
|
-
prerelease: false
|
54
48
|
type: :runtime
|
55
|
-
|
56
|
-
name: rspec
|
49
|
+
prerelease: false
|
57
50
|
version_requirements: !ruby/object:Gem::Requirement
|
58
51
|
requirements:
|
59
|
-
- -
|
52
|
+
- - ">="
|
60
53
|
- !ruby/object:Gem::Version
|
61
54
|
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
62
57
|
requirement: !ruby/object:Gem::Requirement
|
63
58
|
requirements:
|
64
|
-
- -
|
59
|
+
- - ">="
|
65
60
|
- !ruby/object:Gem::Version
|
66
61
|
version: '0'
|
67
|
-
prerelease: false
|
68
62
|
type: :development
|
69
|
-
|
70
|
-
name: cucumber
|
63
|
+
prerelease: false
|
71
64
|
version_requirements: !ruby/object:Gem::Requirement
|
72
65
|
requirements:
|
73
|
-
- -
|
66
|
+
- - ">="
|
74
67
|
- !ruby/object:Gem::Version
|
75
68
|
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: cucumber
|
76
71
|
requirement: !ruby/object:Gem::Requirement
|
77
72
|
requirements:
|
78
|
-
- -
|
73
|
+
- - ">="
|
79
74
|
- !ruby/object:Gem::Version
|
80
75
|
version: '0'
|
81
|
-
prerelease: false
|
82
76
|
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
83
|
description: Base Opinion Detector for english and dutch.
|
84
|
-
email:
|
84
|
+
email:
|
85
85
|
executables:
|
86
86
|
- opinion-detector-base
|
87
87
|
extensions:
|
@@ -91,8 +91,6 @@ files:
|
|
91
91
|
- README.md
|
92
92
|
- bin/opinion-detector-base
|
93
93
|
- core/annotation.cfg.erb
|
94
|
-
- core/packages/KafNafParser-1.4.tar.gz
|
95
|
-
- core/packages/VUA_pylib-1.5.tar.gz
|
96
94
|
- core/python-scripts/LICENSE
|
97
95
|
- core/python-scripts/README.md
|
98
96
|
- core/python-scripts/classify_kaf_naf_file.py
|
@@ -123,51 +121,6 @@ files:
|
|
123
121
|
- core/python-scripts/scripts/link_entities_distance.py
|
124
122
|
- core/python-scripts/scripts/relation_classifier.py
|
125
123
|
- core/python-scripts/train.py
|
126
|
-
- core/site-packages/pre_build/KafNafParser-1.4-py2.7.egg-info/PKG-INFO
|
127
|
-
- core/site-packages/pre_build/KafNafParser-1.4-py2.7.egg-info/SOURCES.txt
|
128
|
-
- core/site-packages/pre_build/KafNafParser-1.4-py2.7.egg-info/dependency_links.txt
|
129
|
-
- core/site-packages/pre_build/KafNafParser-1.4-py2.7.egg-info/installed-files.txt
|
130
|
-
- core/site-packages/pre_build/KafNafParser-1.4-py2.7.egg-info/top_level.txt
|
131
|
-
- core/site-packages/pre_build/KafNafParser/KafNafParserMod.py
|
132
|
-
- core/site-packages/pre_build/KafNafParser/__init__.py
|
133
|
-
- core/site-packages/pre_build/KafNafParser/constituency_data.py
|
134
|
-
- core/site-packages/pre_build/KafNafParser/coreference_data.py
|
135
|
-
- core/site-packages/pre_build/KafNafParser/dependency_data.py
|
136
|
-
- core/site-packages/pre_build/KafNafParser/entity_data.py
|
137
|
-
- core/site-packages/pre_build/KafNafParser/external_references_data.py
|
138
|
-
- core/site-packages/pre_build/KafNafParser/feature_extractor/__init__.py
|
139
|
-
- core/site-packages/pre_build/KafNafParser/feature_extractor/constituency.py
|
140
|
-
- core/site-packages/pre_build/KafNafParser/feature_extractor/dependency.py
|
141
|
-
- core/site-packages/pre_build/KafNafParser/features_data.py
|
142
|
-
- core/site-packages/pre_build/KafNafParser/header_data.py
|
143
|
-
- core/site-packages/pre_build/KafNafParser/opinion_data.py
|
144
|
-
- core/site-packages/pre_build/KafNafParser/references_data.py
|
145
|
-
- core/site-packages/pre_build/KafNafParser/span_data.py
|
146
|
-
- core/site-packages/pre_build/KafNafParser/term_data.py
|
147
|
-
- core/site-packages/pre_build/KafNafParser/term_sentiment_data.py
|
148
|
-
- core/site-packages/pre_build/KafNafParser/text_data.py
|
149
|
-
- core/site-packages/pre_build/VUA_pylib-1.5-py2.7.egg-info/PKG-INFO
|
150
|
-
- core/site-packages/pre_build/VUA_pylib-1.5-py2.7.egg-info/SOURCES.txt
|
151
|
-
- core/site-packages/pre_build/VUA_pylib-1.5-py2.7.egg-info/dependency_links.txt
|
152
|
-
- core/site-packages/pre_build/VUA_pylib-1.5-py2.7.egg-info/installed-files.txt
|
153
|
-
- core/site-packages/pre_build/VUA_pylib-1.5-py2.7.egg-info/top_level.txt
|
154
|
-
- core/site-packages/pre_build/VUA_pylib/__init__.py
|
155
|
-
- core/site-packages/pre_build/VUA_pylib/common/__init__.py
|
156
|
-
- core/site-packages/pre_build/VUA_pylib/common/common.py
|
157
|
-
- core/site-packages/pre_build/VUA_pylib/corpus_reader/__init__.py
|
158
|
-
- core/site-packages/pre_build/VUA_pylib/corpus_reader/google_web_nl.py
|
159
|
-
- core/site-packages/pre_build/VUA_pylib/io_utils/__init__.py
|
160
|
-
- core/site-packages/pre_build/VUA_pylib/io_utils/feature_file.py
|
161
|
-
- core/site-packages/pre_build/VUA_pylib/lexicon/__init__.py
|
162
|
-
- core/site-packages/pre_build/VUA_pylib/lexicon/lexicon.py
|
163
|
-
- core/site-packages/pre_build/VUKafParserPy-1.0-py2.7.egg-info/PKG-INFO
|
164
|
-
- core/site-packages/pre_build/VUKafParserPy-1.0-py2.7.egg-info/SOURCES.txt
|
165
|
-
- core/site-packages/pre_build/VUKafParserPy-1.0-py2.7.egg-info/dependency_links.txt
|
166
|
-
- core/site-packages/pre_build/VUKafParserPy-1.0-py2.7.egg-info/installed-files.txt
|
167
|
-
- core/site-packages/pre_build/VUKafParserPy-1.0-py2.7.egg-info/top_level.txt
|
168
|
-
- core/site-packages/pre_build/VUKafParserPy/KafDataObjectsMod.py
|
169
|
-
- core/site-packages/pre_build/VUKafParserPy/KafParserMod.py
|
170
|
-
- core/site-packages/pre_build/VUKafParserPy/__init__.py
|
171
124
|
- core/vendor/src/crfsuite/AUTHORS
|
172
125
|
- core/vendor/src/crfsuite/COPYING
|
173
126
|
- core/vendor/src/crfsuite/ChangeLog
|
@@ -313,31 +266,34 @@ files:
|
|
313
266
|
- lib/opener/opinion_detectors/configuration_creator.rb
|
314
267
|
- lib/opener/opinion_detectors/de.rb
|
315
268
|
- lib/opener/opinion_detectors/en.rb
|
269
|
+
- lib/opener/opinion_detectors/es.rb
|
270
|
+
- lib/opener/opinion_detectors/fr.rb
|
316
271
|
- lib/opener/opinion_detectors/it.rb
|
317
272
|
- lib/opener/opinion_detectors/nl.rb
|
318
273
|
- opener-opinion-detector-base.gemspec
|
319
|
-
-
|
274
|
+
- pre_install_requirements.txt
|
320
275
|
homepage: http://opener-project.github.com/
|
321
276
|
licenses: []
|
322
277
|
metadata: {}
|
323
|
-
post_install_message:
|
278
|
+
post_install_message:
|
324
279
|
rdoc_options: []
|
325
280
|
require_paths:
|
326
281
|
- lib
|
327
282
|
required_ruby_version: !ruby/object:Gem::Requirement
|
328
283
|
requirements:
|
329
|
-
- -
|
284
|
+
- - ">="
|
330
285
|
- !ruby/object:Gem::Version
|
331
286
|
version: 1.9.2
|
332
287
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
333
288
|
requirements:
|
334
|
-
- -
|
289
|
+
- - ">="
|
335
290
|
- !ruby/object:Gem::Version
|
336
291
|
version: '0'
|
337
292
|
requirements: []
|
338
|
-
rubyforge_project:
|
293
|
+
rubyforge_project:
|
339
294
|
rubygems_version: 2.2.2
|
340
|
-
signing_key:
|
295
|
+
signing_key:
|
341
296
|
specification_version: 4
|
342
297
|
summary: Base Opinion Detector for english and dutch.
|
343
298
|
test_files: []
|
299
|
+
has_rdoc:
|