Commit e3fed9b2 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[FIX] Candiate List Size

parent 3cf08bbe
Pipeline #1531 passed with stage
in 18 minutes and 17 seconds
...@@ -118,6 +118,7 @@ buildNgramsOthersList user uCid _groupParams (nt, MapListSize mapListSize) = do ...@@ -118,6 +118,7 @@ buildNgramsOthersList user uCid _groupParams (nt, MapListSize mapListSize) = do
$ List.sortOn (Down . viewScore . snd) $ List.sortOn (Down . viewScore . snd)
$ HashMap.toList tailTerms' $ HashMap.toList tailTerms'
pure $ Map.fromList [( nt, (toNgramsElement stopTerms) pure $ Map.fromList [( nt, (toNgramsElement stopTerms)
<> (toNgramsElement mapTerms ) <> (toNgramsElement mapTerms )
<> (toNgramsElement $ setListType (Just MapTerm ) mapTerms' ) <> (toNgramsElement $ setListType (Just MapTerm ) mapTerms' )
...@@ -265,8 +266,8 @@ buildNgramsTermsList user uCid mCid groupParams (nt, _mapListSize)= do ...@@ -265,8 +266,8 @@ buildNgramsTermsList user uCid mCid groupParams (nt, _mapListSize)= do
splitAt' max' n' = (both (HashMap.fromList)) . (List.splitAt (round $ n' * max')) 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 n = splitAt' n $ monoSize * inclSize / 4 monoInc_size n = splitAt' n $ monoSize * inclSize / 2
multExc_size n = splitAt' n $ multSize * exclSize / 4 multExc_size n = splitAt' n $ multSize * exclSize / 2
(mapMonoScoredInclHead, monoScoredInclTail) = monoInc_size mapSize $ (sortOn scored_genInc) monoScoredIncl (mapMonoScoredInclHead, monoScoredInclTail) = monoInc_size mapSize $ (sortOn scored_genInc) monoScoredIncl
...@@ -304,11 +305,14 @@ buildNgramsTermsList user uCid mCid groupParams (nt, _mapListSize)= do ...@@ -304,11 +305,14 @@ buildNgramsTermsList user uCid mCid groupParams (nt, _mapListSize)= do
{-\$ groupedMonoTail {-\$ groupedMonoTail
<>-} groupedMultTail <>-} groupedMultTail
-- Quick FIX
candNgramsElement = List.take 5000
$ toNgramsElement cands <> toNgramsElement cands'
result = Map.unionsWith (<>) result = Map.unionsWith (<>)
[ Map.fromList [( nt, toNgramsElement maps [ Map.fromList [( nt, toNgramsElement maps
<> toNgramsElement cands
<> toNgramsElement cands'
<> toNgramsElement stopTerms <> toNgramsElement stopTerms
<> candNgramsElement
)] )]
] ]
......
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