diff --git a/data-computer/v1/lda-segment.cfg b/data-computer/v1/lda-segment.cfg new file mode 100644 index 0000000..fcdfde1 --- /dev/null +++ b/data-computer/v1/lda-segment.cfg @@ -0,0 +1,40 @@ +[use] +plugin = basics +plugin = analytics +plugin = spawn + +# +# Step 2.1 (spécifique): Lancer un calcul sur tous les items reçus +[exec] +# command should be executable ! +command = ./v1/lda.py + +# Step 2.1.1 (spécifique): Propose un reformatage de sortie pour usage simplifier dans lodex +[exchange] +value = get('value.topics').map((o, i) => _.zip(o.words, o.words_weights).map(x=>x.concat(i).concat(o.topic_weight))).flatten().map(y=> ({source: y[0], target: y[2], weight: y[1], origin: self.id})).filter(Boolean) +[ungroup] + +# Step 2.1.2 (spécifique): On regoupe les origin par segments identiques +[replace] +path = id +value = self().omit(['uuid', 'origin']) +path = value +value = get('origin') + +[aggregate] +path = value + +[replace] +path = source +value = get('id.source') + +path = target +value = get('id.target') + +path = weight +value = get('id.weight') + +path = origin +value = get('value') + + diff --git a/data-computer/v1/lda-segment.ini b/data-computer/v1/lda-segment.ini index 79b43cf..9955327 100644 --- a/data-computer/v1/lda-segment.ini +++ b/data-computer/v1/lda-segment.ini @@ -31,34 +31,31 @@ path = generator value = lda -[use] -plugin = basics -plugin = analytics -plugin = spawn - # Step 1 (générique): Charger le fichier corpus [delegate] file = charger.cfg +# Step 1.1 (spécifique): Controle du premier element en supposant que les autres lui ressemblent +[singleton] +[singleton/validate] +path = id +rule = required + +path = value +rule = required|array + # Step 2 (générique): Traiter de manière asynchnore les items reçus [fork] standalone = true logger = logger.cfg -# Step 2.1 (spécifique): Lancer un calcul sur tous les items reçus -[fork/exec] -# command should be executable ! -command = ./v1/lda.py +# Step 2.0 (optionnel): Accélére le détachement du fork si l'enrichissement est lent +[fork/delegate] +file = buffer.cfg -# Step 2.1.1 (spécifique): Propose un reformatage de sortie pour usage simplifier dans lodex -[fork/exchange] -value = get('value.topics').map((o, i) => _.zip(o.words, o.words_weights).map(x=>x.concat(i).concat(o.topic_weight))).flatten().map(y=> ({source: y[0], target: y[2], weight: y[1], origin: self.id})).filter(Boolean) -[fork/ungroup] -[fork/identify] -path = uuid -scheme = sha -[fork/dedupe] -path = uuid +# Step 2.1 (spécifique): Lancer un calcul sur tous les items reçus +[fork/delegate] +file = lda-segment.cfg # Step 2.2 (générique): Enregister le résulat et signaler que le traitment est fini [fork/delegate]