Commit 65f36dec authored by Alexandre Delanoë's avatar Alexandre Delanoë

[Lists] fix candidates list

parent 2e194ab3
Pipeline #1467 failed with stage
......@@ -260,18 +260,23 @@ buildNgramsTermsList user uCid mCid groupParams (nt, _mapListSize)= do
inclSize = 0.4 :: Double
exclSize = 1 - inclSize
splitAt' n' = (both (HashMap.fromList)) . (List.splitAt (round $ n' * listSizeLocal))
splitAt' max' n' = (both (HashMap.fromList)) . (List.splitAt (round $ n' * max'))
sortOn f = (List.sortOn (Down . (view (gts'_score . f)) . snd)) . HashMap.toList
monoInc_size = splitAt' $ monoSize * inclSize / 2
(monoScoredInclHead, _monoScoredInclTail) = monoInc_size $ (sortOn scored_genInc) monoScoredIncl
monoInc_size = splitAt' listSizeLocal $ monoSize * inclSize / 2
(monoScoredInclHead, monoScoredInclTail) = monoInc_size $ (sortOn scored_genInc) monoScoredIncl
(monoScoredExclHead, _monoScoredExclTail) = monoInc_size $ (sortOn scored_speExc) monoScoredExcl
multExc_size = splitAt' $ multSize * exclSize / 2
multExc_size = splitAt' listSizeLocal $ multSize * exclSize / 2
(multScoredInclHead, multScoredInclTail) = multExc_size $ (sortOn scored_genInc) multScoredIncl
(multScoredExclHead, multScoredExclTail) = multExc_size $ (sortOn scored_speExc) multScoredExcl
(candidatesHead, _candidatesTail) = splitAt' 4000 (0.5 :: Double)
$ sortOn scored_genInc
$ monoScoredInclTail
<> multScoredInclTail
<> multScoredExclTail
printDebug "stopWords" stopTerms
------------------------------------------------------------
......@@ -285,11 +290,7 @@ buildNgramsTermsList user uCid mCid groupParams (nt, _mapListSize)= do
<> multScoredExclHead
-- An original way to filter to start with
cands = setListType (Just CandidateTerm)
$ {- monoScoredInclTail
<> monoScoredExclTail
<> -} multScoredInclTail
<> multScoredExclTail
cands = setListType (Just CandidateTerm) candidatesHead
cands' = setListType (Just CandidateTerm)
{-$ groupedMonoTail
......@@ -303,6 +304,4 @@ buildNgramsTermsList user uCid mCid groupParams (nt, _mapListSize)= do
)]
]
-- printDebug "result" result
pure result
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