Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Alain Shakour
clowdflows
Commits
b21c7ef5
Commit
b21c7ef5
authored
Nov 04, 2013
by
Janez K
Browse files
Merge branch 'dev' of source.ijs.si:mothra into dev
parents
71a426c1
86592231
Changes
2
Hide whitespace changes
Inline
Side-by-side
workflows/mysql/converters.py
View file @
b21c7ef5
...
...
@@ -170,6 +170,10 @@ class Aleph_Converter(ILP_Converter):
pos_rows
.
append
(
row
)
else
:
neg_rows
.
append
(
row
)
if
not
pos_rows
:
raise
Exception
(
'No positive examples with the given target attribute value, please re-check.'
)
self
.
__pos_examples
=
'
\n
'
.
join
([
'%s(%s).'
%
(
self
.
__target_predicate
(),
id
)
for
_
,
id
in
pos_rows
])
self
.
__neg_examples
=
'
\n
'
.
join
([
'%s(%s).'
%
(
self
.
__target_predicate
(),
id
)
for
_
,
id
in
neg_rows
])
return
self
.
__pos_examples
,
self
.
__neg_examples
...
...
workflows/mysql/library.py
View file @
b21c7ef5
...
...
@@ -32,7 +32,10 @@ def mysql_rsd_converter(input_dict):
def
mysql_aleph_converter
(
input_dict
):
dump
=
input_dict
[
'dump'
]
==
'true'
aleph
=
Aleph_Converter
(
input_dict
[
'context'
],
target_att_val
=
input_dict
[
'target_att_val'
],
discr_intervals
=
input_dict
[
'discr_intervals'
]
or
{},
dump
=
dump
)
target_att_val
=
input_dict
[
'target_att_val'
]
if
not
target_att_val
:
raise
Exception
(
'Please specify a target attribute value.'
)
aleph
=
Aleph_Converter
(
input_dict
[
'context'
],
target_att_val
=
target_att_val
,
discr_intervals
=
input_dict
[
'discr_intervals'
]
or
{},
dump
=
dump
)
return
{
'pos_examples'
:
aleph
.
positive_examples
(),
'neg_examples'
:
aleph
.
negative_examples
(),
'bk'
:
aleph
.
background_knowledge
()}
def
mysql_treeliker_converter
(
input_dict
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment