Commit a72879fb authored by Anze Vavpetic's avatar Anze Vavpetic

fixed bug: dumping aleph features to arff would produce an unparsable file

parent 9505cea1
...@@ -218,7 +218,7 @@ class Aleph(object): ...@@ -218,7 +218,7 @@ class Aleph(object):
examples = re.findall(r"example\((\w+),(\[[\d,]*\]),(\w+)\)\.", pl_dataset) examples = re.findall(r"example\((\w+),(\[[\d,]*\]),(\w+)\)\.", pl_dataset)
for _, features, cls in examples: for _, features, cls in examples:
vals = [] vals = []
for i in range(1, class_id): for i in range(0, class_id):
vals.append('1' if i in json.loads(features) else '0') vals.append('1' if i in json.loads(features) else '0')
vals.append(cls) vals.append(cls)
cat('%s' % ','.join(vals)) cat('%s' % ','.join(vals))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment