Coupure prévue mardi 3 Août au matin pour maintenance du serveur. Nous faisons au mieux pour que celle-ci soit la plus brève possible.

Commit b5500b7a authored by Anze Vavpetic's avatar Anze Vavpetic
Browse files

fixed package structures for the following packages: nlp, decision support,...

fixed package structures for the following packages: nlp, decision support, subgroup discovery, bioinformatics.
parent eace9f79
......@@ -171,6 +171,10 @@ if USE_CONCURRENCY:
'south',
'workflows',
'workflows.latino',
'workflows.decision_support',
'workflows.bioinformatics',
'workflows.subgroup_discovery',
'workflows.nlp',
'website',
'signuplogin',
'django_extensions',
......@@ -190,6 +194,7 @@ else:
'south',
'workflows',
'workflows.latino',
'workflows.decision_support',
'website',
'signuplogin',
'django_extensions',
......
import os
package_name = 'bioinformatics'
package_root = os.path.dirname(__file__)
package_statics = os.path.join(os.path.dirname(__file__), 'static', package_name)
package_bin = os.path.join(package_root, 'bin')
auto_update_db = True
create_backups = True
import os
package_name = 'decision_support'
package_root = os.path.dirname(__file__)
package_statics = os.path.join(os.path.dirname(__file__), 'static', package_name)
package_bin = os.path.join(package_root, 'bin')
auto_update_db = True
create_backups = True
import sys
from django.shortcuts import render
from decision_support.interaction import *
from subgroup_discovery.interaction import *
from workflows import packageLibImporter
def setattr_local(name, value, package):
......
from workflows.security import safeOpen
import nlp
import cPickle
import json
import sys
from decision_support.library import *
from subgroup_discovery.library import *
from workflows import packageLibImporter
def setattr_local(name, value, package):
......@@ -807,47 +804,6 @@ def odt_to_arff(input_dict):
f = toARFFstring(input_dict['odt'])
output_dict['arff'] = f.getvalue()
return output_dict
# NLP tools
def merge_sentences(input_dict):
"""
Merges the input sentences in XML according to the specified method.
"""
method = input_dict['method']
merged_sen, id_to_sent = set(), {}
ids_list = []
for sentsXML in input_dict['sentences']:
sents = nlp.parse_def_sentences(sentsXML)
ids = set(map(lambda x: x['id'], sents))
ids_list.append(ids)
# Save the map from id to sentence
for sent in sents:
id_to_sent[sent['id']] = sent
if len(merged_sen) == 0:
merged_sen = ids
if method == 'union':
merged_sen = merged_sen | ids
elif method == 'intersection':
merged_sen = merged_sen & ids
elif method == 'intersection_two':
for ids_alt in ids_list:
merged_sen = merged_sen | (ids_alt & ids)
return {'merged_sentences' : nlp.sentences_to_xml([id_to_sent[sid] for sid in merged_sen])}
def load_corpus(input_dict):
'''
Parses an input file and encodes it in base 64.
'''
import os.path
import base64
f = safeOpen(input_dict['file'])
fname = os.path.basename(input_dict['file'])
data = base64.b64encode(f.read())
from services.webservice import WebService
ws = WebService('http://bodysnatcher.ijs.si:8092/totale?wsdl', 600)
response = ws.client.parseFile(fileName=fname, inFile=data)
return {'corpus' : response['parsedFile']}
def string_to_file(input_dict):
return {}
......
import nlp
import os.path
import base64
from services.webservice import WebService
def merge_sentences(input_dict):
"""
Merges the input sentences in XML according to the specified method.
"""
method = input_dict['method']
merged_sen, id_to_sent = set(), {}
ids_list = []
for sentsXML in input_dict['sentences']:
sents = nlp.parse_def_sentences(sentsXML)
ids = set(map(lambda x: x['id'], sents))
ids_list.append(ids)
# Save the map from id to sentence
for sent in sents:
id_to_sent[sent['id']] = sent
if len(merged_sen) == 0:
merged_sen = ids
if method == 'union':
merged_sen = merged_sen | ids
elif method == 'intersection':
merged_sen = merged_sen & ids
elif method == 'intersection_two':
for ids_alt in ids_list:
merged_sen = merged_sen | (ids_alt & ids)
return {'merged_sentences' : nlp.sentences_to_xml([id_to_sent[sid] for sid in merged_sen])}
def load_corpus(input_dict):
'''
Parses an input file and encodes it in base 64.
'''
f = safeOpen(input_dict['file'])
fname = os.path.basename(input_dict['file'])
data = base64.b64encode(f.read())
ws = WebService('http://bodysnatcher.ijs.si:8092/totale?wsdl', 600)
response = ws.client.parseFile(fileName=fname, inFile=data)
return {'corpus' : response['parsedFile']}
import os
package_name = 'nlp'
package_root = os.path.dirname(__file__)
package_statics = os.path.join(os.path.dirname(__file__), 'static', package_name)
package_bin = os.path.join(package_root, 'bin')
auto_update_db = True
create_backups = True
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