buildNgramsOthersList user uCid _groupParams (nt, MapListSize mapListSize) = do
allTerms :: HashMap NgramsTerm (Set NodeId) <- getNodesByNgramsUser uCid nt
- -- | PrivateFirst for first developments since Public NodeMode is not implemented yet
+ -- PrivateFirst for first developments since Public NodeMode is not implemented yet
socialLists :: FlowCont NgramsTerm FlowListScores
<- flowSocialList MySelfFirst user nt ( FlowCont HashMap.empty
$ HashMap.fromList
$ List.sortOn (Down . viewScore . snd)
$ HashMap.toList tailTerms'
+
pure $ Map.fromList [( nt, (toNgramsElement stopTerms)
<> (toNgramsElement mapTerms )
<> (toNgramsElement $ setListType (Just MapTerm ) mapTerms' )
-> m (Map NgramsType [NgramsElement])
buildNgramsTermsList user uCid mCid groupParams (nt, _mapListSize)= do
--- | Filter 0 With Double
+-- Filter 0 With Double
-- Computing global speGen score
allTerms :: HashMap NgramsTerm Double <- getTficf uCid mCid nt
- -- | PrivateFirst for first developments since Public NodeMode is not implemented yet
+ -- PrivateFirst for first developments since Public NodeMode is not implemented yet
socialLists :: FlowCont NgramsTerm FlowListScores
<- flowSocialList MySelfFirst user nt ( FlowCont HashMap.empty
$ HashMap.fromList
printDebug "groupedTreeScores_SetNodeId" groupedTreeScores_SetNodeId
- -- | Coocurrences computation
+ -- Coocurrences computation
--, t1 >= t2 -- permute byAxis diag -- since matrix symmetric
let mapCooc = HashMap.filter (>1) -- removing cooc of 1
$ HashMap.fromList [ ((t1, t2), Set.size $ Set.intersection s1 s2)
-- filter with max score
partitionWithMaxScore = HashMap.partition (\g -> (view scored_genInc $ view gts'_score g)
- > (view scored_speExc $ view gts'_score g)
- )
+ > (view scored_speExc $ view gts'_score g)
+ )
(monoScoredIncl, monoScoredExcl) = partitionWithMaxScore monoScored
(multScoredIncl, multScoredExcl) = partitionWithMaxScore multScored
let
-- use % of list if to big, or Int if to small
mapSize = 1000 :: Double
- canSize = mapSize * 10 :: Double
+ canSize = mapSize * 5 :: Double
inclSize = 0.4 :: Double
exclSize = 1 - inclSize
-- TODO count it too
cands' = setListType (Just CandidateTerm)
- {-$ groupedMonoTail
+ {-\$ groupedMonoTail
<>-} groupedMultTail
+ -- Quick FIX
+ candNgramsElement = List.take 5000
+ $ toNgramsElement cands <> toNgramsElement cands'
+
result = Map.unionsWith (<>)
[ Map.fromList [( nt, toNgramsElement maps
- <> toNgramsElement cands
- <> toNgramsElement cands'
<> toNgramsElement stopTerms
+ <> candNgramsElement
)]
]