opener-opinion-detector-basic 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (148) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -0
  3. data/ext/hack/Rakefile +0 -2
  4. data/lib/opener/opinion_detector_basic/version.rb +1 -1
  5. data/opener-opinion-detector-basic.gemspec +0 -1
  6. data/task/compile.rake +1 -1
  7. data/task/requirements.rake +0 -1
  8. metadata +2 -142
  9. data/core/vendor/src/crfsuite/AUTHORS +0 -1
  10. data/core/vendor/src/crfsuite/COPYING +0 -27
  11. data/core/vendor/src/crfsuite/ChangeLog +0 -103
  12. data/core/vendor/src/crfsuite/INSTALL +0 -236
  13. data/core/vendor/src/crfsuite/Makefile.am +0 -19
  14. data/core/vendor/src/crfsuite/Makefile.in +0 -783
  15. data/core/vendor/src/crfsuite/README +0 -183
  16. data/core/vendor/src/crfsuite/aclocal.m4 +0 -9018
  17. data/core/vendor/src/crfsuite/autogen.sh +0 -38
  18. data/core/vendor/src/crfsuite/compile +0 -143
  19. data/core/vendor/src/crfsuite/config.guess +0 -1502
  20. data/core/vendor/src/crfsuite/config.h.in +0 -198
  21. data/core/vendor/src/crfsuite/config.sub +0 -1714
  22. data/core/vendor/src/crfsuite/configure +0 -14273
  23. data/core/vendor/src/crfsuite/configure.in +0 -149
  24. data/core/vendor/src/crfsuite/crfsuite.sln +0 -42
  25. data/core/vendor/src/crfsuite/depcomp +0 -630
  26. data/core/vendor/src/crfsuite/example/chunking.py +0 -49
  27. data/core/vendor/src/crfsuite/example/crfutils.py +0 -179
  28. data/core/vendor/src/crfsuite/example/ner.py +0 -270
  29. data/core/vendor/src/crfsuite/example/pos.py +0 -78
  30. data/core/vendor/src/crfsuite/example/template.py +0 -88
  31. data/core/vendor/src/crfsuite/frontend/Makefile.am +0 -29
  32. data/core/vendor/src/crfsuite/frontend/Makefile.in +0 -640
  33. data/core/vendor/src/crfsuite/frontend/dump.c +0 -116
  34. data/core/vendor/src/crfsuite/frontend/frontend.vcxproj +0 -129
  35. data/core/vendor/src/crfsuite/frontend/iwa.c +0 -273
  36. data/core/vendor/src/crfsuite/frontend/iwa.h +0 -65
  37. data/core/vendor/src/crfsuite/frontend/learn.c +0 -439
  38. data/core/vendor/src/crfsuite/frontend/main.c +0 -137
  39. data/core/vendor/src/crfsuite/frontend/option.c +0 -93
  40. data/core/vendor/src/crfsuite/frontend/option.h +0 -86
  41. data/core/vendor/src/crfsuite/frontend/readdata.h +0 -38
  42. data/core/vendor/src/crfsuite/frontend/reader.c +0 -136
  43. data/core/vendor/src/crfsuite/frontend/tag.c +0 -427
  44. data/core/vendor/src/crfsuite/genbinary.sh.in +0 -15
  45. data/core/vendor/src/crfsuite/include/Makefile.am +0 -11
  46. data/core/vendor/src/crfsuite/include/Makefile.in +0 -461
  47. data/core/vendor/src/crfsuite/include/crfsuite.h +0 -1063
  48. data/core/vendor/src/crfsuite/include/crfsuite.hpp +0 -555
  49. data/core/vendor/src/crfsuite/include/crfsuite_api.hpp +0 -400
  50. data/core/vendor/src/crfsuite/include/os.h +0 -61
  51. data/core/vendor/src/crfsuite/install-sh +0 -520
  52. data/core/vendor/src/crfsuite/lib/cqdb/COPYING +0 -28
  53. data/core/vendor/src/crfsuite/lib/cqdb/Makefile.am +0 -21
  54. data/core/vendor/src/crfsuite/lib/cqdb/Makefile.in +0 -549
  55. data/core/vendor/src/crfsuite/lib/cqdb/cqdb.vcxproj +0 -86
  56. data/core/vendor/src/crfsuite/lib/cqdb/include/cqdb.h +0 -524
  57. data/core/vendor/src/crfsuite/lib/cqdb/src/cqdb.c +0 -587
  58. data/core/vendor/src/crfsuite/lib/cqdb/src/lookup3.c +0 -976
  59. data/core/vendor/src/crfsuite/lib/crf/Makefile.am +0 -46
  60. data/core/vendor/src/crfsuite/lib/crf/Makefile.in +0 -721
  61. data/core/vendor/src/crfsuite/lib/crf/crf.vcxproj +0 -216
  62. data/core/vendor/src/crfsuite/lib/crf/src/crf1d.h +0 -353
  63. data/core/vendor/src/crfsuite/lib/crf/src/crf1d_context.c +0 -705
  64. data/core/vendor/src/crfsuite/lib/crf/src/crf1d_encode.c +0 -943
  65. data/core/vendor/src/crfsuite/lib/crf/src/crf1d_feature.c +0 -352
  66. data/core/vendor/src/crfsuite/lib/crf/src/crf1d_model.c +0 -994
  67. data/core/vendor/src/crfsuite/lib/crf/src/crf1d_tag.c +0 -550
  68. data/core/vendor/src/crfsuite/lib/crf/src/crfsuite.c +0 -492
  69. data/core/vendor/src/crfsuite/lib/crf/src/crfsuite_internal.h +0 -236
  70. data/core/vendor/src/crfsuite/lib/crf/src/crfsuite_train.c +0 -272
  71. data/core/vendor/src/crfsuite/lib/crf/src/dataset.c +0 -106
  72. data/core/vendor/src/crfsuite/lib/crf/src/dictionary.c +0 -118
  73. data/core/vendor/src/crfsuite/lib/crf/src/holdout.c +0 -80
  74. data/core/vendor/src/crfsuite/lib/crf/src/logging.c +0 -91
  75. data/core/vendor/src/crfsuite/lib/crf/src/logging.h +0 -48
  76. data/core/vendor/src/crfsuite/lib/crf/src/params.c +0 -335
  77. data/core/vendor/src/crfsuite/lib/crf/src/params.h +0 -80
  78. data/core/vendor/src/crfsuite/lib/crf/src/quark.c +0 -172
  79. data/core/vendor/src/crfsuite/lib/crf/src/quark.h +0 -46
  80. data/core/vendor/src/crfsuite/lib/crf/src/rumavl.c +0 -1107
  81. data/core/vendor/src/crfsuite/lib/crf/src/rumavl.h +0 -160
  82. data/core/vendor/src/crfsuite/lib/crf/src/train_arow.c +0 -408
  83. data/core/vendor/src/crfsuite/lib/crf/src/train_averaged_perceptron.c +0 -242
  84. data/core/vendor/src/crfsuite/lib/crf/src/train_l2sgd.c +0 -507
  85. data/core/vendor/src/crfsuite/lib/crf/src/train_lbfgs.c +0 -338
  86. data/core/vendor/src/crfsuite/lib/crf/src/train_passive_aggressive.c +0 -435
  87. data/core/vendor/src/crfsuite/lib/crf/src/vecmath.h +0 -341
  88. data/core/vendor/src/crfsuite/ltmain.sh +0 -8413
  89. data/core/vendor/src/crfsuite/missing +0 -376
  90. data/core/vendor/src/crfsuite/swig/Makefile.am +0 -13
  91. data/core/vendor/src/crfsuite/swig/Makefile.in +0 -365
  92. data/core/vendor/src/crfsuite/swig/crfsuite.cpp +0 -2
  93. data/core/vendor/src/crfsuite/swig/export.i +0 -32
  94. data/core/vendor/src/crfsuite/swig/python/README +0 -92
  95. data/core/vendor/src/crfsuite/swig/python/crfsuite.py +0 -329
  96. data/core/vendor/src/crfsuite/swig/python/export_wrap.cpp +0 -14355
  97. data/core/vendor/src/crfsuite/swig/python/export_wrap.h +0 -63
  98. data/core/vendor/src/crfsuite/swig/python/prepare.sh +0 -9
  99. data/core/vendor/src/crfsuite/swig/python/sample_tag.py +0 -52
  100. data/core/vendor/src/crfsuite/swig/python/sample_train.py +0 -68
  101. data/core/vendor/src/crfsuite/swig/python/setup.py +0 -44
  102. data/core/vendor/src/crfsuite/win32/stdint.h +0 -679
  103. data/core/vendor/src/liblbfgs/AUTHORS +0 -1
  104. data/core/vendor/src/liblbfgs/COPYING +0 -22
  105. data/core/vendor/src/liblbfgs/ChangeLog +0 -120
  106. data/core/vendor/src/liblbfgs/INSTALL +0 -231
  107. data/core/vendor/src/liblbfgs/Makefile.am +0 -10
  108. data/core/vendor/src/liblbfgs/Makefile.in +0 -638
  109. data/core/vendor/src/liblbfgs/NEWS +0 -0
  110. data/core/vendor/src/liblbfgs/README +0 -71
  111. data/core/vendor/src/liblbfgs/aclocal.m4 +0 -6985
  112. data/core/vendor/src/liblbfgs/autogen.sh +0 -38
  113. data/core/vendor/src/liblbfgs/config.guess +0 -1411
  114. data/core/vendor/src/liblbfgs/config.h.in +0 -64
  115. data/core/vendor/src/liblbfgs/config.sub +0 -1500
  116. data/core/vendor/src/liblbfgs/configure +0 -21146
  117. data/core/vendor/src/liblbfgs/configure.in +0 -107
  118. data/core/vendor/src/liblbfgs/depcomp +0 -522
  119. data/core/vendor/src/liblbfgs/include/lbfgs.h +0 -745
  120. data/core/vendor/src/liblbfgs/install-sh +0 -322
  121. data/core/vendor/src/liblbfgs/lbfgs.sln +0 -26
  122. data/core/vendor/src/liblbfgs/lib/Makefile.am +0 -24
  123. data/core/vendor/src/liblbfgs/lib/Makefile.in +0 -499
  124. data/core/vendor/src/liblbfgs/lib/arithmetic_ansi.h +0 -133
  125. data/core/vendor/src/liblbfgs/lib/arithmetic_sse_double.h +0 -294
  126. data/core/vendor/src/liblbfgs/lib/arithmetic_sse_float.h +0 -298
  127. data/core/vendor/src/liblbfgs/lib/lbfgs.c +0 -1371
  128. data/core/vendor/src/liblbfgs/lib/lib.vcxproj +0 -95
  129. data/core/vendor/src/liblbfgs/ltmain.sh +0 -6426
  130. data/core/vendor/src/liblbfgs/missing +0 -353
  131. data/core/vendor/src/liblbfgs/sample/Makefile.am +0 -15
  132. data/core/vendor/src/liblbfgs/sample/Makefile.in +0 -433
  133. data/core/vendor/src/liblbfgs/sample/sample.c +0 -81
  134. data/core/vendor/src/liblbfgs/sample/sample.cpp +0 -126
  135. data/core/vendor/src/liblbfgs/sample/sample.vcxproj +0 -105
  136. data/core/vendor/src/svm_light/LICENSE.txt +0 -59
  137. data/core/vendor/src/svm_light/Makefile +0 -105
  138. data/core/vendor/src/svm_light/kernel.h +0 -40
  139. data/core/vendor/src/svm_light/svm_classify.c +0 -197
  140. data/core/vendor/src/svm_light/svm_common.c +0 -985
  141. data/core/vendor/src/svm_light/svm_common.h +0 -301
  142. data/core/vendor/src/svm_light/svm_hideo.c +0 -1062
  143. data/core/vendor/src/svm_light/svm_learn.c +0 -4147
  144. data/core/vendor/src/svm_light/svm_learn.h +0 -169
  145. data/core/vendor/src/svm_light/svm_learn_main.c +0 -397
  146. data/core/vendor/src/svm_light/svm_loqo.c +0 -211
  147. data/task/c.rake +0 -36
  148. data/task/submodules.rake +0 -5
@@ -1,105 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
- <ItemGroup Label="ProjectConfigurations">
4
- <ProjectConfiguration Include="Debug|Win32">
5
- <Configuration>Debug</Configuration>
6
- <Platform>Win32</Platform>
7
- </ProjectConfiguration>
8
- <ProjectConfiguration Include="Release|Win32">
9
- <Configuration>Release</Configuration>
10
- <Platform>Win32</Platform>
11
- </ProjectConfiguration>
12
- </ItemGroup>
13
- <PropertyGroup Label="Globals">
14
- <ProjectGuid>{B4D7D5F5-4A4E-49D5-B38A-E5673520DE66}</ProjectGuid>
15
- <RootNamespace>sample</RootNamespace>
16
- <Keyword>Win32Proj</Keyword>
17
- </PropertyGroup>
18
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
19
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
20
- <ConfigurationType>Application</ConfigurationType>
21
- <CharacterSet>Unicode</CharacterSet>
22
- <WholeProgramOptimization>true</WholeProgramOptimization>
23
- </PropertyGroup>
24
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
25
- <ConfigurationType>Application</ConfigurationType>
26
- <CharacterSet>Unicode</CharacterSet>
27
- </PropertyGroup>
28
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
29
- <ImportGroup Label="ExtensionSettings">
30
- </ImportGroup>
31
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
32
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
33
- </ImportGroup>
34
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
35
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
36
- </ImportGroup>
37
- <PropertyGroup Label="UserMacros" />
38
- <PropertyGroup>
39
- <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
40
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
41
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
42
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
43
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
44
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
45
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
46
- <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
47
- <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
48
- <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
49
- <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
50
- <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
51
- <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
52
- </PropertyGroup>
53
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
54
- <ClCompile>
55
- <Optimization>Disabled</Optimization>
56
- <AdditionalIncludeDirectories>$(SolutionDir)include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
57
- <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
58
- <MinimalRebuild>true</MinimalRebuild>
59
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
60
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
61
- <PrecompiledHeader>
62
- </PrecompiledHeader>
63
- <WarningLevel>Level3</WarningLevel>
64
- <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
65
- </ClCompile>
66
- <Link>
67
- <GenerateDebugInformation>true</GenerateDebugInformation>
68
- <SubSystem>Console</SubSystem>
69
- <TargetMachine>MachineX86</TargetMachine>
70
- </Link>
71
- </ItemDefinitionGroup>
72
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
73
- <ClCompile>
74
- <Optimization>MaxSpeed</Optimization>
75
- <IntrinsicFunctions>true</IntrinsicFunctions>
76
- <AdditionalIncludeDirectories>$(SolutionDir)include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
77
- <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
78
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
79
- <FunctionLevelLinking>true</FunctionLevelLinking>
80
- <PrecompiledHeader>
81
- </PrecompiledHeader>
82
- <WarningLevel>Level3</WarningLevel>
83
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
84
- </ClCompile>
85
- <Link>
86
- <GenerateDebugInformation>true</GenerateDebugInformation>
87
- <SubSystem>Console</SubSystem>
88
- <OptimizeReferences>true</OptimizeReferences>
89
- <EnableCOMDATFolding>true</EnableCOMDATFolding>
90
- <TargetMachine>MachineX86</TargetMachine>
91
- </Link>
92
- </ItemDefinitionGroup>
93
- <ItemGroup>
94
- <ClCompile Include="sample.c" />
95
- </ItemGroup>
96
- <ItemGroup>
97
- <ProjectReference Include="..\lib\lib.vcxproj">
98
- <Project>{c4405b73-a899-44bf-8681-04ce040b6705}</Project>
99
- <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
100
- </ProjectReference>
101
- </ItemGroup>
102
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
103
- <ImportGroup Label="ExtensionTargets">
104
- </ImportGroup>
105
- </Project>
@@ -1,59 +0,0 @@
1
- SVM-Light
2
- ---------
3
-
4
- Available at http://svmlight.joachims.org/
5
-
6
- Author: Thorsten Joachims
7
- thorsten@joachims.org
8
-
9
- Cornell University
10
- Department of Computer Science
11
- 4153 Upson Hall
12
- Ithaca, NY 14853
13
- USA
14
-
15
- LICENSING TERMS
16
-
17
- This program is granted free of charge for research and education
18
- purposes. However you must obtain a license from the author to use it
19
- for commercial purposes.
20
-
21
- Scientific results produced using the software provided shall
22
- acknowledge the use of SVM-Light. Please cite as
23
-
24
- T. Joachims, Making large-Scale SVM Learning
25
- Practical. Advances in Kernel Methods - Support Vector
26
- Learning, B. Sch�lkopf and C. Burges and A. Smola (ed.),
27
- MIT-Press, 1999.
28
- http://www-ai.cs.uni-dortmund.de/DOKUMENTE/joachims_99a.pdf
29
-
30
- Moreover shall the author of SVM-Light be informed about the
31
- publication.
32
-
33
- The software must not be modified and distributed without prior
34
- permission of the author.
35
-
36
- By using SVM-Light you agree to the licensing terms.
37
-
38
-
39
- NO WARRANTY
40
-
41
- BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
42
- FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT
43
- WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER
44
- PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND,
45
- EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
46
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
47
- PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
48
- PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME
49
- THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
50
-
51
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
52
- WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
53
- REDISTRIBUTE THE PROGRAM, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
54
- GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF
55
- THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO
56
- LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
57
- YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY
58
- OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED
59
- OF THE POSSIBILITY OF SUCH DAMAGES.
@@ -1,105 +0,0 @@
1
- #
2
- # makefile for svm_light
3
- #
4
- # Thorsten Joachims, 2002
5
- #
6
-
7
- #Use the following to compile under unix or cygwin
8
- CC = gcc
9
- LD = gcc
10
-
11
- #Uncomment the following line to make CYGWIN produce stand-alone Windows executables
12
- #SFLAGS= -mno-cygwin
13
-
14
- CFLAGS= $(SFLAGS) -O3 # release C-Compiler flags
15
- LFLAGS= $(SFLAGS) -O3 # release linker flags
16
- #CFLAGS= $(SFLAGS) -pg -Wall -pedantic # debugging C-Compiler flags
17
- #LFLAGS= $(SFLAGS) -pg # debugging linker flags
18
- LIBS=-L. -lm # used libraries
19
-
20
- all: svm_learn_hideo svm_classify
21
-
22
- tidy:
23
- rm -f *.o
24
- rm -f pr_loqo/*.o
25
-
26
- clean: tidy
27
- rm -f svm_learn
28
- rm -f svm_classify
29
- rm -f libsvmlight.so
30
-
31
- help: info
32
-
33
- info:
34
- @echo
35
- @echo "make for SVM-light Thorsten Joachims, 1998"
36
- @echo
37
- @echo "Thanks to Ralf Herbrich for the initial version."
38
- @echo
39
- @echo "USAGE: make [svm_learn | svm_learn_loqo | svm_learn_hideo | "
40
- @echo " libsvmlight_hideo | libsvmlight_loqo | "
41
- @echo " svm_classify | all | clean | tidy]"
42
- @echo
43
- @echo " svm_learn builds the learning module (prefers HIDEO)"
44
- @echo " svm_learn_hideo builds the learning module using HIDEO optimizer"
45
- @echo " svm_learn_loqo builds the learning module using PR_LOQO optimizer"
46
- @echo " svm_classify builds the classfication module"
47
- @echo " libsvmlight_hideo builds shared object library that can be linked into"
48
- @echo " other code using HIDEO"
49
- @echo " libsvmlight_loqo builds shared object library that can be linked into"
50
- @echo " other code using PR_LOQO"
51
- @echo " all (default) builds svm_learn + svm_classify"
52
- @echo " clean removes .o and target files"
53
- @echo " tidy removes .o files"
54
- @echo
55
-
56
- # Create executables svm_learn and svm_classify
57
-
58
- svm_learn_hideo: svm_learn_main.o svm_learn.o svm_common.o svm_hideo.o
59
- $(LD) $(LFLAGS) svm_learn_main.o svm_learn.o svm_common.o svm_hideo.o -o svm_learn $(LIBS)
60
-
61
- #svm_learn_loqo: svm_learn_main.o svm_learn.o svm_common.o svm_loqo.o loqo
62
- # $(LD) $(LFLAGS) svm_learn_main.o svm_learn.o svm_common.o svm_loqo.o pr_loqo/pr_loqo.o -o svm_learn $(LIBS)
63
-
64
- svm_classify: svm_classify.o svm_common.o
65
- $(LD) $(LFLAGS) svm_classify.o svm_common.o -o svm_classify $(LIBS)
66
-
67
-
68
- # Create library libsvmlight.so, so that external code can get access to the
69
- # learning and classification functions of svm-light by linking this library.
70
-
71
- svm_learn_hideo_noexe: svm_learn_main.o svm_learn.o svm_common.o svm_hideo.o
72
-
73
- libsvmlight_hideo: svm_learn_main.o svm_learn.o svm_common.o svm_hideo.o
74
- $(LD) -shared svm_learn.o svm_common.o svm_hideo.o -o libsvmlight.so
75
-
76
- #svm_learn_loqo_noexe: svm_learn_main.o svm_learn.o svm_common.o svm_loqo.o loqo
77
-
78
- #libsvmlight_loqo: svm_learn_main.o svm_learn.o svm_common.o svm_loqo.o
79
- # $(LD) -shared svm_learn.o svm_common.o svm_loqo.o pr_loqo/pr_loqo.o -o libsvmlight.so
80
-
81
- # Compile components
82
-
83
- svm_hideo.o: svm_hideo.c
84
- $(CC) -c $(CFLAGS) svm_hideo.c -o svm_hideo.o
85
-
86
- #svm_loqo.o: svm_loqo.c
87
- # $(CC) -c $(CFLAGS) svm_loqo.c -o svm_loqo.o
88
-
89
- svm_common.o: svm_common.c svm_common.h kernel.h
90
- $(CC) -c $(CFLAGS) svm_common.c -o svm_common.o
91
-
92
- svm_learn.o: svm_learn.c svm_common.h
93
- $(CC) -c $(CFLAGS) svm_learn.c -o svm_learn.o
94
-
95
- svm_learn_main.o: svm_learn_main.c svm_learn.h svm_common.h
96
- $(CC) -c $(CFLAGS) svm_learn_main.c -o svm_learn_main.o
97
-
98
- svm_classify.o: svm_classify.c svm_common.h kernel.h
99
- $(CC) -c $(CFLAGS) svm_classify.c -o svm_classify.o
100
-
101
- #loqo: pr_loqo/pr_loqo.o
102
-
103
- #pr_loqo/pr_loqo.o: pr_loqo/pr_loqo.c
104
- # $(CC) -c $(CFLAGS) pr_loqo/pr_loqo.c -o pr_loqo/pr_loqo.o
105
-
@@ -1,40 +0,0 @@
1
- /************************************************************************/
2
- /* */
3
- /* kernel.h */
4
- /* */
5
- /* User defined kernel function. Feel free to plug in your own. */
6
- /* */
7
- /* Copyright: Thorsten Joachims */
8
- /* Date: 16.12.97 */
9
- /* */
10
- /************************************************************************/
11
-
12
- /* KERNEL_PARM is defined in svm_common.h The field 'custom' is reserved for */
13
- /* parameters of the user defined kernel. You can also access and use */
14
- /* the parameters of the other kernels. Just replace the line
15
- return((double)(1.0));
16
- with your own kernel. */
17
-
18
- /* Example: The following computes the polynomial kernel. sprod_ss
19
- computes the inner product between two sparse vectors.
20
-
21
- return((CFLOAT)pow(kernel_parm->coef_lin*sprod_ss(a->words,b->words)
22
- +kernel_parm->coef_const,(double)kernel_parm->poly_degree));
23
- */
24
-
25
- /* If you are implementing a kernel that is not based on a
26
- feature/value representation, you might want to make use of the
27
- field "userdefined" in SVECTOR. By default, this field will contain
28
- whatever string you put behind a # sign in the example file. So, if
29
- a line in your training file looks like
30
-
31
- -1 1:3 5:6 #abcdefg
32
-
33
- then the SVECTOR field "words" will contain the vector 1:3 5:6, and
34
- "userdefined" will contain the string "abcdefg". */
35
-
36
- double custom_kernel(KERNEL_PARM *kernel_parm, SVECTOR *a, SVECTOR *b)
37
- /* plug in you favorite kernel */
38
- {
39
- return((double)(1.0));
40
- }
@@ -1,197 +0,0 @@
1
- /***********************************************************************/
2
- /* */
3
- /* svm_classify.c */
4
- /* */
5
- /* Classification module of Support Vector Machine. */
6
- /* */
7
- /* Author: Thorsten Joachims */
8
- /* Date: 02.07.02 */
9
- /* */
10
- /* Copyright (c) 2002 Thorsten Joachims - All rights reserved */
11
- /* */
12
- /* This software is available for non-commercial use only. It must */
13
- /* not be modified and distributed without prior permission of the */
14
- /* author. The author is not responsible for implications from the */
15
- /* use of this software. */
16
- /* */
17
- /************************************************************************/
18
-
19
- # include "svm_common.h"
20
-
21
- char docfile[200];
22
- char modelfile[200];
23
- char predictionsfile[200];
24
-
25
- void read_input_parameters(int, char **, char *, char *, char *, long *,
26
- long *);
27
- void print_help(void);
28
-
29
-
30
- int main (int argc, char* argv[])
31
- {
32
- DOC *doc; /* test example */
33
- WORD *words;
34
- long max_docs,max_words_doc,lld;
35
- long totdoc=0,queryid,slackid;
36
- long correct=0,incorrect=0,no_accuracy=0;
37
- long res_a=0,res_b=0,res_c=0,res_d=0,wnum,pred_format;
38
- long j;
39
- double t1,runtime=0;
40
- double dist,doc_label,costfactor;
41
- char *line,*comment;
42
- FILE *predfl,*docfl;
43
- MODEL *model;
44
-
45
- read_input_parameters(argc,argv,docfile,modelfile,predictionsfile,
46
- &verbosity,&pred_format);
47
-
48
- nol_ll(docfile,&max_docs,&max_words_doc,&lld); /* scan size of input file */
49
- max_words_doc+=2;
50
- lld+=2;
51
-
52
- line = (char *)my_malloc(sizeof(char)*lld);
53
- words = (WORD *)my_malloc(sizeof(WORD)*(max_words_doc+10));
54
-
55
- model=read_model(modelfile);
56
-
57
- if(model->kernel_parm.kernel_type == 0) { /* linear kernel */
58
- /* compute weight vector */
59
- add_weight_vector_to_linear_model(model);
60
- }
61
-
62
- if(verbosity>=2) {
63
- printf("Classifying test examples.."); fflush(stdout);
64
- }
65
-
66
- if ((docfl = fopen (docfile, "r")) == NULL)
67
- { perror (docfile); exit (1); }
68
- if ((predfl = fopen (predictionsfile, "w")) == NULL)
69
- { perror (predictionsfile); exit (1); }
70
-
71
- while((!feof(docfl)) && fgets(line,(int)lld,docfl)) {
72
- if(line[0] == '#') continue; /* line contains comments */
73
- parse_document(line,words,&doc_label,&queryid,&slackid,&costfactor,&wnum,
74
- max_words_doc,&comment);
75
- totdoc++;
76
- if(model->kernel_parm.kernel_type == 0) { /* linear kernel */
77
- for(j=0;(words[j]).wnum != 0;j++) { /* Check if feature numbers */
78
- if((words[j]).wnum>model->totwords) /* are not larger than in */
79
- (words[j]).wnum=0; /* model. Remove feature if */
80
- } /* necessary. */
81
- doc = create_example(-1,0,0,0.0,create_svector(words,comment,1.0));
82
- t1=get_runtime();
83
- dist=classify_example_linear(model,doc);
84
- runtime+=(get_runtime()-t1);
85
- free_example(doc,1);
86
- }
87
- else { /* non-linear kernel */
88
- doc = create_example(-1,0,0,0.0,create_svector(words,comment,1.0));
89
- t1=get_runtime();
90
- dist=classify_example(model,doc);
91
- runtime+=(get_runtime()-t1);
92
- free_example(doc,1);
93
- }
94
- if(dist>0) {
95
- if(pred_format==0) { /* old weired output format */
96
- fprintf(predfl,"%.8g:+1 %.8g:-1\n",dist,-dist);
97
- }
98
- if(doc_label>0) correct++; else incorrect++;
99
- if(doc_label>0) res_a++; else res_b++;
100
- }
101
- else {
102
- if(pred_format==0) { /* old weired output format */
103
- fprintf(predfl,"%.8g:-1 %.8g:+1\n",-dist,dist);
104
- }
105
- if(doc_label<0) correct++; else incorrect++;
106
- if(doc_label>0) res_c++; else res_d++;
107
- }
108
- if(pred_format==1) { /* output the value of decision function */
109
- fprintf(predfl,"%.8g\n",dist);
110
- }
111
- if((int)(0.01+(doc_label*doc_label)) != 1)
112
- { no_accuracy=1; } /* test data is not binary labeled */
113
- if(verbosity>=2) {
114
- if(totdoc % 100 == 0) {
115
- printf("%ld..",totdoc); fflush(stdout);
116
- }
117
- }
118
- }
119
- fclose(predfl);
120
- fclose(docfl);
121
- free(line);
122
- free(words);
123
- free_model(model,1);
124
-
125
- if(verbosity>=2) {
126
- printf("done\n");
127
-
128
- /* Note by Gary Boone Date: 29 April 2000 */
129
- /* o Timing is inaccurate. The timer has 0.01 second resolution. */
130
- /* Because classification of a single vector takes less than */
131
- /* 0.01 secs, the timer was underflowing. */
132
- printf("Runtime (without IO) in cpu-seconds: %.2f\n",
133
- (float)(runtime/100.0));
134
-
135
- }
136
- if((!no_accuracy) && (verbosity>=1)) {
137
- printf("Accuracy on test set: %.2f%% (%ld correct, %ld incorrect, %ld total)\n",(float)(correct)*100.0/totdoc,correct,incorrect,totdoc);
138
- printf("Precision/recall on test set: %.2f%%/%.2f%%\n",(float)(res_a)*100.0/(res_a+res_b),(float)(res_a)*100.0/(res_a+res_c));
139
- }
140
-
141
- return(0);
142
- }
143
-
144
- void read_input_parameters(int argc, char **argv, char *docfile,
145
- char *modelfile, char *predictionsfile,
146
- long int *verbosity, long int *pred_format)
147
- {
148
- long i;
149
-
150
- /* set default */
151
- strcpy (modelfile, "svm_model");
152
- strcpy (predictionsfile, "svm_predictions");
153
- (*verbosity)=2;
154
- (*pred_format)=1;
155
-
156
- for(i=1;(i<argc) && ((argv[i])[0] == '-');i++) {
157
- switch ((argv[i])[1])
158
- {
159
- case 'h': print_help(); exit(0);
160
- case 'v': i++; (*verbosity)=atol(argv[i]); break;
161
- case 'f': i++; (*pred_format)=atol(argv[i]); break;
162
- default: printf("\nUnrecognized option %s!\n\n",argv[i]);
163
- print_help();
164
- exit(0);
165
- }
166
- }
167
- if((i+1)>=argc) {
168
- printf("\nNot enough input parameters!\n\n");
169
- print_help();
170
- exit(0);
171
- }
172
- strcpy (docfile, argv[i]);
173
- strcpy (modelfile, argv[i+1]);
174
- if((i+2)<argc) {
175
- strcpy (predictionsfile, argv[i+2]);
176
- }
177
- if(((*pred_format) != 0) && ((*pred_format) != 1)) {
178
- printf("\nOutput format can only take the values 0 or 1!\n\n");
179
- print_help();
180
- exit(0);
181
- }
182
- }
183
-
184
- void print_help(void)
185
- {
186
- printf("\nSVM-light %s: Support Vector Machine, classification module %s\n",VERSION,VERSION_DATE);
187
- copyright_notice();
188
- printf(" usage: svm_classify [options] example_file model_file output_file\n\n");
189
- printf("options: -h -> this help\n");
190
- printf(" -v [0..3] -> verbosity level (default 2)\n");
191
- printf(" -f [0,1] -> 0: old output format of V1.0\n");
192
- printf(" -> 1: output the value of decision function (default)\n\n");
193
- }
194
-
195
-
196
-
197
-