[ngrams] fix grouping to use mapListSize

parent dd95bc6c
Pipeline #5886 passed with stages
in 84 minutes and 34 seconds
...@@ -164,7 +164,7 @@ buildNgramsTermsList :: ( HasNodeError err ...@@ -164,7 +164,7 @@ buildNgramsTermsList :: ( HasNodeError err
-> GroupParams -> GroupParams
-> (NgramsType, MapListSize) -> (NgramsType, MapListSize)
-> m (Map NgramsType [NgramsElement]) -> m (Map NgramsType [NgramsElement])
buildNgramsTermsList user uCid mCid mfslw groupParams (nt, MapListSize _mapListSize) = do buildNgramsTermsList user uCid mCid mfslw groupParams (nt, MapListSize mapListSize) = do
-- Filter 0 With Double -- Filter 0 With Double
-- Computing global speGen score -- Computing global speGen score
...@@ -184,20 +184,19 @@ buildNgramsTermsList user uCid mCid mfslw groupParams (nt, MapListSize _mapListS ...@@ -184,20 +184,19 @@ buildNgramsTermsList user uCid mCid mfslw groupParams (nt, MapListSize _mapListS
) )
-- printDebug "[buildNgramsTermsList: Flow Social List / end]" nt -- printDebug "[buildNgramsTermsList: Flow Social List / end]" nt
-- let !ngramsKeys = HashSet.fromList let !allKeys = HashMap.keysSet allTerms
-- $ List.take mapListSize
-- $ HashSet.toList
-- $ HashMap.keysSet allTerms
let !ngramsKeys = HashMap.keysSet allTerms
-- printDebug "[buildNgramsTermsList: ngramsKeys]" (HashSet.size ngramsKeys) -- printDebug "[buildNgramsTermsList: ngramsKeys]" (HashSet.size ngramsKeys)
!groupParams' <- getGroupParams groupParams (HashSet.map (text2ngrams . unNgramsTerm) ngramsKeys) !groupParams' <- getGroupParams groupParams (HashSet.map (text2ngrams . unNgramsTerm) allKeys)
let let
!socialLists_Stemmed = addScoreStem groupParams' ngramsKeys socialLists !socialLists_Stemmed = addScoreStem groupParams' allKeys socialLists
!groupedWithList = toGroupedTree socialLists_Stemmed allTerms !groupedWithList = toGroupedTree socialLists_Stemmed allTerms
!(stopTerms, candidateTerms) = HashMap.partition ((== Just StopTerm) . viewListType) !(stopTerms, candidateTerms) = HashMap.partition ((== Just StopTerm) . viewListType)
$ HashMap.fromList
$ List.take mapListSize
$ HashMap.toList
$ HashMap.filter (\g -> view gts'_score g > 1) $ HashMap.filter (\g -> view gts'_score g > 1)
$ view flc_scores groupedWithList $ view flc_scores groupedWithList
......
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