Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Grégoire Locqueville
haskell-gargantext
Commits
9ef97b9a
Verified
Commit
9ef97b9a
authored
Apr 08, 2024
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ngrams] fix grouping to use mapListSize
parent
dd95bc6c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
+8
-9
List.hs
src/Gargantext/Core/Text/List.hs
+8
-9
No files found.
src/Gargantext/Core/Text/List.hs
View file @
9ef97b9a
...
@@ -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,25 +184,24 @@ buildNgramsTermsList user uCid mCid mfslw groupParams (nt, MapListSize _mapListS
...
@@ -184,25 +184,24 @@ 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
)
ngrams
Keys
)
!
groupParams'
<-
getGroupParams
groupParams
(
HashSet
.
map
(
text2ngrams
.
unNgramsTerm
)
all
Keys
)
let
let
!
socialLists_Stemmed
=
addScoreStem
groupParams'
ngrams
Keys
socialLists
!
socialLists_Stemmed
=
addScoreStem
groupParams'
all
Keys
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
-- | Split candidateTerms into mono-terms and multi-terms.
-- | Split candidateTerms into mono-terms and multi-terms.
!
(
groupedMono
,
groupedMult
)
=
HashMap
.
partitionWithKey
(
\
(
NgramsTerm
t
)
_v
->
size
t
<
2
)
candidateTerms
!
(
groupedMono
,
groupedMult
)
=
HashMap
.
partitionWithKey
(
\
(
NgramsTerm
t
)
_v
->
size
t
<
2
)
candidateTerms
-- void $ panicTrace $ "groupedWithList: " <> show groupedWithList
-- void $ panicTrace $ "groupedWithList: " <> show groupedWithList
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment