opener-opinion-detector-base 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/core/python-scripts/classify_kaf_naf_file.py +16 -8
  3. data/core/python-scripts/scripts/config_manager.py +0 -3
  4. data/core/python-scripts/scripts/extract_features.py +3 -0
  5. data/core/python-scripts/scripts/relation_classifier.py +1 -1
  6. data/core/python-scripts/train.py +2 -2
  7. data/core/site-packages/pre_build/KafNafParser-1.4-py2.7.egg-info/installed-files.txt +6 -6
  8. data/core/site-packages/pre_build/VUA_pylib-1.5-py2.7.egg-info/installed-files.txt +10 -10
  9. data/core/site-packages/pre_build/VUKafParserPy-1.0-py2.7.egg-info/installed-files.txt +5 -5
  10. data/core/vendor/src/crfsuite/crfsuite.sln +42 -42
  11. data/core/vendor/src/liblbfgs/lbfgs.sln +26 -26
  12. data/lib/opener/opinion_detectors/base.rb +14 -5
  13. data/lib/opener/opinion_detectors/base/version.rb +1 -1
  14. data/lib/opener/opinion_detectors/configuration_creator.rb +9 -8
  15. metadata +37 -68
  16. data/core/site-packages/pre_build/KafNafParser/KafNafParserMod.pyc +0 -0
  17. data/core/site-packages/pre_build/KafNafParser/__init__.pyc +0 -0
  18. data/core/site-packages/pre_build/KafNafParser/constituency_data.pyc +0 -0
  19. data/core/site-packages/pre_build/KafNafParser/coreference_data.pyc +0 -0
  20. data/core/site-packages/pre_build/KafNafParser/dependency_data.pyc +0 -0
  21. data/core/site-packages/pre_build/KafNafParser/entity_data.pyc +0 -0
  22. data/core/site-packages/pre_build/KafNafParser/external_references_data.pyc +0 -0
  23. data/core/site-packages/pre_build/KafNafParser/feature_extractor/__init__.pyc +0 -0
  24. data/core/site-packages/pre_build/KafNafParser/feature_extractor/constituency.pyc +0 -0
  25. data/core/site-packages/pre_build/KafNafParser/feature_extractor/dependency.pyc +0 -0
  26. data/core/site-packages/pre_build/KafNafParser/features_data.pyc +0 -0
  27. data/core/site-packages/pre_build/KafNafParser/header_data.pyc +0 -0
  28. data/core/site-packages/pre_build/KafNafParser/opinion_data.pyc +0 -0
  29. data/core/site-packages/pre_build/KafNafParser/references_data.pyc +0 -0
  30. data/core/site-packages/pre_build/KafNafParser/span_data.pyc +0 -0
  31. data/core/site-packages/pre_build/KafNafParser/term_data.pyc +0 -0
  32. data/core/site-packages/pre_build/KafNafParser/term_sentiment_data.pyc +0 -0
  33. data/core/site-packages/pre_build/KafNafParser/text_data.pyc +0 -0
  34. data/core/site-packages/pre_build/VUA_pylib/__init__.pyc +0 -0
  35. data/core/site-packages/pre_build/VUA_pylib/common/__init__.pyc +0 -0
  36. data/core/site-packages/pre_build/VUA_pylib/common/common.pyc +0 -0
  37. data/core/site-packages/pre_build/VUA_pylib/corpus_reader/__init__.pyc +0 -0
  38. data/core/site-packages/pre_build/VUA_pylib/corpus_reader/google_web_nl.pyc +0 -0
  39. data/core/site-packages/pre_build/VUA_pylib/io_utils/__init__.pyc +0 -0
  40. data/core/site-packages/pre_build/VUA_pylib/io_utils/feature_file.pyc +0 -0
  41. data/core/site-packages/pre_build/VUA_pylib/lexicon/__init__.pyc +0 -0
  42. data/core/site-packages/pre_build/VUA_pylib/lexicon/lexicon.pyc +0 -0
  43. data/core/site-packages/pre_build/VUKafParserPy/KafDataObjectsMod.pyc +0 -0
  44. data/core/site-packages/pre_build/VUKafParserPy/KafParserMod.pyc +0 -0
  45. data/core/site-packages/pre_build/VUKafParserPy/__init__.pyc +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 588e050a3930446fc35c58003caaf4f3b12adb0f
4
- data.tar.gz: 25d6f53a3c57642dc09a8a84152d8893d6c9c5f4
3
+ metadata.gz: 9c8aef27fcd7c10ed7176b0a73bec253436c9efb
4
+ data.tar.gz: 161e62461eded780c02c261e4f980f78ba0577e6
5
5
  SHA512:
6
- metadata.gz: 63c542cdf9838d32c7217da5579a7e20a1ea2ac292e0e234654544f8fd766286e8d92a2b5affb90d1e023ccc3dc4ce2f016e2d679db35d29593a2d611962410d
7
- data.tar.gz: 406815f2a58d195b181446e9026a6597dfee5140137538e4863a72119f7a0e057cd313204fd28140eba2b1110cc382733ea87401bbeece0efb69e342b008fd49
6
+ metadata.gz: 5723e548b534b9a743646de5e08adb3d59715b77bd931f381082ca3ee8924db9ed433f7655af6a9d10cef402350c9f60c4ef89afec5c2b87c90e6504a5cdb01d
7
+ data.tar.gz: 3f9e5386c7fb1400d4204c232e1498b44af8958ef576cd51441b25f707f65cc331785a3b6bff86b8e36f0e854feef817b270cd0d76727eb4a95a7346d40ca0dc
@@ -1,7 +1,15 @@
1
1
  #!/usr/bin/env python
2
2
 
3
3
  import sys
4
+ import getopt
4
5
  import os
6
+
7
+ this_folder = os.path.dirname(os.path.realpath(__file__))
8
+
9
+ # This updates the load path to ensure that the local site-packages directory
10
+ # can be used to load packages (e.g. a locally installed copy of lxml).
11
+ sys.path.append(os.path.join(this_folder, '../site-packages/pre_build'))
12
+
5
13
  import csv
6
14
  from tempfile import NamedTemporaryFile
7
15
  from subprocess import Popen, PIPE
@@ -10,18 +18,19 @@ import cPickle
10
18
  import argparse
11
19
 
12
20
  from scripts import lexicons as lexicons_manager
13
- from scripts.config_manager import Cconfig_manager, internal_config_filename
21
+ from scripts.config_manager import Cconfig_manager
14
22
  from scripts.extract_features import extract_features_from_kaf_naf_file
15
23
  from scripts.crfutils import extract_features_to_crf
16
24
  from scripts.link_entities_distance import link_entities_distance
17
25
  from scripts.relation_classifier import link_entities_svm
18
- from KafNafParserPy import *
26
+ from KafNafParser import *
27
+ from VUA_pylib import *
19
28
 
20
29
 
21
30
  DEBUG=0
22
31
 
23
32
  my_config_manager = Cconfig_manager()
24
- __this_folder = os.path.dirname(os.path.realpath(__file__))
33
+ __this_folder = os.getcwd()
25
34
  separator = '\t'
26
35
  __desc = 'Deluxe opinion miner (CRF+SVM)'
27
36
  __last_edited = '10jan2014'
@@ -336,8 +345,7 @@ def add_opinions_to_knaf(triples,knaf_obj,text_for_tid,ids_used, map_to_terms=Tr
336
345
  # Opoutfile_trasm can be a filename of a stream
337
346
  #Config file must be a string filename
338
347
  def tag_file_with_opinions(input_file_stream, output_file_stream,model_folder,kaf_obj=None, remove_existing_opinions=True,include_polarity_strength=True,timestamp=True):
339
-
340
- config_filename = os.path.join(model_folder,internal_config_filename)
348
+ config_filename = os.path.join(model_folder)
341
349
  if not os.path.exists(config_filename):
342
350
  print>>sys.stderr,'Config file not found on:',config_filename
343
351
  sys.exit(-1)
@@ -424,9 +432,9 @@ def tag_file_with_opinions(input_file_stream, output_file_stream,model_folder,ka
424
432
  my_lp.set_name(__desc)
425
433
  my_lp.set_version(__last_edited+'_'+__version)
426
434
  if timestamp:
427
- my_lp.set_timestamp() ##Set to the current date and time
435
+ my_lp.set_timestamp() ##Set to the current date and time
428
436
  else:
429
- my_lp.set_timestamp('*')
437
+ my_lp.set_timestamp('*')
430
438
  knaf_obj.add_linguistic_processor('opinions',my_lp)
431
439
  knaf_obj.dump(output_file_stream)
432
440
 
@@ -496,4 +504,4 @@ if __name__ == '__main__':
496
504
 
497
505
 
498
506
 
499
-
507
+
@@ -2,9 +2,6 @@ import os
2
2
  import ConfigParser
3
3
  import shutil
4
4
 
5
- internal_config_filename= 'config.cfg'
6
-
7
-
8
5
  def load_templates_from_file(filename):
9
6
  templates = []
10
7
  fic = open(filename,'r')
@@ -1,6 +1,9 @@
1
1
  #!/usr/bin/env python
2
2
 
3
3
  import sys
4
+ import getopt
5
+ import os
6
+
4
7
  import codecs
5
8
  import csv
6
9
  import os
@@ -3,7 +3,7 @@
3
3
  from extract_feats_relations import *
4
4
  from tempfile import NamedTemporaryFile
5
5
  from subprocess import Popen, PIPE
6
- from VUA_pylib.io import Cfeature_index
6
+ from VUA_pylib.io_utils import Cfeature_index
7
7
  import os
8
8
 
9
9
  config_manager = None
@@ -13,7 +13,7 @@ from collections import defaultdict
13
13
 
14
14
 
15
15
  from scripts import lexicons as lexicons_manager
16
- from scripts.config_manager import Cconfig_manager, internal_config_filename
16
+ from scripts.config_manager import Cconfig_manager
17
17
  from scripts.extract_features import extract_features_from_kaf_naf_file
18
18
  from scripts.crfutils import extract_features_to_crf
19
19
  from scripts.extract_feats_relations import create_rel_exp_tar_training, create_rel_exp_hol_training
@@ -54,7 +54,7 @@ def create_folders(config_filename):
54
54
  logging.debug('Created '+out_folder)
55
55
 
56
56
  #Copy the config filename to out_folder/config.cfg
57
- my_cfg = os.path.join(out_folder,internal_config_filename)
57
+ my_cfg = os.path.join(out_folder)
58
58
  shutil.copyfile(config_filename,my_cfg)
59
59
 
60
60
  feat_folder = my_config_manager.get_feature_folder_name()
@@ -13,9 +13,9 @@
13
13
  ../KafNafParser/span_data.py
14
14
  ../KafNafParser/KafNafParserMod.py
15
15
  ../KafNafParser/term_sentiment_data.py
16
- ../KafNafParser/feature_extractor/dependency.py
17
- ../KafNafParser/feature_extractor/constituency.py
18
16
  ../KafNafParser/feature_extractor/__init__.py
17
+ ../KafNafParser/feature_extractor/constituency.py
18
+ ../KafNafParser/feature_extractor/dependency.py
19
19
  ../KafNafParser/__init__.pyc
20
20
  ../KafNafParser/header_data.pyc
21
21
  ../KafNafParser/text_data.pyc
@@ -31,9 +31,9 @@
31
31
  ../KafNafParser/span_data.pyc
32
32
  ../KafNafParser/KafNafParserMod.pyc
33
33
  ../KafNafParser/term_sentiment_data.pyc
34
- ../KafNafParser/feature_extractor/dependency.pyc
35
- ../KafNafParser/feature_extractor/constituency.pyc
36
34
  ../KafNafParser/feature_extractor/__init__.pyc
35
+ ../KafNafParser/feature_extractor/constituency.pyc
36
+ ../KafNafParser/feature_extractor/dependency.pyc
37
37
  ../../../kaf_example.xml
38
38
  ../../../naf.dtd
39
39
  ../../../naf_example.xml
@@ -41,7 +41,7 @@
41
41
  ../../../README.md
42
42
  ../../../LICENSE
43
43
  ./
44
- SOURCES.txt
45
44
  dependency_links.txt
46
- top_level.txt
47
45
  PKG-INFO
46
+ SOURCES.txt
47
+ top_level.txt
@@ -1,23 +1,23 @@
1
1
  ../VUA_pylib/__init__.py
2
- ../VUA_pylib/lexicon/lexicon.py
3
2
  ../VUA_pylib/lexicon/__init__.py
4
- ../VUA_pylib/common/common.py
3
+ ../VUA_pylib/lexicon/lexicon.py
5
4
  ../VUA_pylib/common/__init__.py
6
- ../VUA_pylib/io_utils/feature_file.py
5
+ ../VUA_pylib/common/common.py
7
6
  ../VUA_pylib/io_utils/__init__.py
8
- ../VUA_pylib/corpus_reader/google_web_nl.py
7
+ ../VUA_pylib/io_utils/feature_file.py
9
8
  ../VUA_pylib/corpus_reader/__init__.py
9
+ ../VUA_pylib/corpus_reader/google_web_nl.py
10
10
  ../VUA_pylib/__init__.pyc
11
- ../VUA_pylib/lexicon/lexicon.pyc
12
11
  ../VUA_pylib/lexicon/__init__.pyc
13
- ../VUA_pylib/common/common.pyc
12
+ ../VUA_pylib/lexicon/lexicon.pyc
14
13
  ../VUA_pylib/common/__init__.pyc
15
- ../VUA_pylib/io_utils/feature_file.pyc
14
+ ../VUA_pylib/common/common.pyc
16
15
  ../VUA_pylib/io_utils/__init__.pyc
17
- ../VUA_pylib/corpus_reader/google_web_nl.pyc
16
+ ../VUA_pylib/io_utils/feature_file.pyc
18
17
  ../VUA_pylib/corpus_reader/__init__.pyc
18
+ ../VUA_pylib/corpus_reader/google_web_nl.pyc
19
19
  ./
20
- SOURCES.txt
21
20
  dependency_links.txt
22
- top_level.txt
23
21
  PKG-INFO
22
+ SOURCES.txt
23
+ top_level.txt
@@ -1,11 +1,11 @@
1
- ../VUKafParserPy/KafParserMod.py
2
1
  ../VUKafParserPy/__init__.py
3
2
  ../VUKafParserPy/KafDataObjectsMod.py
4
- ../VUKafParserPy/KafParserMod.pyc
3
+ ../VUKafParserPy/KafParserMod.py
5
4
  ../VUKafParserPy/__init__.pyc
6
5
  ../VUKafParserPy/KafDataObjectsMod.pyc
6
+ ../VUKafParserPy/KafParserMod.pyc
7
7
  ./
8
- top_level.txt
9
- SOURCES.txt
10
- PKG-INFO
11
8
  dependency_links.txt
9
+ PKG-INFO
10
+ SOURCES.txt
11
+ top_level.txt
@@ -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
@@ -23,6 +23,15 @@ module Opener
23
23
  #
24
24
  class Base
25
25
  attr_reader :args, :options, :conf_file, :models_path
26
+
27
+ ##
28
+ # Hash containing the default options to use.
29
+ #
30
+ # @return [Hash]
31
+ #
32
+ DEFAULT_OPTIONS = {
33
+ :domain => "hotel"
34
+ }.freeze
26
35
 
27
36
  ##
28
37
  # @param [Hash] options
@@ -30,8 +39,8 @@ module Opener
30
39
  # @option options [Array] :args Extra commandline arguments to use.
31
40
  #
32
41
  def initialize(options = {})
33
- @args = options.delete(:args) || []
34
- @options = options
42
+ @args = options.delete(:args) || []
43
+ @options = DEFAULT_OPTIONS.merge(options)
35
44
  end
36
45
 
37
46
  ##
@@ -51,9 +60,9 @@ module Opener
51
60
  # @return [Array]
52
61
  #
53
62
  def run(input)
54
- language = language(input)
55
- conf = ConfigurationCreator.new(language)
56
- @conf_file = conf.config_file_path
63
+ language = language(input)
64
+ conf = ConfigurationCreator.new(language, options[:domain])
65
+ @conf_file = conf.config_file_path
57
66
  @models_path = conf.models_path
58
67
 
59
68
  return capture(input)
@@ -1,7 +1,7 @@
1
1
  module Opener
2
2
  module OpinionDetectors
3
3
  class Base
4
- VERSION = "2.0.0"
4
+ VERSION = "2.0.1"
5
5
  end
6
6
  end
7
7
  end
@@ -4,12 +4,13 @@ require 'tempfile'
4
4
  module Opener
5
5
  module OpinionDetectors
6
6
  class ConfigurationCreator
7
- attr_reader :language
7
+ attr_reader :language, :domain
8
8
 
9
9
  include ERB::Util
10
10
 
11
- def initialize(language)
11
+ def initialize(language, domain)
12
12
  @language = language
13
+ @domain = domain
13
14
  end
14
15
 
15
16
  def config_file_path
@@ -50,12 +51,12 @@ module Opener
50
51
  def template
51
52
  %{
52
53
  [general]
53
- output_folder = <%=models_path%>/hotel_cfg1
54
+ output_folder = <%=models_path%>/<%=domain%>_cfg1
54
55
 
55
56
  [feature_templates]
56
- expression = <%=models_path%>/hotel_cfg1/feature_templates/feat_template_expr.txt
57
- holder = <%=models_path%>/hotel_cfg1/feature_templates/feat_template_holder.txt
58
- target = <%=models_path%>/hotel_cfg1/feature_templates/feat_template_target.txt
57
+ expression = <%=models_path%>/<%=domain%>_cfg1/feature_templates/feat_template_expr.txt
58
+ holder = <%=models_path%>/<%=domain%>_cfg1/feature_templates/feat_template_holder.txt
59
+ target = <%=models_path%>/<%=domain%>_cfg1/feature_templates/feat_template_target.txt
59
60
 
60
61
  [valid_opinions]
61
62
  negative = Negative;StrongNegative
@@ -64,8 +65,8 @@ positive = Positive;StrongPositive
64
65
  [relation_features]
65
66
  use_dependencies = True
66
67
  use_training_lexicons = True
67
- use_this_expression_lexicon = <%=models_path%>/hotel_cfg1/lexicons/polarity_lexicon.txt
68
- use_this_target_lexicon = <%=models_path%>/hotel_cfg1/lexicons/target_lexicon.txt
68
+ use_this_expression_lexicon = <%=models_path%>/<%=domain%>_cfg1/lexicons/polarity_lexicon.txt
69
+ use_this_target_lexicon = <%=models_path%>/<%=domain%>_cfg1/lexicons/target_lexicon.txt
69
70
  use_tokens_lemmas = True
70
71
  exp_tar_threshold = -0.75
71
72
  exp_hol_threshold = -0.5
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.0.0
4
+ version: 2.0.1
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-19 00:00:00.000000000 Z
11
+ date: 2014-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opener-build-tools
15
- requirement: !ruby/object:Gem::Requirement
15
+ version_requirements: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - '>='
18
18
  - !ruby/object:Gem::Version
19
19
  version: 0.2.7
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
20
+ requirement: !ruby/object:Gem::Requirement
23
21
  requirements:
24
- - - ">="
22
+ - - '>='
25
23
  - !ruby/object:Gem::Version
26
24
  version: 0.2.7
25
+ prerelease: false
26
+ type: :runtime
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
29
34
  requirement: !ruby/object:Gem::Requirement
30
35
  requirements:
31
- - - ">="
36
+ - - '>='
32
37
  - !ruby/object:Gem::Version
33
38
  version: '0'
34
- type: :runtime
35
39
  prerelease: false
40
+ type: :runtime
41
+ - !ruby/object:Gem::Dependency
42
+ name: nokogiri
36
43
  version_requirements: !ruby/object:Gem::Requirement
37
44
  requirements:
38
- - - ">="
45
+ - - '>='
39
46
  - !ruby/object:Gem::Version
40
47
  version: '0'
41
- - !ruby/object:Gem::Dependency
42
- name: nokogiri
43
48
  requirement: !ruby/object:Gem::Requirement
44
49
  requirements:
45
- - - ">="
50
+ - - '>='
46
51
  - !ruby/object:Gem::Version
47
52
  version: '0'
48
- type: :runtime
49
53
  prerelease: false
54
+ type: :runtime
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
50
57
  version_requirements: !ruby/object:Gem::Requirement
51
58
  requirements:
52
- - - ">="
59
+ - - '>='
53
60
  - !ruby/object:Gem::Version
54
61
  version: '0'
55
- - !ruby/object:Gem::Dependency
56
- name: rspec
57
62
  requirement: !ruby/object:Gem::Requirement
58
63
  requirements:
59
- - - ">="
64
+ - - '>='
60
65
  - !ruby/object:Gem::Version
61
66
  version: '0'
62
- type: :development
63
67
  prerelease: false
68
+ type: :development
69
+ - !ruby/object:Gem::Dependency
70
+ name: cucumber
64
71
  version_requirements: !ruby/object:Gem::Requirement
65
72
  requirements:
66
- - - ">="
73
+ - - '>='
67
74
  - !ruby/object:Gem::Version
68
75
  version: '0'
69
- - !ruby/object:Gem::Dependency
70
- name: cucumber
71
76
  requirement: !ruby/object:Gem::Requirement
72
77
  requirements:
73
- - - ">="
78
+ - - '>='
74
79
  - !ruby/object:Gem::Version
75
80
  version: '0'
76
- type: :development
77
81
  prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- version: '0'
82
+ type: :development
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:
@@ -129,75 +129,45 @@ files:
129
129
  - core/site-packages/pre_build/KafNafParser-1.4-py2.7.egg-info/installed-files.txt
130
130
  - core/site-packages/pre_build/KafNafParser-1.4-py2.7.egg-info/top_level.txt
131
131
  - core/site-packages/pre_build/KafNafParser/KafNafParserMod.py
132
- - core/site-packages/pre_build/KafNafParser/KafNafParserMod.pyc
133
132
  - core/site-packages/pre_build/KafNafParser/__init__.py
134
- - core/site-packages/pre_build/KafNafParser/__init__.pyc
135
133
  - core/site-packages/pre_build/KafNafParser/constituency_data.py
136
- - core/site-packages/pre_build/KafNafParser/constituency_data.pyc
137
134
  - core/site-packages/pre_build/KafNafParser/coreference_data.py
138
- - core/site-packages/pre_build/KafNafParser/coreference_data.pyc
139
135
  - core/site-packages/pre_build/KafNafParser/dependency_data.py
140
- - core/site-packages/pre_build/KafNafParser/dependency_data.pyc
141
136
  - core/site-packages/pre_build/KafNafParser/entity_data.py
142
- - core/site-packages/pre_build/KafNafParser/entity_data.pyc
143
137
  - core/site-packages/pre_build/KafNafParser/external_references_data.py
144
- - core/site-packages/pre_build/KafNafParser/external_references_data.pyc
145
138
  - core/site-packages/pre_build/KafNafParser/feature_extractor/__init__.py
146
- - core/site-packages/pre_build/KafNafParser/feature_extractor/__init__.pyc
147
139
  - core/site-packages/pre_build/KafNafParser/feature_extractor/constituency.py
148
- - core/site-packages/pre_build/KafNafParser/feature_extractor/constituency.pyc
149
140
  - core/site-packages/pre_build/KafNafParser/feature_extractor/dependency.py
150
- - core/site-packages/pre_build/KafNafParser/feature_extractor/dependency.pyc
151
141
  - core/site-packages/pre_build/KafNafParser/features_data.py
152
- - core/site-packages/pre_build/KafNafParser/features_data.pyc
153
142
  - core/site-packages/pre_build/KafNafParser/header_data.py
154
- - core/site-packages/pre_build/KafNafParser/header_data.pyc
155
143
  - core/site-packages/pre_build/KafNafParser/opinion_data.py
156
- - core/site-packages/pre_build/KafNafParser/opinion_data.pyc
157
144
  - core/site-packages/pre_build/KafNafParser/references_data.py
158
- - core/site-packages/pre_build/KafNafParser/references_data.pyc
159
145
  - core/site-packages/pre_build/KafNafParser/span_data.py
160
- - core/site-packages/pre_build/KafNafParser/span_data.pyc
161
146
  - core/site-packages/pre_build/KafNafParser/term_data.py
162
- - core/site-packages/pre_build/KafNafParser/term_data.pyc
163
147
  - core/site-packages/pre_build/KafNafParser/term_sentiment_data.py
164
- - core/site-packages/pre_build/KafNafParser/term_sentiment_data.pyc
165
148
  - core/site-packages/pre_build/KafNafParser/text_data.py
166
- - core/site-packages/pre_build/KafNafParser/text_data.pyc
167
149
  - core/site-packages/pre_build/VUA_pylib-1.5-py2.7.egg-info/PKG-INFO
168
150
  - core/site-packages/pre_build/VUA_pylib-1.5-py2.7.egg-info/SOURCES.txt
169
151
  - core/site-packages/pre_build/VUA_pylib-1.5-py2.7.egg-info/dependency_links.txt
170
152
  - core/site-packages/pre_build/VUA_pylib-1.5-py2.7.egg-info/installed-files.txt
171
153
  - core/site-packages/pre_build/VUA_pylib-1.5-py2.7.egg-info/top_level.txt
172
154
  - core/site-packages/pre_build/VUA_pylib/__init__.py
173
- - core/site-packages/pre_build/VUA_pylib/__init__.pyc
174
155
  - core/site-packages/pre_build/VUA_pylib/common/__init__.py
175
- - core/site-packages/pre_build/VUA_pylib/common/__init__.pyc
176
156
  - core/site-packages/pre_build/VUA_pylib/common/common.py
177
- - core/site-packages/pre_build/VUA_pylib/common/common.pyc
178
157
  - core/site-packages/pre_build/VUA_pylib/corpus_reader/__init__.py
179
- - core/site-packages/pre_build/VUA_pylib/corpus_reader/__init__.pyc
180
158
  - core/site-packages/pre_build/VUA_pylib/corpus_reader/google_web_nl.py
181
- - core/site-packages/pre_build/VUA_pylib/corpus_reader/google_web_nl.pyc
182
159
  - core/site-packages/pre_build/VUA_pylib/io_utils/__init__.py
183
- - core/site-packages/pre_build/VUA_pylib/io_utils/__init__.pyc
184
160
  - core/site-packages/pre_build/VUA_pylib/io_utils/feature_file.py
185
- - core/site-packages/pre_build/VUA_pylib/io_utils/feature_file.pyc
186
161
  - core/site-packages/pre_build/VUA_pylib/lexicon/__init__.py
187
- - core/site-packages/pre_build/VUA_pylib/lexicon/__init__.pyc
188
162
  - core/site-packages/pre_build/VUA_pylib/lexicon/lexicon.py
189
- - core/site-packages/pre_build/VUA_pylib/lexicon/lexicon.pyc
190
163
  - core/site-packages/pre_build/VUKafParserPy-1.0-py2.7.egg-info/PKG-INFO
191
164
  - core/site-packages/pre_build/VUKafParserPy-1.0-py2.7.egg-info/SOURCES.txt
192
165
  - core/site-packages/pre_build/VUKafParserPy-1.0-py2.7.egg-info/dependency_links.txt
193
166
  - core/site-packages/pre_build/VUKafParserPy-1.0-py2.7.egg-info/installed-files.txt
194
167
  - core/site-packages/pre_build/VUKafParserPy-1.0-py2.7.egg-info/top_level.txt
195
168
  - core/site-packages/pre_build/VUKafParserPy/KafDataObjectsMod.py
196
- - core/site-packages/pre_build/VUKafParserPy/KafDataObjectsMod.pyc
197
169
  - core/site-packages/pre_build/VUKafParserPy/KafParserMod.py
198
- - core/site-packages/pre_build/VUKafParserPy/KafParserMod.pyc
199
170
  - core/site-packages/pre_build/VUKafParserPy/__init__.py
200
- - core/site-packages/pre_build/VUKafParserPy/__init__.pyc
201
171
  - core/vendor/src/crfsuite/AUTHORS
202
172
  - core/vendor/src/crfsuite/COPYING
203
173
  - core/vendor/src/crfsuite/ChangeLog
@@ -350,25 +320,24 @@ files:
350
320
  homepage: http://opener-project.github.com/
351
321
  licenses: []
352
322
  metadata: {}
353
- post_install_message:
323
+ post_install_message:
354
324
  rdoc_options: []
355
325
  require_paths:
356
326
  - lib
357
327
  required_ruby_version: !ruby/object:Gem::Requirement
358
328
  requirements:
359
- - - ">="
329
+ - - '>='
360
330
  - !ruby/object:Gem::Version
361
331
  version: 1.9.2
362
332
  required_rubygems_version: !ruby/object:Gem::Requirement
363
333
  requirements:
364
- - - ">="
334
+ - - '>='
365
335
  - !ruby/object:Gem::Version
366
336
  version: '0'
367
337
  requirements: []
368
- rubyforge_project:
338
+ rubyforge_project:
369
339
  rubygems_version: 2.2.2
370
- signing_key:
340
+ signing_key:
371
341
  specification_version: 4
372
342
  summary: Base Opinion Detector for english and dutch.
373
343
  test_files: []
374
- has_rdoc: