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