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.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/ext/hack/Rakefile +0 -2
- data/lib/opener/opinion_detector_basic/version.rb +1 -1
- data/opener-opinion-detector-basic.gemspec +0 -1
- data/task/compile.rake +1 -1
- data/task/requirements.rake +0 -1
- metadata +2 -142
- data/core/vendor/src/crfsuite/AUTHORS +0 -1
- data/core/vendor/src/crfsuite/COPYING +0 -27
- data/core/vendor/src/crfsuite/ChangeLog +0 -103
- data/core/vendor/src/crfsuite/INSTALL +0 -236
- data/core/vendor/src/crfsuite/Makefile.am +0 -19
- data/core/vendor/src/crfsuite/Makefile.in +0 -783
- data/core/vendor/src/crfsuite/README +0 -183
- data/core/vendor/src/crfsuite/aclocal.m4 +0 -9018
- data/core/vendor/src/crfsuite/autogen.sh +0 -38
- data/core/vendor/src/crfsuite/compile +0 -143
- data/core/vendor/src/crfsuite/config.guess +0 -1502
- data/core/vendor/src/crfsuite/config.h.in +0 -198
- data/core/vendor/src/crfsuite/config.sub +0 -1714
- data/core/vendor/src/crfsuite/configure +0 -14273
- data/core/vendor/src/crfsuite/configure.in +0 -149
- data/core/vendor/src/crfsuite/crfsuite.sln +0 -42
- data/core/vendor/src/crfsuite/depcomp +0 -630
- data/core/vendor/src/crfsuite/example/chunking.py +0 -49
- data/core/vendor/src/crfsuite/example/crfutils.py +0 -179
- data/core/vendor/src/crfsuite/example/ner.py +0 -270
- data/core/vendor/src/crfsuite/example/pos.py +0 -78
- data/core/vendor/src/crfsuite/example/template.py +0 -88
- data/core/vendor/src/crfsuite/frontend/Makefile.am +0 -29
- data/core/vendor/src/crfsuite/frontend/Makefile.in +0 -640
- data/core/vendor/src/crfsuite/frontend/dump.c +0 -116
- data/core/vendor/src/crfsuite/frontend/frontend.vcxproj +0 -129
- data/core/vendor/src/crfsuite/frontend/iwa.c +0 -273
- data/core/vendor/src/crfsuite/frontend/iwa.h +0 -65
- data/core/vendor/src/crfsuite/frontend/learn.c +0 -439
- data/core/vendor/src/crfsuite/frontend/main.c +0 -137
- data/core/vendor/src/crfsuite/frontend/option.c +0 -93
- data/core/vendor/src/crfsuite/frontend/option.h +0 -86
- data/core/vendor/src/crfsuite/frontend/readdata.h +0 -38
- data/core/vendor/src/crfsuite/frontend/reader.c +0 -136
- data/core/vendor/src/crfsuite/frontend/tag.c +0 -427
- data/core/vendor/src/crfsuite/genbinary.sh.in +0 -15
- data/core/vendor/src/crfsuite/include/Makefile.am +0 -11
- data/core/vendor/src/crfsuite/include/Makefile.in +0 -461
- data/core/vendor/src/crfsuite/include/crfsuite.h +0 -1063
- data/core/vendor/src/crfsuite/include/crfsuite.hpp +0 -555
- data/core/vendor/src/crfsuite/include/crfsuite_api.hpp +0 -400
- data/core/vendor/src/crfsuite/include/os.h +0 -61
- data/core/vendor/src/crfsuite/install-sh +0 -520
- data/core/vendor/src/crfsuite/lib/cqdb/COPYING +0 -28
- data/core/vendor/src/crfsuite/lib/cqdb/Makefile.am +0 -21
- data/core/vendor/src/crfsuite/lib/cqdb/Makefile.in +0 -549
- data/core/vendor/src/crfsuite/lib/cqdb/cqdb.vcxproj +0 -86
- data/core/vendor/src/crfsuite/lib/cqdb/include/cqdb.h +0 -524
- data/core/vendor/src/crfsuite/lib/cqdb/src/cqdb.c +0 -587
- data/core/vendor/src/crfsuite/lib/cqdb/src/lookup3.c +0 -976
- data/core/vendor/src/crfsuite/lib/crf/Makefile.am +0 -46
- data/core/vendor/src/crfsuite/lib/crf/Makefile.in +0 -721
- data/core/vendor/src/crfsuite/lib/crf/crf.vcxproj +0 -216
- data/core/vendor/src/crfsuite/lib/crf/src/crf1d.h +0 -353
- data/core/vendor/src/crfsuite/lib/crf/src/crf1d_context.c +0 -705
- data/core/vendor/src/crfsuite/lib/crf/src/crf1d_encode.c +0 -943
- data/core/vendor/src/crfsuite/lib/crf/src/crf1d_feature.c +0 -352
- data/core/vendor/src/crfsuite/lib/crf/src/crf1d_model.c +0 -994
- data/core/vendor/src/crfsuite/lib/crf/src/crf1d_tag.c +0 -550
- data/core/vendor/src/crfsuite/lib/crf/src/crfsuite.c +0 -492
- data/core/vendor/src/crfsuite/lib/crf/src/crfsuite_internal.h +0 -236
- data/core/vendor/src/crfsuite/lib/crf/src/crfsuite_train.c +0 -272
- data/core/vendor/src/crfsuite/lib/crf/src/dataset.c +0 -106
- data/core/vendor/src/crfsuite/lib/crf/src/dictionary.c +0 -118
- data/core/vendor/src/crfsuite/lib/crf/src/holdout.c +0 -80
- data/core/vendor/src/crfsuite/lib/crf/src/logging.c +0 -91
- data/core/vendor/src/crfsuite/lib/crf/src/logging.h +0 -48
- data/core/vendor/src/crfsuite/lib/crf/src/params.c +0 -335
- data/core/vendor/src/crfsuite/lib/crf/src/params.h +0 -80
- data/core/vendor/src/crfsuite/lib/crf/src/quark.c +0 -172
- data/core/vendor/src/crfsuite/lib/crf/src/quark.h +0 -46
- data/core/vendor/src/crfsuite/lib/crf/src/rumavl.c +0 -1107
- data/core/vendor/src/crfsuite/lib/crf/src/rumavl.h +0 -160
- data/core/vendor/src/crfsuite/lib/crf/src/train_arow.c +0 -408
- data/core/vendor/src/crfsuite/lib/crf/src/train_averaged_perceptron.c +0 -242
- data/core/vendor/src/crfsuite/lib/crf/src/train_l2sgd.c +0 -507
- data/core/vendor/src/crfsuite/lib/crf/src/train_lbfgs.c +0 -338
- data/core/vendor/src/crfsuite/lib/crf/src/train_passive_aggressive.c +0 -435
- data/core/vendor/src/crfsuite/lib/crf/src/vecmath.h +0 -341
- data/core/vendor/src/crfsuite/ltmain.sh +0 -8413
- data/core/vendor/src/crfsuite/missing +0 -376
- data/core/vendor/src/crfsuite/swig/Makefile.am +0 -13
- data/core/vendor/src/crfsuite/swig/Makefile.in +0 -365
- data/core/vendor/src/crfsuite/swig/crfsuite.cpp +0 -2
- data/core/vendor/src/crfsuite/swig/export.i +0 -32
- data/core/vendor/src/crfsuite/swig/python/README +0 -92
- data/core/vendor/src/crfsuite/swig/python/crfsuite.py +0 -329
- data/core/vendor/src/crfsuite/swig/python/export_wrap.cpp +0 -14355
- data/core/vendor/src/crfsuite/swig/python/export_wrap.h +0 -63
- data/core/vendor/src/crfsuite/swig/python/prepare.sh +0 -9
- data/core/vendor/src/crfsuite/swig/python/sample_tag.py +0 -52
- data/core/vendor/src/crfsuite/swig/python/sample_train.py +0 -68
- data/core/vendor/src/crfsuite/swig/python/setup.py +0 -44
- data/core/vendor/src/crfsuite/win32/stdint.h +0 -679
- data/core/vendor/src/liblbfgs/AUTHORS +0 -1
- data/core/vendor/src/liblbfgs/COPYING +0 -22
- data/core/vendor/src/liblbfgs/ChangeLog +0 -120
- data/core/vendor/src/liblbfgs/INSTALL +0 -231
- data/core/vendor/src/liblbfgs/Makefile.am +0 -10
- data/core/vendor/src/liblbfgs/Makefile.in +0 -638
- data/core/vendor/src/liblbfgs/NEWS +0 -0
- data/core/vendor/src/liblbfgs/README +0 -71
- data/core/vendor/src/liblbfgs/aclocal.m4 +0 -6985
- data/core/vendor/src/liblbfgs/autogen.sh +0 -38
- data/core/vendor/src/liblbfgs/config.guess +0 -1411
- data/core/vendor/src/liblbfgs/config.h.in +0 -64
- data/core/vendor/src/liblbfgs/config.sub +0 -1500
- data/core/vendor/src/liblbfgs/configure +0 -21146
- data/core/vendor/src/liblbfgs/configure.in +0 -107
- data/core/vendor/src/liblbfgs/depcomp +0 -522
- data/core/vendor/src/liblbfgs/include/lbfgs.h +0 -745
- data/core/vendor/src/liblbfgs/install-sh +0 -322
- data/core/vendor/src/liblbfgs/lbfgs.sln +0 -26
- data/core/vendor/src/liblbfgs/lib/Makefile.am +0 -24
- data/core/vendor/src/liblbfgs/lib/Makefile.in +0 -499
- data/core/vendor/src/liblbfgs/lib/arithmetic_ansi.h +0 -133
- data/core/vendor/src/liblbfgs/lib/arithmetic_sse_double.h +0 -294
- data/core/vendor/src/liblbfgs/lib/arithmetic_sse_float.h +0 -298
- data/core/vendor/src/liblbfgs/lib/lbfgs.c +0 -1371
- data/core/vendor/src/liblbfgs/lib/lib.vcxproj +0 -95
- data/core/vendor/src/liblbfgs/ltmain.sh +0 -6426
- data/core/vendor/src/liblbfgs/missing +0 -353
- data/core/vendor/src/liblbfgs/sample/Makefile.am +0 -15
- data/core/vendor/src/liblbfgs/sample/Makefile.in +0 -433
- data/core/vendor/src/liblbfgs/sample/sample.c +0 -81
- data/core/vendor/src/liblbfgs/sample/sample.cpp +0 -126
- data/core/vendor/src/liblbfgs/sample/sample.vcxproj +0 -105
- data/core/vendor/src/svm_light/LICENSE.txt +0 -59
- data/core/vendor/src/svm_light/Makefile +0 -105
- data/core/vendor/src/svm_light/kernel.h +0 -40
- data/core/vendor/src/svm_light/svm_classify.c +0 -197
- data/core/vendor/src/svm_light/svm_common.c +0 -985
- data/core/vendor/src/svm_light/svm_common.h +0 -301
- data/core/vendor/src/svm_light/svm_hideo.c +0 -1062
- data/core/vendor/src/svm_light/svm_learn.c +0 -4147
- data/core/vendor/src/svm_light/svm_learn.h +0 -169
- data/core/vendor/src/svm_light/svm_learn_main.c +0 -397
- data/core/vendor/src/svm_light/svm_loqo.c +0 -211
- data/task/c.rake +0 -36
- data/task/submodules.rake +0 -5
@@ -1,63 +0,0 @@
|
|
1
|
-
/* ----------------------------------------------------------------------------
|
2
|
-
* This file was automatically generated by SWIG (http://www.swig.org).
|
3
|
-
* Version 2.0.4
|
4
|
-
*
|
5
|
-
* This file is not intended to be easily readable and contains a number of
|
6
|
-
* coding conventions designed to improve portability and efficiency. Do not make
|
7
|
-
* changes to this file unless you know what you are doing--modify the SWIG
|
8
|
-
* interface file instead.
|
9
|
-
* ----------------------------------------------------------------------------- */
|
10
|
-
|
11
|
-
#ifndef SWIG_crfsuite_WRAP_H_
|
12
|
-
#define SWIG_crfsuite_WRAP_H_
|
13
|
-
|
14
|
-
#include <map>
|
15
|
-
#include <string>
|
16
|
-
|
17
|
-
|
18
|
-
class SwigDirector_Trainer : public CRFSuite::Trainer, public Swig::Director {
|
19
|
-
|
20
|
-
public:
|
21
|
-
SwigDirector_Trainer(PyObject *self);
|
22
|
-
virtual ~SwigDirector_Trainer();
|
23
|
-
virtual void message(std::string const &msg);
|
24
|
-
|
25
|
-
|
26
|
-
/* Internal Director utilities */
|
27
|
-
public:
|
28
|
-
bool swig_get_inner(const char* swig_protected_method_name) const {
|
29
|
-
std::map<std::string, bool>::const_iterator iv = swig_inner.find(swig_protected_method_name);
|
30
|
-
return (iv != swig_inner.end() ? iv->second : false);
|
31
|
-
}
|
32
|
-
|
33
|
-
void swig_set_inner(const char* swig_protected_method_name, bool val) const
|
34
|
-
{ swig_inner[swig_protected_method_name] = val;}
|
35
|
-
|
36
|
-
private:
|
37
|
-
mutable std::map<std::string, bool> swig_inner;
|
38
|
-
|
39
|
-
|
40
|
-
#if defined(SWIG_PYTHON_DIRECTOR_VTABLE)
|
41
|
-
/* VTable implementation */
|
42
|
-
PyObject *swig_get_method(size_t method_index, const char *method_name) const {
|
43
|
-
PyObject *method = vtable[method_index];
|
44
|
-
if (!method) {
|
45
|
-
swig::SwigVar_PyObject name = SWIG_Python_str_FromChar(method_name);
|
46
|
-
method = PyObject_GetAttr(swig_get_self(), name);
|
47
|
-
if (!method) {
|
48
|
-
std::string msg = "Method in class Trainer doesn't exist, undefined ";
|
49
|
-
msg += method_name;
|
50
|
-
Swig::DirectorMethodException::raise(msg.c_str());
|
51
|
-
}
|
52
|
-
vtable[method_index] = method;
|
53
|
-
};
|
54
|
-
return method;
|
55
|
-
}
|
56
|
-
private:
|
57
|
-
mutable swig::SwigVar_PyObject vtable[1];
|
58
|
-
#endif
|
59
|
-
|
60
|
-
};
|
61
|
-
|
62
|
-
|
63
|
-
#endif
|
@@ -1,52 +0,0 @@
|
|
1
|
-
#!/usr/bin/env python
|
2
|
-
|
3
|
-
import crfsuite
|
4
|
-
import sys
|
5
|
-
|
6
|
-
def instances(fi):
|
7
|
-
xseq = crfsuite.ItemSequence()
|
8
|
-
|
9
|
-
for line in fi:
|
10
|
-
line = line.strip('\n')
|
11
|
-
if not line:
|
12
|
-
# An empty line presents an end of a sequence.
|
13
|
-
yield xseq
|
14
|
-
xseq = crfsuite.ItemSequence()
|
15
|
-
continue
|
16
|
-
|
17
|
-
# Split the line with TAB characters.
|
18
|
-
fields = line.split('\t')
|
19
|
-
item = crfsuite.Item()
|
20
|
-
for field in fields[1:]:
|
21
|
-
p = field.rfind(':')
|
22
|
-
if p == -1:
|
23
|
-
# Unweighted (weight=1) attribute.
|
24
|
-
item.append(crfsuite.Attribute(field))
|
25
|
-
else:
|
26
|
-
# Weighted attribute
|
27
|
-
item.append(crfsuite.Attribute(field[:p], float(field[p+1:])))
|
28
|
-
|
29
|
-
# Append the item to the item sequence.
|
30
|
-
xseq.append(item)
|
31
|
-
|
32
|
-
if __name__ == '__main__':
|
33
|
-
fi = sys.stdin
|
34
|
-
fo = sys.stdout
|
35
|
-
|
36
|
-
# Create a tagger object.
|
37
|
-
tagger = crfsuite.Tagger()
|
38
|
-
|
39
|
-
# Load the model to the tagger.
|
40
|
-
tagger.open(sys.argv[1])
|
41
|
-
|
42
|
-
for xseq in instances(fi):
|
43
|
-
# Tag the sequence.
|
44
|
-
tagger.set(xseq)
|
45
|
-
# Obtain the label sequence predicted by the tagger.
|
46
|
-
yseq = tagger.viterbi()
|
47
|
-
# Output the probability of the predicted label sequence.
|
48
|
-
print tagger.probability(yseq)
|
49
|
-
for t, y in enumerate(yseq):
|
50
|
-
# Output the predicted labels with their marginal probabilities.
|
51
|
-
print '%s:%f' % (y, tagger.marginal(y, t))
|
52
|
-
print
|
@@ -1,68 +0,0 @@
|
|
1
|
-
#!/usr/bin/env python
|
2
|
-
|
3
|
-
import crfsuite
|
4
|
-
import sys
|
5
|
-
|
6
|
-
# Inherit crfsuite.Trainer to implement message() function, which receives
|
7
|
-
# progress messages from a training process.
|
8
|
-
class Trainer(crfsuite.Trainer):
|
9
|
-
def message(self, s):
|
10
|
-
# Simply output the progress messages to STDOUT.
|
11
|
-
sys.stdout.write(s)
|
12
|
-
|
13
|
-
def instances(fi):
|
14
|
-
xseq = crfsuite.ItemSequence()
|
15
|
-
yseq = crfsuite.StringList()
|
16
|
-
|
17
|
-
for line in fi:
|
18
|
-
line = line.strip('\n')
|
19
|
-
if not line:
|
20
|
-
# An empty line presents an end of a sequence.
|
21
|
-
yield xseq, tuple(yseq)
|
22
|
-
xseq = crfsuite.ItemSequence()
|
23
|
-
yseq = crfsuite.StringList()
|
24
|
-
continue
|
25
|
-
|
26
|
-
# Split the line with TAB characters.
|
27
|
-
fields = line.split('\t')
|
28
|
-
|
29
|
-
# Append attributes to the item.
|
30
|
-
item = crfsuite.Item()
|
31
|
-
for field in fields[1:]:
|
32
|
-
p = field.rfind(':')
|
33
|
-
if p == -1:
|
34
|
-
# Unweighted (weight=1) attribute.
|
35
|
-
item.append(crfsuite.Attribute(field))
|
36
|
-
else:
|
37
|
-
# Weighted attribute
|
38
|
-
item.append(crfsuite.Attribute(field[:p], float(field[p+1:])))
|
39
|
-
|
40
|
-
# Append the item to the item sequence.
|
41
|
-
xseq.append(item)
|
42
|
-
# Append the label to the label sequence.
|
43
|
-
yseq.append(fields[0])
|
44
|
-
|
45
|
-
if __name__ == '__main__':
|
46
|
-
# This demonstrates how to obtain the version string of CRFsuite.
|
47
|
-
print crfsuite.version()
|
48
|
-
|
49
|
-
# Create a Trainer object.
|
50
|
-
trainer = Trainer()
|
51
|
-
|
52
|
-
# Read training instances from STDIN, and set them to trainer.
|
53
|
-
for xseq, yseq in instances(sys.stdin):
|
54
|
-
trainer.append(xseq, yseq, 0)
|
55
|
-
|
56
|
-
# Use L2-regularized SGD and 1st-order dyad features.
|
57
|
-
trainer.select('l2sgd', 'crf1d')
|
58
|
-
|
59
|
-
# This demonstrates how to list parameters and obtain their values.
|
60
|
-
for name in trainer.params():
|
61
|
-
print name, trainer.get(name), trainer.help(name)
|
62
|
-
|
63
|
-
# Set the coefficient for L2 regularization to 0.1
|
64
|
-
trainer.set('c2', '0.1')
|
65
|
-
|
66
|
-
# Start training; the training process will invoke trainer.message()
|
67
|
-
# to report the progress.
|
68
|
-
trainer.train(sys.argv[1], -1)
|
@@ -1,44 +0,0 @@
|
|
1
|
-
#!/usr/bin/env python
|
2
|
-
|
3
|
-
"""
|
4
|
-
setup.py file for SWIG example
|
5
|
-
"""
|
6
|
-
|
7
|
-
import sys
|
8
|
-
import os.path
|
9
|
-
|
10
|
-
def get_rootdir():
|
11
|
-
return '/home/users/okazaki/local'
|
12
|
-
def get_includedir():
|
13
|
-
return os.path.join(get_rootdir(), 'include')
|
14
|
-
def get_librarydir():
|
15
|
-
return os.path.join(get_rootdir(), 'lib')
|
16
|
-
|
17
|
-
import os; os.environ['CC'] = 'g++'; os.environ['CXX'] = 'g++';
|
18
|
-
os.environ['CPP'] = 'g++'; os.environ['LDSHARED'] = 'g++'
|
19
|
-
|
20
|
-
from distutils.core import setup, Extension
|
21
|
-
|
22
|
-
crfsuite_module = Extension(
|
23
|
-
'_crfsuite',
|
24
|
-
sources = [
|
25
|
-
'crfsuite.cpp',
|
26
|
-
'export_wrap.cpp',
|
27
|
-
],
|
28
|
-
# include_dirs=['../../include',],
|
29
|
-
extra_link_args=['-shared'],
|
30
|
-
# library_dirs=['../../lib/crf',],
|
31
|
-
libraries=['crfsuite'],
|
32
|
-
# extra_objects=['../../lib/crf/libcrfsuite.la'],
|
33
|
-
language='c++',
|
34
|
-
)
|
35
|
-
|
36
|
-
setup(
|
37
|
-
name = '@PACKAGE@',
|
38
|
-
version = '@VERSION@',
|
39
|
-
author = 'Naoaki Okazaki',
|
40
|
-
description = """CRFSuite Python module""",
|
41
|
-
ext_modules = [crfsuite_module],
|
42
|
-
py_modules = ["crfsuite"],
|
43
|
-
)
|
44
|
-
|